Add montagereview filter passing
montagereview now accepts any appropriate filters
This commit is contained in:
parent
6d6b4366de
commit
7a188a84f7
|
@ -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>
|
<li><a href="?view=montage"<?php echo $view=='montage'?' class="selected"':''?>><?php echo translate('Montage') ?></a></li>
|
||||||
<?php
|
<?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') ) {
|
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
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -59,17 +59,18 @@ include('_monitor_filters.php');
|
||||||
$filter_bar = ob_get_contents();
|
$filter_bar = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
$filter = array(
|
if (isset($_REQUEST['minTime']) || isset($_REQUEST['maxTime'])) {
|
||||||
|
$filter = array(
|
||||||
'Query' => array(
|
'Query' => array(
|
||||||
'terms' => array(
|
'terms' => array(
|
||||||
array('attr' => 'StartDateTime', 'op' => '>=', 'val' => $_REQUEST[minTime]),
|
array('attr' => 'StartDateTime', 'op' => '>=', 'val' => $_REQUEST['minTime']),
|
||||||
array('attr' => 'StartDateTime', 'op' => '<=', 'val' => $_REQUEST[maxTime]),
|
array('attr' => 'StartDateTime', 'op' => '<=', 'val' => $_REQUEST['maxTime']),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
parseFilter( $filter );
|
||||||
parseFilter( $filter );
|
$filterQuery = $filter['query'];
|
||||||
$filterQuery = $filter['query'];
|
}
|
||||||
|
|
||||||
// Note that this finds incomplete events as well, and any frame records written, but still cannot "see" to the end frame
|
// 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)
|
// 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)
|
||||||
|
|
Loading…
Reference in New Issue