add name to automatization
This commit is contained in:
		@@ -10,23 +10,23 @@
 | 
			
		||||
                            case 'sunSet':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
                            
 | 
			
		||||
 | 
			
		||||
                            case 'sunRise':
 | 
			
		||||
                            echo' ';
 | 
			
		||||
                            break;
 | 
			
		||||
                            
 | 
			
		||||
 | 
			
		||||
                            case 'inHome':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
                            
 | 
			
		||||
 | 
			
		||||
                            case 'outHome':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
                            
 | 
			
		||||
 | 
			
		||||
                            case 'outDevice':
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
                            
 | 
			
		||||
 | 
			
		||||
                            default:
 | 
			
		||||
                            echo'';
 | 
			
		||||
                            break;
 | 
			
		||||
@@ -36,10 +36,11 @@
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <h5 class="text-right break-all">
 | 
			
		||||
                        <?php 
 | 
			
		||||
                        if (!in_array($AUTOMATIONDATA['ifSomething'], ["sunRise", "sunSet"])) {
 | 
			
		||||
                        <?php
 | 
			
		||||
                        /*if (!in_array($AUTOMATIONDATA['ifSomething'], ["sunRise", "sunSet"])) {
 | 
			
		||||
                            echo $AUTOMATIONDATA['ifSomething'];
 | 
			
		||||
                        }
 | 
			
		||||
                        }*/
 | 
			
		||||
                        echo $AUTOMATIONDATA['name'];
 | 
			
		||||
                        ?>
 | 
			
		||||
                    </h5>
 | 
			
		||||
                </div>
 | 
			
		||||
@@ -49,6 +50,14 @@
 | 
			
		||||
                    <?php echo implode(', ',$AUTOMATIONDATA['onDays']);?>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="row">
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <a class="button is-primary m-1" onclick="$('#modal').removeClass('modal-container-hiden').show();">restart</a>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col">
 | 
			
		||||
                    <a class="button is-primary m-1" onclick="$('#modal').removeClass('modal-container-hiden').show();">deaktivovat</a>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,10 @@
 | 
			
		||||
        <h4 class="mb-4"><?php echo $LANG['t_createAutomation']?></h4>
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label"><?php echo $LANG['l_nameAt']?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input class="input" type="text" name="name" required/>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php echo $LANG['l_runAt']?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <select class="input" name="atSelector" id="valueSelector" required>
 | 
			
		||||
@@ -29,12 +33,12 @@
 | 
			
		||||
                <div class="label"><?php echo $LANG['l_affectedDevices']?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <select class="input" name="devices[]" multiple>
 | 
			
		||||
                        <?php foreach ($SUBDEVICES as $subDeviceKey => $subDeviceValue){ 
 | 
			
		||||
                        <?php foreach ($SUBDEVICES as $subDeviceKey => $subDeviceValue){
 | 
			
		||||
                            if ($subDeviceValue['type'] != 'on/off') continue;?>
 | 
			
		||||
                            <option value="<?php echo $subDeviceValue['masterDevice']; ?>"><?php echo $subDeviceValue['name']; ?></option>
 | 
			
		||||
                        <?php } ?>
 | 
			
		||||
                    </select>
 | 
			
		||||
                    
 | 
			
		||||
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php echo $LANG['l_atDays']?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
@@ -62,4 +66,4 @@
 | 
			
		||||
            <input type="submit" class="button" name="modalNext" value="<?php echo $LANG['b_next']?>"/>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <input type="hidden" name="atSelector" value="<?php echo $_POST['atSelector']; ?>" required/>
 | 
			
		||||
                <input type="hidden" name="name" value="<?php echo $_POST['name']; ?>" required/>
 | 
			
		||||
                <input type="hidden" name="atSelectorValue" value="<?php if (isset($_POST['atTime'])) {
 | 
			
		||||
                    echo $_POST['atTime'];
 | 
			
		||||
                } else if (isset($_POST['atDeviceValue'])) {
 | 
			
		||||
@@ -12,7 +13,7 @@
 | 
			
		||||
                    $subDeviceValue = $_POST['atDeviceValueInt'];
 | 
			
		||||
                    $subDevice = SubDeviceManager::getSubDevice($subDeviceId);
 | 
			
		||||
                    $subDeviceMaster = SubDeviceManager::getSubDeviceMaster($subDeviceId,$subDevice['type']);
 | 
			
		||||
                    
 | 
			
		||||
 | 
			
		||||
                    $json = json_encode([
 | 
			
		||||
                        'deviceID' => $subDeviceMaster['device_id'],
 | 
			
		||||
                        'type'=> htmlspecialchars($subDevice['type']),
 | 
			
		||||
@@ -36,4 +37,4 @@
 | 
			
		||||
            <input type="submit" class="button" name="modalFinal" value="Next"/>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,10 @@
 | 
			
		||||
        <form method="post">
 | 
			
		||||
            <input name="automation_id" type="hidden" value="<?php echo $AUTOMATIONID; ?>">
 | 
			
		||||
            <div class="field">
 | 
			
		||||
                <div class="label"><?php echo $LANG['l_nameAt']?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <input class="input" type="text" name="name" value="<?php echo (isset ($AUTOMATION['name']) ? $AUTOMATION['name'] : ""); ?>" required/>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="label"><?php echo $LANG['l_runAt']?></div>
 | 
			
		||||
                <div class="field">
 | 
			
		||||
                    <?php //TODO Dodělat identifikaci pro Selctor události a selector času zařízení hodnoty ?>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user