Esempio n. 1
0
     $update = update::byId(init('id'));
     if (!is_object($update)) {
         $update = update::byLogicalId(init('id'));
     }
     if (!is_object($update)) {
         throw new Exception(__('Aucune correspondance pour l\'ID : ' . init('id'), __FILE__));
     }
     $update->deleteObjet();
     ajax::success();
 }
 if (init('action') == 'updateAll') {
     update::makeUpdateLevel(init('mode'), init('level'), init('version', ''), init('onlyThisVersion', ''));
     ajax::success();
 }
 if (init('action') == 'updateSystem') {
     jeedom::updateSystem();
     ajax::success();
 }
 if (init('action') == 'changeState') {
     update::findNewUpdateObject();
     $update = update::byId(init('id'));
     if (!is_object($update)) {
         throw new Exception(__('Aucune correspondance pour l\'ID : ' . init('id'), __FILE__));
     }
     if (init('state') == '') {
         throw new Exception(__('Le status ne peut être vide', __FILE__));
     }
     if (init('state') == 'hold') {
         $update->setStatus('hold');
         $update->save();
     } else {