From ad5f6a87294d2fb2b1bc7e5cdbe322dd98951b38 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 18 Mar 2019 14:49:05 -0400 Subject: [PATCH] Camera reboot function (#2554) * Adding a button for camera reboot function This series of commits will add a camera reboot function to the control interface if supported by the camera configuration. * Adding reboot function option to contorl configuration This patch adds a reboot option to the camera control configuration view. * Adding Reboot field to Controls table This patch adds a Reboot field to the Controls table to support a camera reboot control option. * Correcting button value to match reset * Updating language files I'm not sure of the proper procedure to trigger updating of non-english language files so I'm updating them all with English hoping that that will draw attention to the changes and others will translate accordingly. * Add missing forward slash --- db/zm_create.sql.in | 1 + scripts/ZoneMinder/lib/ZoneMinder/Control/Dahua.pm | 2 +- web/lang/ba_ba.php | 1 + web/lang/big5_big5.php | 1 + web/lang/cn_zh.php | 1 + web/lang/cs_cz.php | 1 + web/lang/de_de.php | 1 + web/lang/dk_dk.php | 1 + web/lang/en_gb.php | 1 + web/lang/es_ar.php | 1 + web/lang/es_es.php | 1 + web/lang/et_ee.php | 1 + web/lang/fr_fr.php | 1 + web/lang/he_il.php | 1 + web/lang/hu_hu.php | 1 + web/lang/it_it.php | 1 + web/lang/ja_jp.php | 1 + web/lang/nl_nl.php | 1 + web/lang/pl_pl.php | 1 + web/lang/pt_br.php | 1 + web/lang/ro_ro.php | 1 + web/lang/ru_ru.php | 1 + web/lang/se_se.php | 1 + web/skins/classic/includes/control_functions.php | 6 ++++++ web/skins/classic/views/controlcap.php | 2 ++ 25 files changed, 31 insertions(+), 1 deletion(-) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index ea0b42288..4063348fc 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -68,6 +68,7 @@ CREATE TABLE `Controls` ( `CanWake` tinyint(3) unsigned NOT NULL default '0', `CanSleep` tinyint(3) unsigned NOT NULL default '0', `CanReset` tinyint(3) unsigned NOT NULL default '0', + `CanReboot` tinyint(3) unsigned NOT NULL default '0', `CanZoom` tinyint(3) unsigned NOT NULL default '0', `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0', `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0', diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Control/Dahua.pm b/scripts/ZoneMinder/lib/ZoneMinder/Control/Dahua.pm index 10a37e102..e274aaaf7 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Control/Dahua.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Control/Dahua.pm @@ -444,7 +444,7 @@ sub reboot { my $self = shift; Debug( "Camera Reboot" ); - my $cmd = "cgi-bin/magicBox.cgi?action=reboot"; + my $cmd = "/cgi-bin/magicBox.cgi?action=reboot"; $self->_sendGetRequest($cmd); } diff --git a/web/lang/ba_ba.php b/web/lang/ba_ba.php index e60e69066..02ad8e5f3 100644 --- a/web/lang/ba_ba.php +++ b/web/lang/ba_ba.php @@ -216,6 +216,7 @@ $SLANG = array( 'CanMoveRel' => 'Podržava Relativno kretanje', 'CanPan' => 'Podržava Pomak' , 'CanReset' => 'PodržavaReset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Podržava presetove', 'CanSleep' => 'Podržava Sleep', 'CanTilt' => 'Podržava nagib', diff --git a/web/lang/big5_big5.php b/web/lang/big5_big5.php index 63ffb2c1d..518cbe57c 100644 --- a/web/lang/big5_big5.php +++ b/web/lang/big5_big5.php @@ -209,6 +209,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/cn_zh.php b/web/lang/cn_zh.php index 177f44377..8e2bfa8f9 100644 --- a/web/lang/cn_zh.php +++ b/web/lang/cn_zh.php @@ -205,6 +205,7 @@ $SLANG = array( 'CanMoveRel' => '可以相对移动', 'CanPan' => '可以平移' , 'CanReset' => '可以复位', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => '可以进行预设', 'CanSleep' => '可以休眠', 'CanTilt' => '可以倾斜', diff --git a/web/lang/cs_cz.php b/web/lang/cs_cz.php index a7939dbff..8e76b20ba 100644 --- a/web/lang/cs_cz.php +++ b/web/lang/cs_cz.php @@ -205,6 +205,7 @@ $SLANG = array( 'CanMoveRel' => 'Umí relativní pohyb', 'CanPan' => 'Umí otáčení', 'CanReset' => 'Umí reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Umí navolit předvolby', 'CanSleep' => 'Může spát', 'CanTilt' => 'Umí náklon', diff --git a/web/lang/de_de.php b/web/lang/de_de.php index fb7af310d..37ea4d81c 100644 --- a/web/lang/de_de.php +++ b/web/lang/de_de.php @@ -207,6 +207,7 @@ $SLANG = array( 'CanMoveRel' => 'Kann relative Bewegung', 'CanPan' => 'Kann Pan' , 'CanReset' => 'Kann Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Kann Voreinstellungen setzen', 'CanSleep' => 'Kann Sleep', 'CanTilt' => 'Kann Neigung', diff --git a/web/lang/dk_dk.php b/web/lang/dk_dk.php index 88ee943dc..26533a7fb 100644 --- a/web/lang/dk_dk.php +++ b/web/lang/dk_dk.php @@ -206,6 +206,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index 05bca82d0..560a8ad82 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -216,6 +216,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/es_ar.php b/web/lang/es_ar.php index e9c84af93..114002620 100644 --- a/web/lang/es_ar.php +++ b/web/lang/es_ar.php @@ -156,6 +156,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/es_es.php b/web/lang/es_es.php index 7b64fdd57..767b58d97 100644 --- a/web/lang/es_es.php +++ b/web/lang/es_es.php @@ -205,6 +205,7 @@ $SLANG = array( 'CanMoveRel' => 'Puede moverse de forma relativa', 'CanPan' => 'Puede desplazarse' , 'CanReset' => 'Puede restablecerse', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Puede fefinir programaciones', 'CanSleep' => 'Puede dormirse', 'CanTilt' => 'Puede inclinarse', diff --git a/web/lang/et_ee.php b/web/lang/et_ee.php index 3a2f68ad9..19d6e777b 100644 --- a/web/lang/et_ee.php +++ b/web/lang/et_ee.php @@ -212,6 +212,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/fr_fr.php b/web/lang/fr_fr.php index 46590f4aa..03ffc70ba 100644 --- a/web/lang/fr_fr.php +++ b/web/lang/fr_fr.php @@ -211,6 +211,7 @@ $SLANG = array( 'CanMoveRel' => 'Relatif', 'CanPan' => 'Panoramique' , 'CanReset' => 'RàZ', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Stockage prépos.', 'CanSleep' => 'Veille', 'CanTilt' => 'Inclinaison', diff --git a/web/lang/he_il.php b/web/lang/he_il.php index 67b7b87bd..26e8bcea6 100644 --- a/web/lang/he_il.php +++ b/web/lang/he_il.php @@ -205,6 +205,7 @@ $SLANG = array( 'CanMoveRel' => 'àôùø úæåæä éçñéú', 'CanPan' => 'Can Pan' , 'CanReset' => 'àôùø àúçåì', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'àôùø îöá ùéðä', 'CanTilt' => 'àôùø æòæåò', diff --git a/web/lang/hu_hu.php b/web/lang/hu_hu.php index 7c1336a87..15cf72aab 100644 --- a/web/lang/hu_hu.php +++ b/web/lang/hu_hu.php @@ -248,6 +248,7 @@ $SLANG = array( 'CanMoveRel' => 'Relatíven tud mozogni', 'CanPan' => 'Tud jobb-bal mozgást' , 'CanReset' => 'Tud alaphelyzetbe jönni', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Tud menteni profilokat', 'CanSleep' => 'Tud phihenő üzemmódot', 'CanTilt' => 'Tud fel-le mozgást', diff --git a/web/lang/it_it.php b/web/lang/it_it.php index 8890650e8..9049b3c2f 100644 --- a/web/lang/it_it.php +++ b/web/lang/it_it.php @@ -210,6 +210,7 @@ $SLANG = array( 'CanMoveRel' => 'Puo\' Mov. Relativo', 'CanPan' => 'Puo\' Pan' , 'CanReset' => 'Puo\' Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Puo\' impostare preset', 'CanSleep' => 'Puo\' andare in sleep', 'CanTilt' => 'Puo\' Tilt', diff --git a/web/lang/ja_jp.php b/web/lang/ja_jp.php index 4d1854550..b34c9f3f0 100644 --- a/web/lang/ja_jp.php +++ b/web/lang/ja_jp.php @@ -206,6 +206,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/nl_nl.php b/web/lang/nl_nl.php index a50fdd082..a2003b1c3 100644 --- a/web/lang/nl_nl.php +++ b/web/lang/nl_nl.php @@ -206,6 +206,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relatief', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/pl_pl.php b/web/lang/pl_pl.php index 48c34b1a3..d41242317 100644 --- a/web/lang/pl_pl.php +++ b/web/lang/pl_pl.php @@ -220,6 +220,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/pt_br.php b/web/lang/pt_br.php index ec4807765..3d5a2cf83 100644 --- a/web/lang/pt_br.php +++ b/web/lang/pt_br.php @@ -145,6 +145,7 @@ $SLANG = array( 'CanMoveRel' => 'Can Move Relative', 'CanPan' => 'Can Pan' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Can Tilt', diff --git a/web/lang/ro_ro.php b/web/lang/ro_ro.php index 5526be753..97e07b836 100644 --- a/web/lang/ro_ro.php +++ b/web/lang/ro_ro.php @@ -176,6 +176,7 @@ $SLANG = array( 'CanMoveRel' => 'Mişcare relativă', 'CanPan' => 'Rotativ' , 'CanReset' => 'Can Reset', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Can Set Presets', 'CanSleep' => 'Can Sleep', 'CanTilt' => 'Se poate înclina', diff --git a/web/lang/ru_ru.php b/web/lang/ru_ru.php index 0416f3358..11110745e 100644 --- a/web/lang/ru_ru.php +++ b/web/lang/ru_ru.php @@ -206,6 +206,7 @@ $SLANG = array( 'CanMoveRel' => 'Относительное перемещение', 'CanPan' => 'Панорама' , 'CanReset' => 'Сброс', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Создание предустановок', 'CanSleep' => 'Сон', 'CanTilt' => 'Наклон', diff --git a/web/lang/se_se.php b/web/lang/se_se.php index 995e88156..4245ae974 100644 --- a/web/lang/se_se.php +++ b/web/lang/se_se.php @@ -206,6 +206,7 @@ $SLANG = array( 'CanMoveRel' => 'Har relativ förflyttning', 'CanPan' => 'Har panorering', 'CanReset' => 'Har återställning', + 'CanReboot' => 'Can Reboot', 'CanSetPresets' => 'Har förinställningar', 'CanSleep' => 'Kan vila', 'CanTilt' => 'Kan tilta', diff --git a/web/skins/classic/includes/control_functions.php b/web/skins/classic/includes/control_functions.php index b2a42a1d4..2c3fbd73a 100644 --- a/web/skins/classic/includes/control_functions.php +++ b/web/skins/classic/includes/control_functions.php @@ -24,6 +24,7 @@ function getControlCommands( $monitor ) { $cmds['Wake'] = 'wake'; $cmds['Sleep'] = 'sleep'; $cmds['Reset'] = 'reset'; + $cmds['Reboot'] = 'reboot'; $cmds['PresetSet'] = 'presetSet'; $cmds['PresetGoto'] = 'presetGoto'; @@ -319,6 +320,11 @@ function controlPower( $monitor, $cmds ) { if ( $monitor->CanReset() ) { ?> +CanReboot() ) { +?> + diff --git a/web/skins/classic/views/controlcap.php b/web/skins/classic/views/controlcap.php index 546c27a93..bc48d05e4 100644 --- a/web/skins/classic/views/controlcap.php +++ b/web/skins/classic/views/controlcap.php @@ -59,6 +59,7 @@ else 'CanWake' => "", 'CanSleep' => "", 'CanReset' => "", + 'CanReboot' => "", 'CanMove' => "", 'CanMoveDiag' => "", 'CanMoveMap' => "", @@ -352,6 +353,7 @@ switch ( $tab ) checked="checked"/> checked="checked"/> checked="checked"/> + checked="checked"/>