Merge branch 'master' of github.com:zoneminder/ZoneMinder
This commit is contained in:
commit
034985128a
|
@ -889,7 +889,7 @@ FROM `Frames` WHERE `EventId`=?';
|
|||
|
||||
my $eventcounts_sql = '
|
||||
UPDATE `Monitors` SET
|
||||
`TotalEvents`=(SELECT COUNT(`Id`) FROM `Events` WHERE `MonitorId`=`Monitors.Id`),
|
||||
`TotalEvents`=(SELECT COUNT(`Id`) FROM `Events` WHERE `MonitorId`=`Monitors`.`Id`),
|
||||
`TotalEventDiskSpace`=(SELECT SUM(`DiskSpace`) FROM `Events` WHERE `MonitorId`=`Monitors`.`Id` AND `DiskSpace` IS NOT NULL),
|
||||
`ArchivedEvents`=(SELECT COUNT(`Id`) FROM `Events` WHERE `MonitorId`=`Monitors`.`Id` AND `Archived`=1),
|
||||
`ArchivedEventDiskSpace`=(SELECT SUM(`DiskSpace`) FROM `Events` WHERE `MonitorId`=`Monitors`.`Id` AND `Archived`=1 AND `DiskSpace` IS NOT NULL)
|
||||
|
|
|
@ -83,6 +83,9 @@ if ( $action == 'monitor' ) {
|
|||
dbQuery('UPDATE Monitors SET '.implode(', ', $changes).' WHERE Id=?', array($mid));
|
||||
// Groups will be added below
|
||||
if ( isset($changes['Name']) or isset($changes['StorageId']) ) {
|
||||
// creating symlinks when symlink already exists reports errors, but is perfectly ok
|
||||
error_reporting(0);
|
||||
|
||||
$OldStorage = new ZM\Storage($monitor['StorageId']);
|
||||
$saferOldName = basename($monitor['Name']);
|
||||
if ( file_exists($OldStorage->Path().'/'.$saferOldName) )
|
||||
|
@ -95,8 +98,11 @@ if ( $action == 'monitor' ) {
|
|||
}
|
||||
}
|
||||
$saferNewName = basename($_REQUEST['newMonitor']['Name']);
|
||||
if ( !symlink($NewStorage->Path().'/'.$mid, $NewStorage->Path().'/'.$saferNewName) ) {
|
||||
ZM\Warning('Unable to symlink ' . $NewStorage->Path().'/'.$mid . ' to ' . $NewStorage->Path().'/'.$saferNewName);
|
||||
$link_path = $NewStorage->Path().'/'.$saferNewName;
|
||||
if ( !symlink($NewStorage->Path().'/'.$mid, $link_path) ) {
|
||||
if ( ! ( file_exists($link_path) and is_link($link_path) ) ) {
|
||||
ZM\Warning('Unable to symlink ' . $NewStorage->Path().'/'.$mid . ' to ' . $NewStorage->Path().'/'.$saferNewName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( isset($changes['Width']) || isset($changes['Height']) ) {
|
||||
|
|
|
@ -28,9 +28,9 @@ require_once('includes/Event.php');
|
|||
$countSql = 'SELECT count(E.Id) AS EventCount FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId) WHERE';
|
||||
$eventsSql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultScale FROM Monitors AS M INNER JOIN Events AS E on (M.Id = E.MonitorId) WHERE';
|
||||
if ( $user['MonitorIds'] ) {
|
||||
$user_monitor_ids = ' M.Id in ('.$user['MonitorIds'].')';
|
||||
$countSql .= $user_monitor_ids;
|
||||
$eventsSql .= $user_monitor_ids;
|
||||
$user_monitor_ids = ' M.Id in ('.$user['MonitorIds'].')';
|
||||
$countSql .= $user_monitor_ids;
|
||||
$eventsSql .= $user_monitor_ids;
|
||||
} else {
|
||||
$countSql .= ' 1';
|
||||
$eventsSql .= ' 1';
|
||||
|
@ -194,22 +194,21 @@ while ( $event_row = dbFetchNext($results) ) {
|
|||
<td class="colName"><a href="?view=event&eid=<?php echo $event->Id().$filterQuery.$sortQuery.'&page=1">'.validHtmlStr($event->Name()).($event->Archived()?'*':'') ?></a></td>
|
||||
<td class="colMonitorName"><?php echo makePopupLink( '?view=monitor&mid='.$event->MonitorId(), 'zmMonitor'.$event->Monitorid(), 'monitor', $event->MonitorName(), canEdit( 'Monitors' ) ) ?></td>
|
||||
<td class="colCause"><?php echo makePopupLink( '?view=eventdetail&eid='.$event->Id(), 'zmEventDetail', 'eventdetail', validHtmlStr($event->Cause()), canEdit( 'Events' ), 'title="'.htmlspecialchars($event->Notes()).'"' ) ?>
|
||||
<?php
|
||||
# display notes as small text
|
||||
if ($event->Notes()) {
|
||||
# if notes include detection objects, then link it to objdetect.jpg
|
||||
if (strpos($event->Notes(),"detected:")!== false){
|
||||
# make a link
|
||||
echo makePopupLink( '?view=image&eid='.$event->Id().'&fid=objdetect', 'zmImage',
|
||||
array('image', reScale($event->Width(), $scale), reScale($event->Height(), $scale)),
|
||||
"<div class=\"small text-nowrap text-muted\"><u>".$event->Notes()."</u></div>");
|
||||
}
|
||||
elseif ($event->Notes() != 'Forced Web: ') {
|
||||
echo "<br/><div class=\"small text-nowrap text-muted\">".$event->Notes()."</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
# display notes as small text
|
||||
if ($event->Notes()) {
|
||||
# if notes include detection objects, then link it to objdetect.jpg
|
||||
if (strpos($event->Notes(),'detected:')!== false){
|
||||
# make a link
|
||||
echo makePopupLink( '?view=image&eid='.$event->Id().'&fid=objdetect', 'zmImage',
|
||||
array('image', reScale($event->Width(), $scale), reScale($event->Height(), $scale)),
|
||||
"<div class=\"small text-nowrap text-muted\"><u>".$event->Notes()."</u></div>");
|
||||
}
|
||||
elseif ($event->Notes() != 'Forced Web: ') {
|
||||
echo "<br/><div class=\"small text-nowrap text-muted\">".$event->Notes()."</div>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="colTime"><?php echo strftime(STRF_FMT_DATETIME_SHORTER, strtotime($event->StartTime())) .
|
||||
( $event->EndTime() ? ' until ' . strftime(STRF_FMT_DATETIME_SHORTER, strtotime($event->EndTime()) ) : '' ) ?>
|
||||
|
|
Loading…
Reference in New Issue