Ejemplo n.º 1
0
<?php

if (!hasRight('displayview', true)) {
    throw new Exception('{{401 - Accès non autorisé}}');
}
$nbEqlogic = 0;
$nbCmd = 0;
$objects = object::all();
$eqLogics = array();
$cmds = array();
$eqLogics[-1] = eqLogic::byObjectId(null, false);
foreach ($eqLogics[-1] as $eqLogic) {
    $cmds[$eqLogic->getId()] = $eqLogic->getCmd();
    $nbCmd += count($cmds[$eqLogic->getId()]);
}
$nbEqlogic += count($eqLogics[-1]);
foreach ($objects as $object) {
    $eqLogics[$object->getId()] = $object->getEqLogic(false, false);
    foreach ($eqLogics[$object->getId()] as $eqLogic) {
        $cmds[$eqLogic->getId()] = $eqLogic->getCmd();
        $nbCmd += count($cmds[$eqLogic->getId()]);
    }
    $nbEqlogic += count($eqLogics[$object->getId()]);
}
?>
<style>
	.eqLogicSortable{
		list-style-type: none;
		min-height: 20px;
		padding-left: 0px;
	}
Ejemplo n.º 2
0
     $info_eqLogic['id'] = $eqLogic->getId();
     $info_eqLogic['type'] = $eqLogic->getEqType_name();
     $info_eqLogic['object_id'] = $eqLogic->getObject_id();
     $info_eqLogic['html'] = $eqLogic->toHtml(init('version'));
     ajax::success($info_eqLogic);
 }
 if (init('action') == 'listByType') {
     ajax::success(utils::a2o(eqLogic::byType(init('type'))));
 }
 if (init('action') == 'listByObjectAndCmdType') {
     $object_id = init('object_id') != -1 ? init('object_id') : null;
     ajax::success(eqLogic::listByObjectAndCmdType($object_id, init('typeCmd'), init('subTypeCmd')));
 }
 if (init('action') == 'listByObject') {
     $object_id = init('object_id') != -1 ? init('object_id') : null;
     ajax::success(utils::o2a(eqLogic::byObjectId($object_id, init('onlyEnable', true), init('onlyVisible', false), init('eqType_name', null), init('logicalId', null), init('orderByName', false))));
 }
 if (init('action') == 'listByTypeAndCmdType') {
     $results = eqLogic::listByTypeAndCmdType(init('type'), init('typeCmd'), init('subTypeCmd'));
     $return = array();
     foreach ($results as $result) {
         $eqLogic = eqLogic::byId($result['id']);
         $info['eqLogic'] = utils::o2a($eqLogic);
         $info['object'] = array('name' => 'Aucun');
         if (is_object($eqLogic)) {
             $object = $eqLogic->getObject();
             if (is_object($object)) {
                 $info['object'] = utils::o2a($eqLogic->getObject());
             }
         }
         $return[] = $info;
Ejemplo n.º 3
0
     $dataStore->setType($params['type']);
     $dataStore->setKey($params['key']);
     $dataStore->setValue($params['value']);
     $dataStore->setLink_id($params['linkId']);
     $dataStore->save();
     $jsonrpc->makeSuccess('ok');
 }
 /*             * ************************Equipement*************************** */
 if ($jsonrpc->getMethod() == 'eqLogic::all') {
     $jsonrpc->makeSuccess(utils::o2a(eqLogic::all()));
 }
 if ($jsonrpc->getMethod() == 'eqLogic::byType') {
     $jsonrpc->makeSuccess(utils::o2a(eqLogic::byType($params['type'])));
 }
 if ($jsonrpc->getMethod() == 'eqLogic::byObjectId') {
     $jsonrpc->makeSuccess(utils::o2a(eqLogic::byObjectId($params['object_id'])));
 }
 if ($jsonrpc->getMethod() == 'eqLogic::byId') {
     $eqLogic = eqLogic::byId($params['id']);
     if (!is_object($eqLogic)) {
         throw new Exception('EqLogic introuvable : ' . $params['id'], -32602);
     }
     $jsonrpc->makeSuccess(utils::o2a($eqLogic));
 }
 if ($jsonrpc->getMethod() == 'eqLogic::fullById') {
     $eqLogic = eqLogic::byId($params['id']);
     if (!is_object($eqLogic)) {
         throw new Exception('EqLogic introuvable : ' . $params['id'], -32602);
     }
     $return = utils::o2a($eqLogic);
     $return['cmds'] = array();
Ejemplo n.º 4
0
 public function getEqLogic($_onlyEnable = true, $_onlyVisible = false, $_eqType_name = null, $_logicalId = null)
 {
     return eqLogic::byObjectId($this->getId(), $_onlyEnable, $_onlyVisible, $_eqType_name, $_logicalId);
 }