Merge ../ZoneMinder.connortechnology
This commit is contained in:
commit
dd029164eb
|
@ -111,6 +111,10 @@ if ( ($report + $interactive + $continuous) > 1 ) {
|
||||||
pod2usage(-exitstatus => -1);
|
pod2usage(-exitstatus => -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! exists $Config{ZM_AUDIT_MIN_AGE} ) {
|
||||||
|
Fatal('ZM_AUDIT_MIN_AGE is not set in config.');
|
||||||
|
}
|
||||||
|
|
||||||
my $dbh = zmDbConnect();
|
my $dbh = zmDbConnect();
|
||||||
|
|
||||||
chdir( EVENT_PATH );
|
chdir( EVENT_PATH );
|
||||||
|
@ -145,12 +149,8 @@ MAIN: while( $loop ) {
|
||||||
sleep 1;
|
sleep 1;
|
||||||
} # end if
|
} # end if
|
||||||
|
|
||||||
if ( ! exists $Config{ZM_AUDIT_MIN_AGE} ) {
|
|
||||||
Fatal('ZM_AUDIT_MIN_AGE is not set in config.');
|
|
||||||
}
|
|
||||||
|
|
||||||
my $db_monitors;
|
my $db_monitors;
|
||||||
my $monitorSelectSql = "select Id from Monitors order by Id";
|
my $monitorSelectSql = 'select Id from Monitors order by Id';
|
||||||
my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql )
|
my $monitorSelectSth = $dbh->prepare_cached( $monitorSelectSql )
|
||||||
or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() );
|
or Fatal( "Can't prepare '$monitorSelectSql': ".$dbh->errstr() );
|
||||||
my $eventSelectSql = 'SELECT Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age
|
my $eventSelectSql = 'SELECT Id, (unix_timestamp() - unix_timestamp(StartTime)) as Age
|
||||||
|
@ -185,11 +185,11 @@ MAIN: while( $loop ) {
|
||||||
Debug( "Checking day dir $day_dir" );
|
Debug( "Checking day dir $day_dir" );
|
||||||
( $day_dir ) = ( $day_dir =~ /^(.*)$/ ); # De-taint
|
( $day_dir ) = ( $day_dir =~ /^(.*)$/ ); # De-taint
|
||||||
if ( ! chdir( $day_dir ) ) {
|
if ( ! chdir( $day_dir ) ) {
|
||||||
Error( "Can't chdir to '$$Storage{Path}/$day_dir': $!" );
|
Error( "Can't chdir to '$day_dir': $!" );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( ! opendir( DIR, '.' ) ) {
|
if ( ! opendir( DIR, '.' ) ) {
|
||||||
Error( "Can't open directory '$$Storage{Path}/$day_dir': $!" );
|
Error( "Can't open directory '$day_dir': $!" );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -361,7 +361,7 @@ int FfmpegCamera::OpenFfmpeg() {
|
||||||
Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );
|
Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAudioStreamId >= 0) {
|
if ( mAudioStreamId >= 0 ) {
|
||||||
mAudioCodecContext = mFormatContext->streams[mAudioStreamId]->codec;
|
mAudioCodecContext = mFormatContext->streams[mAudioStreamId]->codec;
|
||||||
if ((mAudioCodec = avcodec_find_decoder(mAudioCodecContext->codec_id)) == NULL) {
|
if ((mAudioCodec = avcodec_find_decoder(mAudioCodecContext->codec_id)) == NULL) {
|
||||||
Debug(1, "Can't find codec for audio stream from %s", mPath.c_str());
|
Debug(1, "Can't find codec for audio stream from %s", mPath.c_str());
|
||||||
|
@ -434,7 +434,7 @@ int FfmpegCamera::OpenFfmpeg() {
|
||||||
mCanCapture = true;
|
mCanCapture = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
} // int FfmpegCamera::OpenFfmpeg()
|
||||||
|
|
||||||
int FfmpegCamera::ReopenFfmpeg() {
|
int FfmpegCamera::ReopenFfmpeg() {
|
||||||
|
|
||||||
|
@ -689,8 +689,11 @@ else if ( packet.pts && video_last_pts > packet.pts ) {
|
||||||
|
|
||||||
// The following lines should ensure that the queue always begins with a video keyframe
|
// The following lines should ensure that the queue always begins with a video keyframe
|
||||||
if ( packet.stream_index == mAudioStreamId ) {
|
if ( packet.stream_index == mAudioStreamId ) {
|
||||||
if ( record_audio && packetqueue.size() ) // if it's audio, and we are doing audio, and there is already something in the queue
|
Debug(2, "Have audio packet, reocrd_audio is (%d) and packetqueue.size is (%d)", record_audio, packetqueue.size() );
|
||||||
|
if ( record_audio && packetqueue.size() ) {
|
||||||
|
// if it's audio, and we are doing audio, and there is already something in the queue
|
||||||
packetqueue.queuePacket( &packet );
|
packetqueue.queuePacket( &packet );
|
||||||
|
}
|
||||||
} else if ( packet.stream_index == mVideoStreamId ) {
|
} else if ( packet.stream_index == mVideoStreamId ) {
|
||||||
if ( key_frame || packetqueue.size() ) // it's a keyframe or we already have something in the queue
|
if ( key_frame || packetqueue.size() ) // it's a keyframe or we already have something in the queue
|
||||||
packetqueue.queuePacket( &packet );
|
packetqueue.queuePacket( &packet );
|
||||||
|
|
|
@ -331,7 +331,7 @@ echo $Server->Name();
|
||||||
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
|
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
|
||||||
<input type="button" name="addBtn" value="<?php echo translate('AddNewMonitor') ?>" onclick="addMonitor( this )"/>
|
<input type="button" name="addBtn" value="<?php echo translate('AddNewMonitor') ?>" onclick="addMonitor( this )"/>
|
||||||
<!-- <?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?> -->
|
<!-- <?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?> -->
|
||||||
<?php echo makePopupButton( urlencode('?view=filter&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3c&filter[terms][0][val]=now'), 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?>
|
<?php echo makePopupButton( '?view=filter&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3c&filter[terms][0][val]=now', 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php
|
<?php
|
||||||
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
||||||
|
@ -342,7 +342,10 @@ for ( $i = 0; $i < count($eventCounts); $i++ ) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td class="colZones"><?php echo $zoneCount ?></td>
|
<td class="colZones"><?php echo $zoneCount ?></td>
|
||||||
<td class="colRightButtons" colspan="<?php echo canEdit('Monitors')?2:1 ?>"><input type="button" name="editBtn" value="<?php echo translate('Edit') ?>" onclick="editMonitor( this )" disabled="disabled"/><input type="button" name="deleteBtn" value="<?php echo translate('Delete') ?>" onclick="deleteMonitor( this )" disabled="disabled"/></td>
|
<td class="colRightButtons" colspan="<?php echo canEdit('Monitors')?2:1 ?>">
|
||||||
|
<input type="button" name="editBtn" value="<?php echo translate('Edit') ?>" onclick="editMonitor( this )" disabled="disabled"/>
|
||||||
|
<input type="button" name="deleteBtn" value="<?php echo translate('Delete') ?>" onclick="deleteMonitor( this )" disabled="disabled"/>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -18,34 +18,31 @@
|
||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
//
|
//
|
||||||
|
|
||||||
if ( !canView( 'Events' ) )
|
if ( !canView( 'Events' ) ) {
|
||||||
{
|
$view = 'error';
|
||||||
$view = "error";
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$selectName = "filterName";
|
$selectName = 'filterName';
|
||||||
$filterNames = array( ''=>translate('ChooseFilter') );
|
$filterNames = array( ''=>translate('ChooseFilter') );
|
||||||
foreach ( dbFetchAll( "select * from Filters order by Name" ) as $row )
|
foreach ( dbFetchAll( 'select * from Filters order by Name' ) as $row ) {
|
||||||
{
|
$filterNames[$row['Name']] = $row['Name'];
|
||||||
$filterNames[$row['Name']] = $row['Name'];
|
if ( $row['Background'] )
|
||||||
if ( $row['Background'] )
|
$filterNames[$row['Name']] .= '*';
|
||||||
$filterNames[$row['Name']] .= "*";
|
if ( !empty($_REQUEST['reload']) && isset($_REQUEST['filterName']) && $_REQUEST['filterName'] == $row['Name'] )
|
||||||
if ( !empty($_REQUEST['reload']) && isset($_REQUEST['filterName']) && $_REQUEST['filterName'] == $row['Name'] )
|
$dbFilter = $row;
|
||||||
$dbFilter = $row;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$backgroundStr = "";
|
$backgroundStr = '';
|
||||||
if ( isset($dbFilter) )
|
if ( isset($dbFilter) ) {
|
||||||
{
|
if ( $dbFilter['Background'] )
|
||||||
if ( $dbFilter['Background'] )
|
$backgroundStr = '['.strtolower(translate('Background')).']';
|
||||||
$backgroundStr = '['.strtolower(translate('Background')).']';
|
$_REQUEST['filter'] = jsonDecode( $dbFilter['Query'] );
|
||||||
$_REQUEST['filter'] = jsonDecode( $dbFilter['Query'] );
|
$_REQUEST['sort_field'] = isset($_REQUEST['filter']['sort_field'])?$_REQUEST['filter']['sort_field']:"DateTime";
|
||||||
$_REQUEST['sort_field'] = isset($_REQUEST['filter']['sort_field'])?$_REQUEST['filter']['sort_field']:"DateTime";
|
$_REQUEST['sort_asc'] = isset($_REQUEST['filter']['sort_asc'])?$_REQUEST['filter']['sort_asc']:"1";
|
||||||
$_REQUEST['sort_asc'] = isset($_REQUEST['filter']['sort_asc'])?$_REQUEST['filter']['sort_asc']:"1";
|
$_REQUEST['limit'] = isset($_REQUEST['filter']['limit'])?$_REQUEST['filter']['limit']:"";
|
||||||
$_REQUEST['limit'] = isset($_REQUEST['filter']['limit'])?$_REQUEST['filter']['limit']:"";
|
unset( $_REQUEST['filter']['sort_field'] );
|
||||||
unset( $_REQUEST['filter']['sort_field'] );
|
unset( $_REQUEST['filter']['sort_asc'] );
|
||||||
unset( $_REQUEST['filter']['sort_asc'] );
|
unset( $_REQUEST['filter']['limit'] );
|
||||||
unset( $_REQUEST['filter']['limit'] );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# reload is set when the dropdown is changed.
|
# reload is set when the dropdown is changed.
|
||||||
|
@ -64,16 +61,14 @@ if ( isset( $_REQUEST['reload'] ) and ! $_REQUEST['reload'] ) {
|
||||||
$conjunctionTypes = array(
|
$conjunctionTypes = array(
|
||||||
'and' => translate('ConjAnd'),
|
'and' => translate('ConjAnd'),
|
||||||
'or' => translate('ConjOr')
|
'or' => translate('ConjOr')
|
||||||
);
|
);
|
||||||
$obracketTypes = array();
|
$obracketTypes = array();
|
||||||
$cbracketTypes = array();
|
$cbracketTypes = array();
|
||||||
if ( isset($_REQUEST['filter']['terms']) )
|
if ( isset($_REQUEST['filter']['terms']) ) {
|
||||||
{
|
for ( $i = 0; $i <= count($_REQUEST['filter']['terms'])-2; $i++ ) {
|
||||||
for ( $i = 0; $i <= count($_REQUEST['filter']['terms'])-2; $i++ )
|
$obracketTypes[$i] = str_repeat( "(", $i );
|
||||||
{
|
$cbracketTypes[$i] = str_repeat( ")", $i );
|
||||||
$obracketTypes[$i] = str_repeat( "(", $i );
|
}
|
||||||
$cbracketTypes[$i] = str_repeat( ")", $i );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$attrTypes = array(
|
$attrTypes = array(
|
||||||
|
@ -98,7 +93,7 @@ $attrTypes = array(
|
||||||
'DiskBlocks' => translate('AttrDiskBlocks'),
|
'DiskBlocks' => translate('AttrDiskBlocks'),
|
||||||
'SystemLoad' => translate('AttrSystemLoad'),
|
'SystemLoad' => translate('AttrSystemLoad'),
|
||||||
'ServerId' => translate('AttrServer'),
|
'ServerId' => translate('AttrServer'),
|
||||||
);
|
);
|
||||||
$opTypes = array(
|
$opTypes = array(
|
||||||
'=' => translate('OpEq'),
|
'=' => translate('OpEq'),
|
||||||
'!=' => translate('OpNe'),
|
'!=' => translate('OpNe'),
|
||||||
|
@ -110,15 +105,14 @@ $opTypes = array(
|
||||||
'!~' => translate('OpNotMatches'),
|
'!~' => translate('OpNotMatches'),
|
||||||
'=[]' => translate('OpIn'),
|
'=[]' => translate('OpIn'),
|
||||||
'![]' => translate('OpNotIn'),
|
'![]' => translate('OpNotIn'),
|
||||||
);
|
);
|
||||||
$archiveTypes = array(
|
$archiveTypes = array(
|
||||||
'0' => translate('ArchUnarchived'),
|
'0' => translate('ArchUnarchived'),
|
||||||
'1' => translate('ArchArchived')
|
'1' => translate('ArchArchived')
|
||||||
);
|
);
|
||||||
$weekdays = array();
|
$weekdays = array();
|
||||||
for ( $i = 0; $i < 7; $i++ )
|
for ( $i = 0; $i < 7; $i++ ) {
|
||||||
{
|
$weekdays[$i] = strftime( '%A', mktime( 12, 0, 0, 1, $i+1, 2001 ) );
|
||||||
$weekdays[$i] = strftime( "%A", mktime( 12, 0, 0, 1, $i+1, 2001 ) );
|
|
||||||
}
|
}
|
||||||
$sort_fields = array(
|
$sort_fields = array(
|
||||||
'Id' => translate('AttrId'),
|
'Id' => translate('AttrId'),
|
||||||
|
@ -133,13 +127,12 @@ $sort_fields = array(
|
||||||
'TotScore' => translate('AttrTotalScore'),
|
'TotScore' => translate('AttrTotalScore'),
|
||||||
'AvgScore' => translate('AttrAvgScore'),
|
'AvgScore' => translate('AttrAvgScore'),
|
||||||
'MaxScore' => translate('AttrMaxScore'),
|
'MaxScore' => translate('AttrMaxScore'),
|
||||||
);
|
);
|
||||||
$sort_dirns = array(
|
$sort_dirns = array(
|
||||||
'1' => translate('SortAsc'),
|
'1' => translate('SortAsc'),
|
||||||
'0' => translate('SortDesc')
|
'0' => translate('SortDesc')
|
||||||
);
|
);
|
||||||
if ( empty($_REQUEST['sort_field']) )
|
if ( empty($_REQUEST['sort_field']) ) {
|
||||||
{
|
|
||||||
$_REQUEST['sort_field'] = ZM_WEB_EVENT_SORT_FIELD;
|
$_REQUEST['sort_field'] = ZM_WEB_EVENT_SORT_FIELD;
|
||||||
$_REQUEST['sort_asc'] = (ZM_WEB_EVENT_SORT_ORDER == "asc");
|
$_REQUEST['sort_asc'] = (ZM_WEB_EVENT_SORT_ORDER == "asc");
|
||||||
}
|
}
|
||||||
|
@ -174,105 +167,93 @@ xhtmlHeaders(__FILE__, translate('EventFilter') );
|
||||||
<table id="fieldsTable" class="filterTable" cellspacing="0">
|
<table id="fieldsTable" class="filterTable" cellspacing="0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ )
|
for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['terms']); $i++ ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<?php
|
<?php
|
||||||
if ( $i == 0 )
|
if ( $i == 0 ) {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][cnj]", $conjunctionTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][cnj]", $conjunctionTypes ); ?></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td><?php if ( count($_REQUEST['filter']['terms']) > 2 ) { echo buildSelect( "filter[terms][$i][obr]", $obracketTypes ); } else { ?> <?php } ?></td>
|
<td><?php if ( count($_REQUEST['filter']['terms']) > 2 ) { echo buildSelect( "filter[terms][$i][obr]", $obracketTypes ); } else { ?> <?php } ?></td>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][attr]", $attrTypes, "clearValue( this, $i ); submitToFilter( this, 0 );" ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][attr]", $attrTypes, "clearValue( this, $i ); submitToFilter( this, 0 );" ); ?></td>
|
||||||
<?php
|
<?php
|
||||||
if ( isset($_REQUEST['filter']['terms'][$i]['attr']) )
|
if ( isset($_REQUEST['filter']['terms'][$i]['attr']) ) {
|
||||||
{
|
if ( $_REQUEST['filter']['terms'][$i]['attr'] == 'Archived' ) {
|
||||||
if ( $_REQUEST['filter']['terms'][$i]['attr'] == "Archived" )
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo translate('OpEq') ?><input type="hidden" name="filter[terms][<?php echo $i ?>][op]" value="="/></td>
|
<td><?php echo translate('OpEq') ?><input type="hidden" name="filter[terms][<?php echo $i ?>][op]" value="="/></td>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][val]", $archiveTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][val]", $archiveTypes ); ?></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == 'DateTime' ) {
|
||||||
elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == "DateTime" )
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><input name="filter[terms][<?php echo $i ?>][val]" id="filter[terms][<?php echo $i ?>][val]" value="<?php echo isset($_REQUEST['filter']['terms'][$i]['val'])?validHtmlStr($_REQUEST['filter']['terms'][$i]['val']):'' ?>"/><?php if ( $hasCal ) { ?><script type="text/javascript">Calendar.setup( { inputField: "filter[terms][<?php echo $i ?>][val]", ifFormat: "%Y-%m-%d %H:%M", showsTime: true, timeFormat: "24", showOthers: true, weekNumbers: false });</script><?php } ?></td>
|
<td>
|
||||||
|
<input name="filter[terms][<?php echo $i ?>][val]" id="filter[terms][<?php echo $i ?>][val]" value="<?php echo isset($_REQUEST['filter']['terms'][$i]['val'])?validHtmlStr($_REQUEST['filter']['terms'][$i]['val']):'' ?>"/>
|
||||||
|
<?php if ( $hasCal ) { ?>
|
||||||
|
<script type="text/javascript">Calendar.setup( { inputField: "filter[terms][<?php echo $i ?>][val]", ifFormat: "%Y-%m-%d %H:%M", showsTime: true, timeFormat: "24", showOthers: true, weekNumbers: false });</script>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == 'Date' ) {
|
||||||
elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == "Date" )
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><input name="filter[terms][<?php echo $i ?>][val]" id="filter[terms][<?php echo $i ?>][val]" value="<?php echo isset($_REQUEST['filter']['terms'][$i]['val'])?validHtmlStr($_REQUEST['filter']['terms'][$i]['val']):'' ?>"/><?php if ( $hasCal ) { ?><script type="text/javascript">Calendar.setup( { inputField: "filter[terms][<?php echo $i ?>][val]", ifFormat: "%Y-%m-%d", showOthers: true, weekNumbers: false });</script><?php } ?></td>
|
<td>
|
||||||
|
<input name="filter[terms][<?php echo $i ?>][val]" id="filter[terms][<?php echo $i ?>][val]" value="<?php echo isset($_REQUEST['filter']['terms'][$i]['val'])?validHtmlStr($_REQUEST['filter']['terms'][$i]['val']):'' ?>"/>
|
||||||
|
<?php if ( $hasCal ) { ?>
|
||||||
|
<script type="text/javascript">Calendar.setup( { inputField: "filter[terms][<?php echo $i ?>][val]", ifFormat: "%Y-%m-%d", showOthers: true, weekNumbers: false });</script>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == 'Weekday' ) {
|
||||||
elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == "Weekday" )
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][val]", $weekdays ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][val]", $weekdays ); ?></td>
|
||||||
<?php
|
<?php
|
||||||
|
} elseif ( false && $_REQUEST['filter']['terms'][$i]['attr'] == 'MonitorName' ) {
|
||||||
|
$monitors = array();
|
||||||
|
foreach ( dbFetchAll( "select Id,Name from Monitors order by Sequence asc" ) as $monitor ) {
|
||||||
|
if ( visibleMonitor( $monitor['Id'] ) ) {
|
||||||
|
$monitors[$monitor['Name']] = $monitor['Name'];
|
||||||
}
|
}
|
||||||
elseif ( false && $_REQUEST['filter']['terms'][$i]['attr'] == "MonitorName" )
|
}
|
||||||
{
|
|
||||||
$monitors = array();
|
|
||||||
foreach ( dbFetchAll( "select Id,Name from Monitors order by Sequence asc" ) as $monitor )
|
|
||||||
{
|
|
||||||
if ( visibleMonitor( $monitor['Id'] ) )
|
|
||||||
{
|
|
||||||
$monitors[$monitor['Name']] = $monitor['Name'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][val]", $monitors ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][val]", $monitors ); ?></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == 'ServerId' ) {
|
||||||
elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == "ServerId" )
|
$servers = array();
|
||||||
{
|
$servers['ZM_SERVER_ID'] = 'Current Server';
|
||||||
$servers = array();
|
foreach ( dbFetchAll( 'SELECT Id,Name FROM Servers ORDER BY lower(Name) ASC' ) as $server ) {
|
||||||
$servers['ZM_SERVER_ID'] = 'Current Server';
|
$servers[$server['Id']] = $server['Name'];
|
||||||
foreach ( dbFetchAll( "SELECT Id,Name FROM Servers ORDER BY lower(Name) ASC" ) as $server ) {
|
}
|
||||||
$servers[$server['Id']] = $server['Name'];
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][val]", $servers ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][val]", $servers ); ?></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><input name="filter[terms][<?php echo $i ?>][val]" value="<?php echo $_REQUEST['filter']['terms'][$i]['val'] ?>"/></td>
|
<td><input name="filter[terms][<?php echo $i ?>][val]" value="<?php echo $_REQUEST['filter']['terms'][$i]['val'] ?>"/></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
|
||||||
<td><input name="filter[terms][<?php echo $i ?>][val]" value="<?php echo isset($_REQUEST['filter']['terms'][$i]['val'])?$_REQUEST['filter']['terms'][$i]['val']:'' ?>"/></td>
|
<td><input name="filter[terms][<?php echo $i ?>][val]" value="<?php echo isset($_REQUEST['filter']['terms'][$i]['val'])?$_REQUEST['filter']['terms'][$i]['val']:'' ?>"/></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<td><?php if ( count($_REQUEST['filter']['terms']) > 2 ) { echo buildSelect( "filter[terms][$i][cbr]", $cbracketTypes ); } else { ?> <?php } ?></td>
|
<td><?php if ( count($_REQUEST['filter']['terms']) > 2 ) { echo buildSelect( "filter[terms][$i][cbr]", $cbracketTypes ); } else { ?> <?php } ?></td>
|
||||||
<td><input type="button" onclick="addTerm( this, <?php echo $i+1 ?> )" value="+"/><?php if ( $_REQUEST['filter']['terms'] > 1 ) { ?><input type="button" onclick="delTerm( this, <?php echo $i ?> )" value="-"/><?php } ?></td>
|
<td><input type="button" onclick="addTerm( this, <?php echo $i+1 ?> )" value="+"/><?php if ( $_REQUEST['filter']['terms'] > 1 ) { ?><input type="button" onclick="delTerm( this, <?php echo $i ?> )" value="-"/><?php } ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
} # end foreach filter
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -346,9 +327,9 @@ if ( ZM_OPT_MESSAGE )
|
||||||
<input type="button" name="executeButton" id="executeButton" value="<?php echo translate('Execute') ?>" onclick="executeFilter( this );"/>
|
<input type="button" name="executeButton" id="executeButton" value="<?php echo translate('Execute') ?>" onclick="executeFilter( this );"/>
|
||||||
<?php if ( canEdit( 'Events' ) ) { ?>
|
<?php if ( canEdit( 'Events' ) ) { ?>
|
||||||
<input type="button" value="<?php echo translate('Save') ?>" onclick="saveFilter( this );"/>
|
<input type="button" value="<?php echo translate('Save') ?>" onclick="saveFilter( this );"/>
|
||||||
<?php } ?>
|
<?php if ( isset($dbFilter) && $dbFilter['Name'] ) { ?>
|
||||||
<?php if ( canEdit( 'Events' ) && isset($dbFilter) && $dbFilter['Name'] ) { ?>
|
|
||||||
<input type="button" value="<?php echo translate('Delete') ?>" onclick="deleteFilter( this, '<?php echo $dbFilter['Name'] ?>' );"/>
|
<input type="button" value="<?php echo translate('Delete') ?>" onclick="deleteFilter( this, '<?php echo $dbFilter['Name'] ?>' );"/>
|
||||||
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<input type="button" value="<?php echo translate('Reset') ?>" onclick="submitToFilter( this, 1 );"/>
|
<input type="button" value="<?php echo translate('Reset') ?>" onclick="submitToFilter( this, 1 );"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,13 +7,13 @@ function updateButtons( element ) {
|
||||||
var canExecute = false;
|
var canExecute = false;
|
||||||
if ( form.elements['AutoArchive'].checked )
|
if ( form.elements['AutoArchive'].checked )
|
||||||
canExecute = true;
|
canExecute = true;
|
||||||
else if ( typeof ZM_OPT_FFMPEG !== "undefined" && form.elements['AutoVideo'].checked )
|
else if ( form.elements['AutoVideo'] && form.elements['AutoVideo'].checked )
|
||||||
canExecute = true;
|
canExecute = true;
|
||||||
else if ( typeof ZM_OPT_UPLOAD !== "undefined" && form.elements['AutoUpload'].checked )
|
else if ( form.elements['AutoUpload'] && form.elements['AutoUpload'].checked )
|
||||||
canExecute = true;
|
canExecute = true;
|
||||||
else if ( typeof ZM_OPT_EMAIL !== "undefined" && form.elements['AutoEmail'].checked )
|
else if ( form.elements['AutoEmail'] && form.elements['AutoEmail'].checked )
|
||||||
canExecute = true;
|
canExecute = true;
|
||||||
else if ( typeof ZM_OPT_MESSAGE !== "undefined" && form.elements['AutoMessage'].checked )
|
else if ( form.elements['AutoMessage'] && form.elements['AutoMessage'].checked )
|
||||||
canExecute = true;
|
canExecute = true;
|
||||||
else if ( form.elements['AutoExecute'].checked && form.elements['AutoExecuteCmd'].value != '' )
|
else if ( form.elements['AutoExecute'].checked && form.elements['AutoExecuteCmd'].value != '' )
|
||||||
canExecute = true;
|
canExecute = true;
|
||||||
|
|
Loading…
Reference in New Issue