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();
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",
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) ) {
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>
</form>
<?php xhtmlFooter() ?>
<?php
xhtmlFooter();
// Include Donate Modal
include('donate.php');
?>

View File

@ -33,32 +33,38 @@ $options = array(
'already' => translate('DonateAlready'),
);
$focusWindow = true;
xhtmlHeaders(__FILE__, translate('Donate'));
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('Donate') ?></h2>
<h1>ZoneMinder - <?php echo translate('Donate') ?></h1>
</div>
<div id="content">
<form name="contentForm" id="contentForm" method="post" action="?">
<input type="hidden" name="view" value="donate"/>
<input type="hidden" name="action" value="donate"/>
<p>
<?php echo translate('DonateEnticement') ?>
</p>
<p>
<?php echo buildSelect('option', $options); ?>
</p>
<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>
<!-- Donate Modal -->
<div class="modal fade" id="donate" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<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 class="modal-body">
<form name="contentForm" id="contentForm" method="post" action="?">
<input type="hidden" name="view" value="donate"/>
<input type="hidden" name="action" value="donate"/>
<p>
<?php echo translate('DonateEnticement') ?>
</p>
<p>
<?php echo buildSelect('option', $options); ?>
</p>
<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>
</body>
</html>
</div>

View File

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

View File

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