diff --git a/app/controls/automation.php b/app/controls/automation.php index 94432bb..b23dc4c 100644 --- a/app/controls/automation.php +++ b/app/controls/automation.php @@ -8,7 +8,7 @@ if (isset($_POST) && !empty($_POST)){ ], JSON_PRETTY_PRINT); $onDays = $_POST['atDays']; - AutomationManager::create('name', $onDays, $doCode, $ifCode); + AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode); header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')), TRUE); die(); @@ -23,7 +23,7 @@ if (isset($_POST) && !empty($_POST)){ $json = json_encode([ 'deviceID' => $subDeviceMaster['device_id'], - 'type'=> htmlspecialchars($subDevice['type']), + 'type'=> $subDevice['type'], 'value'=> $subDeviceValue, ]); } @@ -36,7 +36,7 @@ if (isset($_POST) && !empty($_POST)){ ], JSON_PRETTY_PRINT); $onDays = ($_POST['day'] != '' ? json_encode($_POST['day']) : ''); - AutomationManager::create('name', $onDays, $doCode, $ifCode, (isset ($_POST['automation_id']) ? $_POST['automation_id'] : "")); + AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode, (isset ($_POST['automation_id']) ? $_POST['automation_id'] : "")); header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')), TRUE); die(); diff --git a/app/lang/cs.php b/app/lang/cs.php index d5090a9..92f5501 100644 --- a/app/lang/cs.php +++ b/app/lang/cs.php @@ -44,6 +44,7 @@ $lang = [ 'l_inMinutes' => 'v minutách', 'l_sleepTime' => 'Doba spánku zařízení', 'l_atHome' => 'Doma Jsou', + 'l_nameAt' => 'Název', //Title 't_createScene' => 'Vytvořit scénu', diff --git a/app/lang/en.php b/app/lang/en.php index e6952e8..c29271f 100644 --- a/app/lang/en.php +++ b/app/lang/en.php @@ -44,6 +44,7 @@ $lang = [ 'l_inMinutes' => 'in minutes', 'l_sleepTime' => 'Device sleep Time', 'l_atHome' => 'At home', + 'l_nameAt' => 'Name', //Title 't_createScene' => 'Create Scene', diff --git a/app/templates/part/automationButton.phtml b/app/templates/part/automationButton.phtml index 3ceb814..b9f3bdd 100644 --- a/app/templates/part/automationButton.phtml +++ b/app/templates/part/automationButton.phtml @@ -37,10 +37,11 @@
-
@@ -50,6 +51,14 @@ +
+
+ restart +
+
+ deaktivovat +
+
- \ No newline at end of file + diff --git a/app/templates/part/automationCreate.phtml b/app/templates/part/automationCreate.phtml index 8bafb13..57f871a 100644 --- a/app/templates/part/automationCreate.phtml +++ b/app/templates/part/automationCreate.phtml @@ -4,6 +4,10 @@

+
+
+ +
- $subDeviceValue){ + $subDeviceValue){ if ($subDeviceValue['type'] != 'on/off') continue;?> - +
@@ -62,4 +66,4 @@
-
\ No newline at end of file + diff --git a/app/templates/part/automationCreateFinal.phtml b/app/templates/part/automationCreateFinal.phtml index 909ece1..7d372f9 100644 --- a/app/templates/part/automationCreateFinal.phtml +++ b/app/templates/part/automationCreateFinal.phtml @@ -5,6 +5,7 @@
+
- \ No newline at end of file + diff --git a/app/templates/part/automationEdit.phtml b/app/templates/part/automationEdit.phtml index 778d31a..dad21de 100644 --- a/app/templates/part/automationEdit.phtml +++ b/app/templates/part/automationEdit.phtml @@ -7,6 +7,10 @@
+
+
+ " required/> +
diff --git a/app/views/Automation.php b/app/views/Automation.php index 3000477..89940d1 100644 --- a/app/views/Automation.php +++ b/app/views/Automation.php @@ -28,7 +28,7 @@ class Automation extends Template ]; } $automations[$automationData['automation_id']] = [ - 'name' => '', + 'name' => $automationData['name'], 'onDays' => json_decode($automationData['on_days']), 'ifSomething' => $automationData['if_something'], 'doSomething' => $doSomething,