From c2ff010d270be2b325a47c7e4af8258a51c4cc04 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 27 Nov 2017 10:04:08 -0800 Subject: [PATCH 1/2] Support NULL in date/time values --- scripts/ZoneMinder/lib/ZoneMinder/Filter.pm | 48 +++++++++++++-------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm index 02209a55c..2048a7ba8 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Filter.pm @@ -225,29 +225,41 @@ sub Sql { ) { $value = "'$temp_value'"; } elsif ( $term->{attr} eq 'DateTime' or $term->{attr} eq 'StartDateTime' or $term->{attr} eq 'EndDateTime' ) { - $value = DateTimeToSQL( $temp_value ); - if ( !$value ) { - Error( "Error parsing date/time '$temp_value', " - ."skipping filter '$self->{Name}'\n" ); - return; + if ( $temp_value == 'NULL' ) { + $value = $temp_value; + } else { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) { + Error( "Error parsing date/time '$temp_value', " + ."skipping filter '$self->{Name}'\n" ); + return; + } + $value = "'$value'"; } - $value = "'$value'"; } elsif ( $term->{attr} eq 'Date' or $term->{attr} eq 'StartDate' or $term->{attr} eq 'EndDate' ) { - $value = DateTimeToSQL( $temp_value ); - if ( !$value ) { - Error( "Error parsing date/time '$temp_value', " - ."skipping filter '$self->{Name}'\n" ); - return; + if ( $temp_value == 'NULL' ) { + $value = $temp_value; + } else { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) { + Error( "Error parsing date/time '$temp_value', " + ."skipping filter '$self->{Name}'\n" ); + return; + } + $value = "to_days( '$value' )"; } - $value = "to_days( '$value' )"; } elsif ( $term->{attr} eq 'Time' or $term->{attr} eq 'StartTime' or $term->{attr} eq 'EndTime' ) { - $value = DateTimeToSQL( $temp_value ); - if ( !$value ) { - Error( "Error parsing date/time '$temp_value', " - ."skipping filter '$self->{Name}'\n" ); - return; + if ( $temp_value == 'NULL' ) { + $value = $temp_value; + } else { + $value = DateTimeToSQL( $temp_value ); + if ( !$value ) { + Error( "Error parsing date/time '$temp_value', " + ."skipping filter '$self->{Name}'\n" ); + return; + } + $value = "extract( hour_second from '$value' )"; } - $value = "extract( hour_second from '$value' )"; } else { $value = $temp_value; } From 00c5590a7157cdb82280731f555bb1deb50ba8ba Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 27 Nov 2017 11:56:48 -0800 Subject: [PATCH 2/2] add Monitor count to servers --- web/skins/classic/views/options.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index 1c1d56cea..6f66ff716 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -206,6 +206,7 @@ foreach( array_map( 'basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDI + @@ -213,11 +214,12 @@ foreach( array_map( 'basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDI - + +