From 643438e3f25ac10fda7a3526ea512a6410d616cd Mon Sep 17 00:00:00 2001 From: Kristof Robot Date: Mon, 15 Dec 2014 08:12:36 +0100 Subject: [PATCH 1/6] zmfilter: Send message for events that are still ongoing --- scripts/zmfilter.pl.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) mode change 100644 => 100755 scripts/zmfilter.pl.in diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in old mode 100644 new mode 100755 index 1e9f1bbce..1d55e0d40 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -275,7 +275,7 @@ sub getFilters { Debug( "Found filter '$db_filter->{Name}'\n" ); my $filter_expr = jsonDecode( $db_filter->{Query} ); - my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime)"; + my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId"; $db_filter->{Sql} = ''; if ( @{$filter_expr->{terms}} ) @@ -414,7 +414,17 @@ sub getFilters } if ( $db_filter->{Sql} ) { - $sql .= " and ( ".$db_filter->{Sql}." )"; + if ( $db_filter->{AutoMessage} ) + { + # Include all events, including events that are still ongoing + # and have no EndTime yet + $sql .= " and ( ".$db_filter->{Sql}." )"; + } + else + { + # Only include closed events (events with valid EndTime) + $sql .= " where not isnull(E.EndTime) and ( ".$db_filter->{Sql}." )"; + } } my @auto_terms; if ( $db_filter->{AutoArchive} ) From 50e678477946b438c28689d8a8578f526adf63f3 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 17 Dec 2014 16:45:41 -0500 Subject: [PATCH 2/6] this adds two config options to System tab to set the default skin and css --- .../ZoneMinder/lib/ZoneMinder/ConfigData.pm.in | 16 ++++++++++++++++ web/index.php | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in index 54bd14e26..15c9e287f 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in @@ -92,6 +92,22 @@ our %types = our @options = ( + { + name => "ZM_SKIN_DEFAULT", + default => "classic", + description => "Default skin used by web interface", + help => "ZoneMinder allows the use of many different web interfaces. This option allows you to set the default skin used by the website. Users can change their skin later, this merely sets the default.", + type => $types{string}, + category => "system", + }, + { + name => "ZM_CSS_DEFAULT", + default => "classic", + description => "Default set of css files used by web interface", + help => "ZoneMinder allows the use of many different web interfaces, and some skins allow the use of different set of CSS files to control the appearance. This option allows you to set the default set of css files used by the website. Users can change their css later, this merely sets the default.", + type => $types{string}, + category => "system", + }, { name => "ZM_LANG_DEFAULT", default => "en_gb", diff --git a/web/index.php b/web/index.php index 8f79ce6c0..e4c00e2c7 100644 --- a/web/index.php +++ b/web/index.php @@ -60,6 +60,8 @@ if ( isset($_GET['skin']) ) $skin = $_GET['skin']; elseif ( isset($_COOKIE['zmSkin']) ) $skin = $_COOKIE['zmSkin']; +elseif ( ZM_SKIN_DEFAULT ) + $skin = ZM_SKIN_DEFAULT; else $skin = "classic"; @@ -67,6 +69,8 @@ if ( isset($_GET['css']) ) $css = $_GET['css']; elseif ( isset($_COOKIE['zmCSS']) ) $css = $_COOKIE['zmCSS']; +elseif (ZM_CSS_DEFAULT) + $css = ZM_CSS_DEFAULT; else $css = "classic"; From 60b69a4174b5cf62c4a5528b4f28b3d50490f52e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 17 Dec 2014 18:06:14 -0500 Subject: [PATCH 3/6] this add some quoting, it's something debian and ubuntu packaging does, but it's pretty clear that it is good in a more general sense. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 545106a7d..103b81833 100644 --- a/configure.ac +++ b/configure.ac @@ -443,10 +443,10 @@ if test "$prefix" != "NONE"; then PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"` PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"` EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path" - PERL_MM_PARMS="PREFIX=$prefix" + PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\"" else EXTRA_PERL_LIB="# Include from system perl paths only" - PERL_MM_PARMS= + PERL_MM_PARMS="\"INSTALLDIRS=vendor\"" fi AC_SUBST(PERL_MM_PARMS) AC_SUBST(EXTRA_PERL_LIB) From 478c9bc630630fa7e5acf1e185cfc4002283f3bb Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 18 Dec 2014 09:34:14 -0500 Subject: [PATCH 4/6] add custom lines for loading the available skins and css options --- web/skins/classic/views/options.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index a2182f7c0..6b014f58c 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -81,6 +81,7 @@ foreach ( $tabs as $name=>$value )
window.opener.location.reload();window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\""; @@ -110,8 +112,7 @@ if($tab == 'skins') { '.$dir.''; } ?> @@ -208,12 +208,12 @@ elseif ( $tab == "users" )
From 05206279df2fd022cc1b0b3106d2c9bf05228126 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 18 Dec 2014 09:44:04 -0500 Subject: [PATCH 5/6] add missing commas --- web/skins/classic/views/options.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index 6b014f58c..9f8ef86e9 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -81,7 +81,7 @@ foreach ( $tabs as $name=>$value )