Merge branch 'master' of github.com:ZoneMinder/zoneminder

This commit is contained in:
Isaac Connor 2020-08-24 12:05:25 -04:00
commit bce38ae2c6
5 changed files with 39 additions and 33 deletions

View File

@ -136,7 +136,7 @@ void Zone::RecordStats(const Event *event) {
db_mutex.lock(); db_mutex.lock();
snprintf(sql, sizeof(sql), snprintf(sql, sizeof(sql),
"INSERT INTO Stats SET MonitorId=%d, ZoneId=%d, EventId=%" PRIu64 ", FrameId=%d, PixelDiff=%d, AlarmPixels=%d, FilterPixels=%d, BlobPixels=%d, Blobs=%d, MinBlobSize=%d, MaxBlobSize=%d, MinX=%d, MinY=%d, MaxX=%d, MaxY=%d, Score=%d", "INSERT INTO Stats SET MonitorId=%d, ZoneId=%d, EventId=%" PRIu64 ", FrameId=%d, PixelDiff=%d, AlarmPixels=%d, FilterPixels=%d, BlobPixels=%d, Blobs=%d, MinBlobSize=%d, MaxBlobSize=%d, MinX=%d, MinY=%d, MaxX=%d, MaxY=%d, Score=%d",
monitor->Id(), id, event->Id(), event->Frames()+1, pixel_diff, alarm_pixels, alarm_filter_pixels, alarm_blob_pixels, alarm_blobs, min_blob_size, max_blob_size, alarm_box.LoX(), alarm_box.LoY(), alarm_box.HiX(), alarm_box.HiY(), score monitor->Id(), id, event->Id(), event->Frames(), pixel_diff, alarm_pixels, alarm_filter_pixels, alarm_blob_pixels, alarm_blobs, min_blob_size, max_blob_size, alarm_box.LoX(), alarm_box.LoY(), alarm_box.HiX(), alarm_box.HiY(), score
); );
if ( mysql_query(&dbconn, sql) ) { if ( mysql_query(&dbconn, sql) ) {
Error("Can't insert event stats: %s", mysql_error(&dbconn)); Error("Can't insert event stats: %s", mysql_error(&dbconn));

View File

@ -426,4 +426,8 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
</div> </div>
</div> </div>
</form> </form>
<?php xhtmlFooter() ?> <?php
xhtmlFooter();
// Include Donate Modal
include('donate.php');
?>

View File

@ -33,17 +33,18 @@ $options = array(
'already' => translate('DonateAlready'), 'already' => translate('DonateAlready'),
); );
$focusWindow = true;
xhtmlHeaders(__FILE__, translate('Donate'));
?> ?>
<body> <!-- Donate Modal -->
<div id="page"> <div class="modal fade" id="donate" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div id="header"> <div class="modal-dialog">
<h2><?php echo translate('Donate') ?></h2> <div class="modal-content">
<h1>ZoneMinder - <?php echo translate('Donate') ?></h1> <div class="modal-header">
<h5 class="modal-title" id="donateLabel">ZoneMinder - <?php echo translate('Donate') ?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div> </div>
<div id="content"> <div class="modal-body">
<form name="contentForm" id="contentForm" method="post" action="?"> <form name="contentForm" id="contentForm" method="post" action="?">
<input type="hidden" name="view" value="donate"/> <input type="hidden" name="view" value="donate"/>
<input type="hidden" name="action" value="donate"/> <input type="hidden" name="action" value="donate"/>
@ -59,6 +60,11 @@ xhtmlHeaders(__FILE__, translate('Donate'));
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Understood</button>
</div> </div>
</body> </div>
</html> </div>
</div>

View File

@ -140,7 +140,7 @@ function initPage() {
createPopup('?view=version', 'zmVersion', 'version'); createPopup('?view=version', 'zmVersion', 'version');
} }
if ( showDonatePopup ) { if ( showDonatePopup ) {
createPopup('?view=donate', 'zmDonate', 'donate'); $j('#donate').modal('show');
} }
// Makes table sortable // Makes table sortable

View File

@ -19,11 +19,7 @@ function initThumbAnimation() {
function processClicks(event, field, value, row, $element) { function processClicks(event, field, value, row, $element) {
if ( field == 'FramesScore' ) { if ( field == 'FramesScore' ) {
if ( value > 0 ) {
window.location.assign('?view=stats&eid='+row.EventId+'&fid='+row.FramesId); window.location.assign('?view=stats&eid='+row.EventId+'&fid='+row.FramesId);
} else {
alert("No statistics available");
}
} else { } else {
window.location.assign('?view=frame&eid='+row.EventId+'&fid='+row.FramesId); window.location.assign('?view=frame&eid='+row.EventId+'&fid='+row.FramesId);
} }