diff --git a/db/zm_update-1.35.4.sql b/db/zm_update-1.35.4.sql index d3ef8c7b9..44d195224 100644 --- a/db/zm_update-1.35.4.sql +++ b/db/zm_update-1.35.4.sql @@ -1,55 +1,60 @@ -- --- This updates a 1.28.0 database to 1.28.99.0 +-- This update adds ONVIF features -- - --- --- Add Config* fields; used for specifying ONVIF/PSIA options --- SET @s = (SELECT IF( (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'Monitors' AND table_schema = DATABASE() - AND column_name = 'ConfigType' + AND column_name = 'ONVIF_URL' ) > 0, -"SELECT 'Column ConfigType already exists in Monitors'", -"ALTER TABLE `Monitors` ADD COLUMN `ConfigType` ENUM('None','ONVIF','PSIA') NOT NULL DEFAULT 'None' AFTER `Triggers`" +"SELECT 'Column ONVIF_URL already exists in Monitors'", +"ALTER TABLE `Monitors` ADD COLUMN `ONVIF_URL` VARCHAR(255) NOT NULL DEFAULT '' AFTER `Triggers`" )); PREPARE stmt FROM @s; EXECUTE stmt; --- --- Add Config* fields; used for specifying ONVIF/PSIA options --- SET @s = (SELECT IF( (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'Monitors' AND table_schema = DATABASE() - AND column_name = 'ConfigURL' + AND column_name = 'ONVIF_Username' ) > 0, -"SELECT 'Column ConfigURL already exists in Monitors'", -"ALTER TABLE `Monitors` ADD COLUMN `ConfigURL` VARCHAR(255) NOT NULL DEFAULT '' AFTER `ConfigType`" +"SELECT 'Column ONVIF_Username already exists in Monitors'", +"ALTER TABLE `Monitors` ADD COLUMN `ONVIF_Username` VARCHAR(64) NOT NULL DEFAULT '' AFTER `ONVIF_URL`" )); PREPARE stmt FROM @s; EXECUTE stmt; --- --- Add Config* fields; used for specifying ONVIF/PSIA options --- SET @s = (SELECT IF( - (SELECT COUNT(*) - FROM INFORMATION_SCHEMA.COLUMNS - WHERE table_name = 'Monitors' - AND table_schema = DATABASE() - AND column_name = 'ConfigOptions' - ) > 0, -"SELECT 'Column ConfigOptions already exists in Monitors'", -"ALTER TABLE `Monitors` ADD COLUMN `ConfigOptions` VARCHAR(64) NOT NULL DEFAULT '' AFTER `ConfigURL`" + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'ONVIF_Password' + ) > 0, +"SELECT 'Column ONVIF_Password already exists in Monitors'", +"ALTER TABLE `Monitors` ADD COLUMN `ONVIF_Password` VARCHAR(64) NOT NULL DEFAULT '' AFTER `ONVIF_Username`" )); 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 = 'ONVIF_Options' + ) > 0, +"SELECT 'Column ONVIF_Options already exists in Monitors'", +"ALTER TABLE `Monitors` ADD COLUMN `ONVIF_Options` VARCHAR(64) NOT NULL DEFAULT '' AFTER `ONVIF_Password`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 6d7b7db03..be4df7b16 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -495,13 +495,12 @@ if ( ZM_HAS_V4L && ($tab != 'source' || $monitor->Type() != 'Local') ) { - - - - - + + + + Type()!= 'Remote' ) { @@ -759,28 +758,24 @@ switch ( $tab ) { } break; } - case 'config' : + case 'onvif' : { ?> -