Initial pass at sequential events.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1107 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
e3a3199031
commit
f64581709a
|
@ -507,10 +507,10 @@ function parseSort()
|
|||
case 'Name' :
|
||||
$sort_column = "E.Name";
|
||||
break;
|
||||
case 'StartTime' :
|
||||
case 'DateTime' :
|
||||
$sort_column = "E.StartTime";
|
||||
break;
|
||||
case 'Secs' :
|
||||
case 'Length' :
|
||||
$sort_column = "E.Length";
|
||||
break;
|
||||
case 'Frames' :
|
||||
|
@ -595,6 +595,8 @@ function parseFilter()
|
|||
case 'Weekday':
|
||||
$filter_sql .= "weekday( E.StartTime )";
|
||||
break;
|
||||
case 'Id':
|
||||
case 'Name':
|
||||
case 'MonitorId':
|
||||
case 'Length':
|
||||
case 'Frames':
|
||||
|
|
|
@ -49,7 +49,7 @@ $event = mysql_fetch_assoc( $result );
|
|||
parseSort();
|
||||
parseFilter();
|
||||
|
||||
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'<=':'>=')." '".$event[$sort_field]."'$filter_sql$mid_sql order by $sort_column ".($sort_order=='asc'?'desc':'asc');
|
||||
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'<=':'>=')." '".$event[preg_replace( '/^.*\./', '', $sort_column )]."'$filter_sql$mid_sql order by $sort_column ".($sort_order=='asc'?'desc':'asc');
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
|
@ -62,7 +62,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
}
|
||||
}
|
||||
|
||||
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'>=':'<=')." '".$event[$sort_field]."'$filter_sql$mid_sql order by $sort_column $sort_order";
|
||||
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sort_column ".($sort_order=='asc'?'>=':'<=')." '".$event[preg_replace( '/^.*\./', '', $sort_column )]."'$filter_sql$mid_sql order by $sort_column $sort_order";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
|
@ -120,6 +120,19 @@ function newWindow(Url,Name,Width,Height)
|
|||
{
|
||||
var Name = window.open(Url,Name,"resizable,width="+Width+",height="+Height);
|
||||
}
|
||||
<?php
|
||||
if ( $play && $next_event )
|
||||
{
|
||||
$sql = "select max(Delta)-min(Delta) as Duration from Frames where EventId = '$eid'";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$frame_data = mysql_fetch_assoc( $result );
|
||||
?>
|
||||
var timeout_id = window.setTimeout( "window.location.replace( '<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $next_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>&play=1' );", <?= (((($frame_data[Duration]*1000)+1000)*($rate))/RATE_SCALE) ?> );
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
</head>
|
||||
<body scroll="auto">
|
||||
|
@ -432,10 +445,11 @@ else
|
|||
?>
|
||||
<tr>
|
||||
<td colspan="6"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
|
||||
<td width="25%" align="center" class="text"><?php if ( $prev_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $prev_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangPrev ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="25%" align="center" class="text"><?php if ( canEdit( 'Events' ) && $prev_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $prev_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&action=delete&mark_eid=<?= $eid ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangDeleteAndPrev ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="25%" align="center" class="text"><?php if ( canEdit( 'Events' ) && $next_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $next_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&action=delete&mark_eid=<?= $eid ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangDeleteAndNext ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="25%" align="center" class="text"><?php if ( $next_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $next_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangNext ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="20%" align="center" class="text"><?php if ( $prev_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $prev_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangPrev ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="20%" align="center" class="text"><?php if ( canEdit( 'Events' ) && $prev_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $prev_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&action=delete&mark_eid=<?= $eid ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangDeleteAndPrev ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="20%" align="center" class="text"><?php if ( $frame_data ) { ?><a href="javascript: window.clearTimeout( timeout_id );"><?= $zmSlangStop ?></a><?php } elseif ( $next_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $eid ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>&play=1"><?= $zmSlangPlayAll ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="20%" align="center" class="text"><?php if ( canEdit( 'Events' ) && $next_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $next_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&action=delete&mark_eid=<?= $eid ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangDeleteAndNext ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="20%" align="center" class="text"><?php if ( $next_event ) { ?><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&mode=<?= $mode ?>&eid=<?= $next_event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&limit=<?= $limit ?>&page=<?= $page ?>&rate=<?= $rate ?>&scale=<?= $scale ?>"><?= $zmSlangNext ?></a><?php } else { ?> <?php } ?></td>
|
||||
</tr></table></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -90,37 +90,6 @@ function closeWindow()
|
|||
var filterWindow = window.open( "<?= $PHP_SELF ?>?view=none", 'zmFilter', 'width=1,height=1' );
|
||||
filterWindow.close();
|
||||
}
|
||||
function checkAll(form,name)
|
||||
{
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
if (form.elements[i].name.indexOf(name) == 0)
|
||||
form.elements[i].checked = 1;
|
||||
form.delete_btn.disabled = false;
|
||||
<?php if ( LEARN_MODE ) { ?>
|
||||
form.learn_btn.disabled = false;
|
||||
form.learn_state.disabled = false;
|
||||
<?php } ?>
|
||||
}
|
||||
function configureButton(form,name)
|
||||
{
|
||||
var checked = false;
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if ( form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
form.delete_btn.disabled = !checked;
|
||||
<?php if ( LEARN_MODE ) { ?>
|
||||
form.learn_btn.disabled = !checked;
|
||||
form.learn_state.disabled = !checked;
|
||||
<?php } ?>
|
||||
}
|
||||
window.focus();
|
||||
<?php
|
||||
if ( isset($filter) )
|
||||
|
@ -144,7 +113,69 @@ else
|
|||
{
|
||||
$n_events = $limit;
|
||||
}
|
||||
if ( !($result = mysql_query( $events_sql )) )
|
||||
die( mysql_error() );
|
||||
$max_width = 0;
|
||||
$max_height = 0;
|
||||
$events = array();
|
||||
while( $event = mysql_fetch_assoc( $result ) )
|
||||
{
|
||||
$events[] = $event;
|
||||
if ( $max_width < $event['Width'] ) $max_width = $event['Width'];
|
||||
if ( $max_height < $event['Height'] ) $max_height = $event['Height'];
|
||||
}
|
||||
?>
|
||||
function checkAll(form,name)
|
||||
{
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
if (form.elements[i].name.indexOf(name) == 0)
|
||||
form.elements[i].checked = 1;
|
||||
form.view_btn.disabled = false;
|
||||
form.delete_btn.disabled = false;
|
||||
<?php if ( LEARN_MODE ) { ?>
|
||||
form.learn_btn.disabled = false;
|
||||
form.learn_state.disabled = false;
|
||||
<?php } ?>
|
||||
}
|
||||
function configureButton(form,name)
|
||||
{
|
||||
var checked = false;
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if ( form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
form.view_btn.disabled = !checked;
|
||||
form.delete_btn.disabled = !checked;
|
||||
<?php if ( LEARN_MODE ) { ?>
|
||||
form.learn_btn.disabled = !checked;
|
||||
form.learn_state.disabled = !checked;
|
||||
<?php } ?>
|
||||
}
|
||||
function viewEvents( form, name )
|
||||
{
|
||||
var events = new Array();
|
||||
for (var i = 0; i < form.elements.length; i++)
|
||||
{
|
||||
if ( form.elements[i].name.indexOf(name) == 0)
|
||||
{
|
||||
if ( form.elements[i].checked )
|
||||
{
|
||||
events[events.length] = form.elements[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( events.length > 0 )
|
||||
{
|
||||
eventWindow( '<?= $PHP_SELF ?>?view=event&eid='+events[0]+'&trms=1&attr1=Id&op1=%3D%5B%5D&val1='+events.join('%2C')+'<?= $sort_query ?>&page=1&play=1', 'zmEvent', <?= $max_width+$jws['event']['w'] ?>, <?= $max_height+$jws['event']['h'] ?> );
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -270,9 +301,7 @@ else
|
|||
<?php
|
||||
flush();
|
||||
$count = 0;
|
||||
if ( !($result = mysql_query( $events_sql )) )
|
||||
die( mysql_error() );
|
||||
while( $event = mysql_fetch_assoc( $result ) )
|
||||
foreach ( $events as $event )
|
||||
{
|
||||
if ( ($count++%ZM_WEB_EVENTS_PER_PAGE) == 0 )
|
||||
{
|
||||
|
@ -335,7 +364,7 @@ else
|
|||
</table></td></tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr><td align="right"><?php if ( LEARN_MODE ) { ?><select name="learn_state" class="form" disabled><option value=""><?= $zmSlangIgnore ?></option><option value="-"><?= $zmSlangExclude ?></option><option value="+"><?= $zmSlangInclude ?></option></select> <input type="button" name="learn_btn" value="<?= $zmSlangSetLearnPrefs ?>" class="form" onClick="document.event_form.action.value = 'learn'; document.event_form.submit();" disabled> <?php } ?><input type="button" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" onClick="document.event_form.action.value = 'delete'; document.event_form.submit();" disabled></td></tr>
|
||||
<tr><td align="right"><?php if ( LEARN_MODE ) { ?><select name="learn_state" class="form" disabled><option value=""><?= $zmSlangIgnore ?></option><option value="-"><?= $zmSlangExclude ?></option><option value="+"><?= $zmSlangInclude ?></option></select> <input type="button" name="learn_btn" value="<?= $zmSlangSetLearnPrefs ?>" class="form" onClick="document.event_form.action.value = 'learn'; document.event_form.submit();" disabled> <?php } ?><input type="button" name="view_btn" value="<?= $zmSlangView ?>" class="form" onClick="viewEvents( document.event_form, 'mark_eids' );" disabled> <input type="button" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" onClick="document.event_form.action.value = 'delete'; document.event_form.submit();" disabled></td></tr>
|
||||
</table></center>
|
||||
</form>
|
||||
</body>
|
||||
|
|
|
@ -63,6 +63,8 @@ for ( $i = 1; $i <= ceil(($trms-1)/2); $i++ )
|
|||
$attr_types = array(
|
||||
'MonitorId' => $zmSlangAttrMonitorId,
|
||||
'MonitorName' => $zmSlangAttrMonitorName,
|
||||
'Id' => $zmSlangAttrId,
|
||||
'Name' => $zmSlangAttrName,
|
||||
'DateTime' => $zmSlangAttrDateTime,
|
||||
'Date' => $zmSlangAttrDate,
|
||||
'Time' => $zmSlangAttrTime,
|
||||
|
|
|
@ -161,6 +161,7 @@ $zmSlangEtc = 'etc';
|
|||
$zmSlangEvent = 'Event';
|
||||
$zmSlangEventFilter = 'Event Filter';
|
||||
$zmSlangEventId = 'Event Id';
|
||||
$zmSlangEventName = 'Event Name';
|
||||
$zmSlangEvents = 'Events';
|
||||
$zmSlangExclude = 'Exclude';
|
||||
$zmSlangFeed = 'Feed';
|
||||
|
@ -263,6 +264,7 @@ $zmSlangParameter = 'Parameter';
|
|||
$zmSlangPassword = 'Password';
|
||||
$zmSlangPasswordsDifferent = 'The new and confirm passwords are different';
|
||||
$zmSlangPaths = 'Paths';
|
||||
$zmSlangPlayAll = 'Play All';
|
||||
$zmSlangPhoneBW = 'Phone B/W';
|
||||
$zmSlangPixels = 'pixels';
|
||||
$zmSlangPleaseWait = 'Please Wait';
|
||||
|
|
Loading…
Reference in New Issue