Add montagereview filter passing

montagereview now accepts any appropriate filters
This commit is contained in:
digital-gnome 2017-12-02 12:25:18 -05:00
parent 6d6b4366de
commit 7a188a84f7
2 changed files with 22 additions and 7 deletions

View File

@ -224,9 +224,23 @@ if ( ZM_OPT_X10 && canView( 'Devices' ) ) { ?>
<li><a href="?view=montage"<?php echo $view=='montage'?' class="selected"':''?>><?php echo translate('Montage') ?></a></li>
<?php
}
if (isset($_REQUEST['filter']['Query']['terms'])) {
$terms = $_REQUEST['filter']['Query']['terms'];
$count = 0;
foreach ($terms as $term) {
if ($term['attr'] == "StartDateTime") {
$count += 1;
if ($term['op'] == '>=') $minTime = $term['val'];
if ($term['op'] == '<=') $maxTime = $term['val'];
}
}
if ($count == 2) {
$montageReviewQuery = '&minTime='.$minTime.'&maxTime='.$maxTime;
}
}
if ( canView('Events') ) {
?>
<li><a href="?view=montagereview"<?php echo $view=='montagereview'?' class="selected"':''?>><?php echo translate('MontageReview')?></a></li>
<li><a href="?view=montagereview<?php echo isset($montageReviewQuery)?'&fit=1'.$montageReviewQuery.'&live=0':'' ?>"<?php echo $view=='montagereview'?' class="selected"':''?>><?php echo translate('MontageReview')?></a></li>
<?php
}
?>

View File

@ -59,17 +59,18 @@ include('_monitor_filters.php');
$filter_bar = ob_get_contents();
ob_end_clean();
$filter = array(
if (isset($_REQUEST['minTime']) || isset($_REQUEST['maxTime'])) {
$filter = array(
'Query' => array(
'terms' => array(
array('attr' => 'StartDateTime', 'op' => '>=', 'val' => $_REQUEST[minTime]),
array('attr' => 'StartDateTime', 'op' => '<=', 'val' => $_REQUEST[maxTime]),
array('attr' => 'StartDateTime', 'op' => '>=', 'val' => $_REQUEST['minTime']),
array('attr' => 'StartDateTime', 'op' => '<=', 'val' => $_REQUEST['maxTime']),
)
),
);
parseFilter( $filter );
$filterQuery = $filter['query'];
parseFilter( $filter );
$filterQuery = $filter['query'];
}
// Note that this finds incomplete events as well, and any frame records written, but still cannot "see" to the end frame
// if the bulk record has not been written - to be able to include more current frames reduce bulk frame sizes (event size can be large)