diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in
index 41c8b0e75..d704e169b 100644
--- a/scripts/zmaudit.pl.in
+++ b/scripts/zmaudit.pl.in
@@ -488,21 +488,21 @@ MAIN: while( $loop ) {
my $monitor_links;
foreach my $link ( glob('*') ) {
- next if ( !-l $link );
- next if ( -e $link );
+ next if !-l $link;
+ next if -e $link;
- aud_print( "Filesystem monitor link '$link' does not point to valid monitor directory" );
+ aud_print("Filesystem monitor link '$link' does not point to valid monitor directory");
if ( confirm() ) {
( $link ) = ( $link =~ /^(.*)$/ ); # De-taint
my $command = qq`rm "$link"`;
- executeShellCommand( $command );
+ executeShellCommand($command);
$cleaned = 1;
}
- }
+ } # end foreach monitor link
} # end foreach Storage Area
if ( $cleaned ) {
- Debug("Events were deleted, starting again.");
+ Debug('Events were deleted, starting again.');
redo MAIN;
}
@@ -559,8 +559,8 @@ EVENT: while ( my ( $db_event, $age ) = each( %$db_events ) ) {
Warning("Event $$Event{Id} is Archived. Taking no further action on it.");
next;
}
- if ( ! $Event->StartTime() ) {
- Info("Event $$Event{Id} has no start time.");
+ if ( !$Event->StartTime() ) {
+ aud_print("Event $$Event{Id} has no start time.");
if ( confirm() ) {
$Event->delete();
$cleaned = 1;
@@ -569,7 +569,7 @@ EVENT: while ( my ( $db_event, $age ) = each( %$db_events ) ) {
}
if ( ! $Event->EndTime() ) {
if ( $age > $Config{ZM_AUDIT_MIN_AGE} ) {
- Info("Event $$Event{Id} has no end time and is $age seconds old. deleting it.");
+ aud_print("Event $$Event{Id} has no end time and is $age seconds old. Deleting it.");
if ( confirm() ) {
$Event->delete();
$cleaned = 1;
@@ -578,7 +578,7 @@ EVENT: while ( my ( $db_event, $age ) = each( %$db_events ) ) {
}
}
if ( $Event->check_for_in_filesystem() ) {
- Debug("Database event $$Event{Id} apparently exists at " . $Event->Path() );
+ Debug("Database event $$Event{Id} apparently exists at " . $Event->Path());
} else {
if ( $age > $Config{ZM_AUDIT_MIN_AGE} ) {
aud_print("Database event '$db_monitor/$db_event' does not exist at " . $Event->Path().' in filesystem, deleting');
@@ -587,14 +587,14 @@ EVENT: while ( my ( $db_event, $age ) = each( %$db_events ) ) {
$cleaned = 1;
}
} else {
- aud_print( "Database event '".$Event->Path()." monitor:$db_monitor event:$db_event' does not exist in filesystem but too young to delete age: $age > MIN $Config{ZM_AUDIT_MIN_AGE}.\n" );
+ aud_print("Database event '".$Event->Path()." monitor:$db_monitor event:$db_event' does not exist in filesystem but too young to delete age: $age > MIN $Config{ZM_AUDIT_MIN_AGE}.");
}
} # end if exists in filesystem
} else {
Debug("Found fs event for id $db_event, $age seconds old at " . $$fs_events{$db_event}->Path());
my $Event = ZoneMinder::Event->find_one( Id=>$db_event );
if ( $Event and ! $Event->check_for_in_filesystem() ) {
- Warning("Not found at " . $Event->Path() . ' was found at ' . $$fs_events{$db_event}->Path() );
+ Warning('Not found at ' . $Event->Path() . ' was found at ' . $$fs_events{$db_event}->Path());
Warning($Event->to_string());
Warning($$fs_events{$db_event}->to_string());
$$Event{Scheme} = '' if ! defined $$Event{Scheme};
@@ -622,7 +622,7 @@ EVENT: while ( my ( $db_event, $age ) = each( %$db_events ) ) {
} # foreach db_event
} # end foreach db_monitor
if ( $cleaned ) {
- Debug("Have done some cleaning, restarting.");
+ Debug('Have done some cleaning, restarting.');
redo MAIN;
}
@@ -904,25 +904,25 @@ FROM Frames WHERE EventId=?';
Monitors.MonthEvents = E.MonthEvents,
Monitors.MonthEventDiskSpace = E.MonthEventDiskSpace
`;
- my $eventcounts_hour_sth = $dbh->prepare_cached( $eventcounts_hour_sql );
- my $eventcounts_day_sth = $dbh->prepare_cached( $eventcounts_day_sql );
- my $eventcounts_week_sth = $dbh->prepare_cached( $eventcounts_week_sql );
- my $eventcounts_month_sth = $dbh->prepare_cached( $eventcounts_month_sql );
- $eventcounts_hour_sth->execute( ) or Error( "Can't execute: ".$eventcounts_sth->errstr() );
- $eventcounts_day_sth->execute( ) or Error( "Can't execute: ".$eventcounts_sth->errstr() );
- $eventcounts_week_sth->execute( ) or Error( "Can't execute: ".$eventcounts_sth->errstr() );
- $eventcounts_month_sth->execute( ) or Error( "Can't execute: ".$eventcounts_sth->errstr() );
- sleep( $Config{ZM_AUDIT_CHECK_INTERVAL} ) if $continuous;
+ my $eventcounts_hour_sth = $dbh->prepare_cached($eventcounts_hour_sql);
+ my $eventcounts_day_sth = $dbh->prepare_cached($eventcounts_day_sql);
+ my $eventcounts_week_sth = $dbh->prepare_cached($eventcounts_week_sql);
+ my $eventcounts_month_sth = $dbh->prepare_cached($eventcounts_month_sql);
+ $eventcounts_hour_sth->execute() or Error("Can't execute: ".$eventcounts_sth->errstr());
+ $eventcounts_day_sth->execute() or Error("Can't execute: ".$eventcounts_sth->errstr());
+ $eventcounts_week_sth->execute() or Error("Can't execute: ".$eventcounts_sth->errstr());
+ $eventcounts_month_sth->execute() or Error("Can't execute: ".$eventcounts_sth->errstr());
+ sleep($Config{ZM_AUDIT_CHECK_INTERVAL}) if $continuous;
};
Term();
sub aud_print {
my $string = shift;
- if ( ! $continuous ) {
- print( $string );
+ if ( !$continuous ) {
+ print($string);
} else {
- Info( $string );
+ Info($string);
}
}
@@ -932,13 +932,13 @@ sub confirm {
my $yesno = 0;
if ( $report ) {
- print( "\n" );
+ print("\n");
} elsif ( $interactive ) {
- print( ", $prompt Y/n/q: " );
+ print(", $prompt Y/n/q: ");
my $char = <>;
- chomp( $char );
+ chomp($char);
if ( $char eq 'q' ) {
- exit( 0 );
+ exit(0);
}
if ( !$char ) {
$char = 'y';
@@ -946,13 +946,13 @@ sub confirm {
$yesno = ( $char =~ /[yY]/ );
} else {
if ( !$continuous ) {
- print( ", $action\n" );
+ print(", $action\n");
} else {
- Info( $action );
+ Info($action);
}
$yesno = 1;
}
- return( $yesno );
+ return $yesno;
}
sub deleteSwapImage {
diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp
index 07545eee7..d587eebc5 100644
--- a/src/zm_monitor.cpp
+++ b/src/zm_monitor.cpp
@@ -1729,6 +1729,11 @@ bool Monitor::Analyse() {
);
closeEvent();
event = new Event(this, *timestamp, cause, noteSetMap);
+ shared_data->last_event = event->Id();
+ //set up video store data
+ snprintf(video_store_data->event_file, sizeof(video_store_data->event_file), "%s", event->getEventFile());
+ video_store_data->recording = event->StartTime();
+
}
} // end if event
diff --git a/web/includes/Storage.php b/web/includes/Storage.php
index 67264f298..b3caa3ffa 100644
--- a/web/includes/Storage.php
+++ b/web/includes/Storage.php
@@ -44,7 +44,7 @@ class Storage {
}
public function Path() {
- if ( isset( $this->{'Path'} ) and ( $this->{'Path'} != '' ) ) {
+ if ( isset($this->{'Path'}) and ( $this->{'Path'} != '' ) ) {
return $this->{'Path'};
} else if ( ! isset($this->{'Id'}) ) {
$path = ZM_DIR_EVENTS;
@@ -58,7 +58,7 @@ class Storage {
return $this->{'Name'};
}
public function Name() {
- if ( isset( $this->{'Name'} ) and ( $this->{'Name'} != '' ) ) {
+ if ( isset($this->{'Name'}) and ( $this->{'Name'} != '' ) ) {
return $this->{'Name'};
} else if ( ! isset($this->{'Id'}) ) {
return 'Default';
@@ -73,7 +73,7 @@ class Storage {
if ( array_key_exists($fn, $this) )
return $this->{$fn};
- if ( array_key_exists( $fn, $this->defaults ) )
+ if ( array_key_exists($fn, $this->defaults) )
return $this->defaults{$fn};
$backTrace = debug_backtrace();
@@ -96,7 +96,7 @@ class Storage {
$results = Storage::find($parameters, $options);
if ( count($results) > 1 ) {
- Error("Storage Returned more than 1");
+ Error('Storage Returned more than 1');
return $results[0];
} else if ( count($results) ) {
return $results[0];
@@ -116,7 +116,7 @@ class Storage {
$fields[] = $field.' IS NULL';
} else if ( is_array($value) ) {
$func = function(){return '?';};
- $fields[] = $field.' IN ('.implode(',', array_map($func, $value)). ')';
+ $fields[] = $field.' IN ('.implode(',', array_map($func, $value)).')';
$values += $value;
} else {
@@ -165,11 +165,11 @@ class Storage {
$total = $this->disk_total_space();
if ( ! $total ) {
- Error('disk_total_space returned false for ' . $path );
+ Error('disk_total_space returned false for ' . $path);
return 0;
}
$used = $this->disk_used_space();
- $usage = round( ($used / $total) * 100);
+ $usage = round(($used / $total) * 100);
//Logger::Debug("Used $usage = round( ( $used / $total ) * 100 )");
return $usage;
}
@@ -208,7 +208,7 @@ class Storage {
public function event_disk_space() {
# This isn't a function like this in php, so we have to add up the space used in each event.
if ( (! array_key_exists('DiskSpace', $this)) or (!$this->{'DiskSpace'}) ) {
- $used = dbFetchOne('SELECT SUM(DiskSpace) AS DiskSpace FROM Events WHERE StorageId=? AND DiskSpace IS NOT NULL', 'DiskSpace', array($this->Id()) );
+ $used = dbFetchOne('SELECT SUM(DiskSpace) AS DiskSpace FROM Events WHERE StorageId=? AND DiskSpace IS NOT NULL', 'DiskSpace', array($this->Id()));
foreach ( Event::find(array('StorageId'=>$this->Id(), 'DiskSpace'=>null)) as $Event ) {
$Event->Storage($this); // Prevent further db hit
@@ -221,7 +221,7 @@ class Storage {
public function Server() {
if ( ! array_key_exists('Server',$this) ) {
- $this->{'Server'}= new Server( $this->{'ServerId'} );
+ $this->{'Server'}= new Server($this->{'ServerId'});
}
return $this->{'Server'};
}
@@ -239,5 +239,5 @@ class Storage {
}
return json_encode($json);
}
-}
+} // end class Storage
?>
diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php
index 389d49fe3..06948eafb 100644
--- a/web/skins/classic/views/options.php
+++ b/web/skins/classic/views/options.php
@@ -353,18 +353,18 @@ foreach ( array_map('basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDI
checked="checked"/>
3 ) {
+ $options = explode('|', $value['Hint']);
+ if ( count($options) > 3 ) {
?>