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,32 +33,38 @@ $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">
</div> <h5 class="modal-title" id="donateLabel">ZoneMinder - <?php echo translate('Donate') ?></h5>
<div id="content"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<form name="contentForm" id="contentForm" method="post" action="?"> <span aria-hidden="true">&times;</span>
<input type="hidden" name="view" value="donate"/> </button>
<input type="hidden" name="action" value="donate"/> </div>
<p> <div class="modal-body">
<?php echo translate('DonateEnticement') ?> <form name="contentForm" id="contentForm" method="post" action="?">
</p> <input type="hidden" name="view" value="donate"/>
<p> <input type="hidden" name="action" value="donate"/>
<?php echo buildSelect('option', $options); ?> <p>
</p> <?php echo translate('DonateEnticement') ?>
<div id="contentButtons"> </p>
<button type="submit"><?php echo translate('Apply') ?></button> <p>
<button type="button" data-on-click="closeWindow"><?php echo translate('Close') ?></button> <?php echo buildSelect('option', $options); ?>
</div> </p>
</form> <div id="contentButtons">
<button type="submit"><?php echo translate('Apply') ?></button>
<button type="button" data-on-click="closeWindow"><?php echo translate('Close') ?></button>
</div>
</form>
</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> </div>
</div> </div>
</body> </div>
</html>

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);
} }