Beispiel #1
0
            $dataStore = new dataStore();
            $dataStore->setKey(init('key'));
            $dataStore->setLink_id(init('link_id'));
            $dataStore->setType(init('type'));
        } else {
            $dataStore = dataStore::byId(init('id'));
        }
        if (!is_object($dataStore)) {
            throw new Exception(__('Data store inconnu vérifer l\'id : ', __FILE__) . init('id'));
        }
        $dataStore->setValue(init('value'));
        $dataStore->save();
        ajax::success();
    }
    if (init('action') == 'all') {
        $datastores = utils::o2a(dataStore::byTypeLinkId(init('type')));
        if (init('usedBy') == 1) {
            foreach ($datastores as &$datastore) {
                $datastore['usedBy'] = array('scenario' => array());
                foreach (scenario::byUsedCommand($datastore['key'], true) as $scenario) {
                    $datastore['usedBy']['scenario'][] = $scenario->getHumanName();
                }
            }
        }
        ajax::success($datastores);
    }
    throw new Exception(__('Aucune methode correspondante à : ', __FILE__) . init('action'));
    /*     * *********Catch exeption*************** */
} catch (Exception $e) {
    ajax::error(displayExeption($e), $e->getCode());
}
		<span>({{Valeur obligatoire}})</span>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">{{Texte d'information}}</label>
		<div class="col-sm-3">
			<input type="text" id="gCalendar_texte" class="eqLogicAttr form-control"/>
		</div>
		<span>({{Valeur non obligatoire}}, {{s'affiche sur le calendrier à coté du nom du scénario}})</span>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" >{{Nom de la variable}}</label>
		<div class="col-sm-3">
			<select id="gCalendar_variable" class="eqLogicAttr form-control">
                <option value="">{{Aucune}}</option>
<?php 
foreach (utils::o2a(dataStore::byTypeLinkId('scenario')) as $_aVarScenario) {
    echo '<option value="' . $_aVarScenario['key'] . '">' . $_aVarScenario['key'] . '</option>';
}
?>
			</select>
		</div>
		<span>({{Variable obligatoire, si la valeur de début et/ou de fin est renseignée}})</span>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">{{Valeur variable 1ère minute}}</label>
		<div class="col-sm-3">
			<input type="text" id="gCalendar_valFirst" class="eqLogicAttr form-control"/>
		</div>
		<span>({{Valeur non obligatoire}} ; {{permet d'envoyer une valeur à la variable utilisée dans le scénario, pour la 1ère minute de la période}})</span>
	</div>
	<div class="form-group">