diff --git a/db/zm_update-1.27.0.sql b/db/zm_update-1.27.0.sql index b5cc865b5..d70aff0c7 100644 --- a/db/zm_update-1.27.0.sql +++ b/db/zm_update-1.27.0.sql @@ -13,11 +13,39 @@ ALTER TABLE Monitors modify column Type enum('Local','Remote','File','Ffmpeg','L -- -- Add required fields for cURL authenication -- -ALTER TABLE `Monitors` ADD `User` VARCHAR(32) NOT NULL AFTER `SubPath`; -ALTER TABLE `Monitors` ADD `Pass` VARCHAR(32) NOT NULL AFTER `User`; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'User' + ) > 0, +"SELECT 'Column User exists in Monitors'", +"ALTER TABLE `Monitors` ADD `User` VARCHAR(32) NOT NULL AFTER `SubPath`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Pass' + ) > 0, +"SELECT 'Column Pass exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Pass` VARCHAR(32) NOT NULL AFTER `User`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; -- -- Add default zone preset -- + INSERT INTO ZonePresets VALUES (NULL,'Default','Active','Percent','Blobs',25,NULL,3,75,3,3,3,75,2,NULL,1,NULL,0); + diff --git a/web/skins/classic/includes/timeline_functions.php b/web/skins/classic/includes/timeline_functions.php index c74ea0ecb..cf92f8689 100644 --- a/web/skins/classic/includes/timeline_functions.php +++ b/web/skins/classic/includes/timeline_functions.php @@ -232,7 +232,7 @@ function parseFilterToTree( $filter ) $value = "'$value'"; break; case 'DateTime': - $value = strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) ); + $value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'"; break; case 'Date': $value = "to_days( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )"; diff --git a/web/skins/flat/includes/timeline_functions.php b/web/skins/flat/includes/timeline_functions.php index c74ea0ecb..cf92f8689 100644 --- a/web/skins/flat/includes/timeline_functions.php +++ b/web/skins/flat/includes/timeline_functions.php @@ -232,7 +232,7 @@ function parseFilterToTree( $filter ) $value = "'$value'"; break; case 'DateTime': - $value = strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) ); + $value = "'".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."'"; break; case 'Date': $value = "to_days( '".strftime( STRF_FMT_DATETIME_DB, strtotime( $value ) )."' )";