diff --git a/CMakeLists.txt b/CMakeLists.txt index d3e3e28ee..aa5a3219e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # cmake_minimum_required (VERSION 2.6) project (zoneminder) -set(zoneminder_VERSION "1.28.99") +set(zoneminder_VERSION "1.28.100") # make API version a minor of ZM version set(zoneminder_API_VERSION "${zoneminder_VERSION}.1") diff --git a/configure.ac b/configure.ac index 398401f0d..4924c5c9a 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ # For instructions on building with cmake, please see INSTALL # AC_PREREQ(2.59) -AC_INIT(zm,1.28.99,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) +AC_INIT(zm,1.28.100,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(src/zm.h) AC_CONFIG_HEADERS(config.h) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 803045a5b..c52c5741e 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -315,6 +315,7 @@ DROP TABLE IF EXISTS `Monitors`; CREATE TABLE `Monitors` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', + `ServerId` int(10) unsigned, `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL') NOT NULL default 'Local', `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', `Enabled` tinyint(3) unsigned NOT NULL default '1', diff --git a/db/zm_update-1.28.100.sql b/db/zm_update-1.28.100.sql new file mode 100644 index 000000000..1b3d3b745 --- /dev/null +++ b/db/zm_update-1.28.100.sql @@ -0,0 +1,22 @@ +-- +-- This updates a 1.28.99 database to 1.28.100 +-- + +-- +-- Add ServerId column to Monitors +-- + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'ServerId' + ) > 0, +"SELECT 'Column ServerId exists in Monitors'", +"ALTER TABLE Monitors ADD `ServerId` int(10) unsigned AFTER `Name`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + diff --git a/version b/version index 75dd53914..1bffe5fba 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.28.99 +1.28.100 diff --git a/web/api/app/Plugin/Crud b/web/api/app/Plugin/Crud index f1cf70fff..e22c1563a 160000 --- a/web/api/app/Plugin/Crud +++ b/web/api/app/Plugin/Crud @@ -1 +1 @@ -Subproject commit f1cf70ffff0657db29388eca94e6c5ea4944a164 +Subproject commit e22c1563a51d86aac0d5054beee28b4afb60c802 diff --git a/web/includes/actions.php b/web/includes/actions.php index f52a96db6..6fdb33a9b 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -637,7 +637,35 @@ if ( !empty($action) ) // System edit actions if ( canEdit( 'System' ) ) { - if ( $action == "version" && isset($_REQUEST['option']) ) + if ( $_REQUEST['object'] == 'server' ) { + + if ( $action == "save" ) { + if ( !empty($_REQUEST['id']) ) + $dbServer = dbFetchOne( "SELECT * FROM Servers WHERE Id=?", NULL, array($_REQUEST['id']) ); + else + $dbServer = array(); + + $types = array(); + $changes = getFormChanges( $dbServer, $_REQUEST['newServer'], $types ); + + if ( count( $changes ) ) { + if ( !empty($_REQUEST['id']) ) { + dbQuery( "UPDATE Servers SET ".implode( ", ", $changes )." WHERE Id = ?", array($_REQUEST['id']) ); + } else { + dbQuery( "INSERT INTO Servers set ".implode( ", ", $changes ) ); + } + $refreshParent = true; + } + $view = 'none'; + } else if ( $action == 'delete' ) { + if ( !empty($_REQUEST['markIds']) ) { + foreach( $_REQUEST['markIds'] as $Id ) + dbQuery( "DELETE FROM Servers WHERE Id=?", array($Id) ); + } + $refreshParent = true; + } + + } else if ( $action == "version" && isset($_REQUEST['option']) ) { $option = $_REQUEST['option']; switch( $option ) diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index cb81789ea..7a30fdb8d 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -40,11 +40,18 @@ if ( isset($_REQUEST['tab']) ) else $tab = "general"; + if ( defined( ZM_SERVER_ID ) ) { + $Server = dbFetchOne( 'SELECT * FROM Servers WHERE Id=?', NULL, array( ZM_SERVER_ID ) ); + } else { + $Server = array(); + } + if ( ! empty($_REQUEST['mid']) ) { $monitor = dbFetchMonitor( $_REQUEST['mid'] ); if ( ZM_OPT_X10 ) $x10Monitor = dbFetchOne( 'SELECT * FROM TriggersX10 WHERE MonitorId = ?', NULL, array($_REQUEST['mid']) ); } else { + $nextId = getTableAutoInc( 'Monitors' ); $monitor = array( 'Id' => 0, @@ -106,6 +113,7 @@ if ( ! empty($_REQUEST['mid']) ) { 'Triggers' => "", 'V4LMultiBuffer' => '', 'V4LCapturesPerFrame' => 1, + 'ServerId' => $Server['Id'], ); } @@ -474,6 +482,7 @@ if ( $tab != 'general' ) { ?> + @@ -612,6 +621,13 @@ switch ( $tab ) { ?> + + + + + + + + + + + + + + + + + + + + + + +
disabled="disabled"/>
+
+ disabled="disabled"/> +
+ + +