function virtual_update() { foreach (virtual::byType('virtual') as $virtual) { $virtual->save(); } }
* it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Jeedom is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jeedom. If not, see <http://www.gnu.org/licenses/>. */ try { require_once dirname(__FILE__) . '/../../../../core/php/core.inc.php'; include_file('core', 'authentification', 'php'); if (!isConnect('admin')) { throw new Exception(__('401 - Accès non autorisé', __FILE__)); } if (init('action') == 'copyFromEqLogic') { $virtual = virtual::byId(init('id')); if (!is_object($virtual)) { throw new Exception(__('Equipement virtuel introuvable : ', __FILE__) . init('id')); } $virtual->copyFromEqLogic(init('eqLogic_id')); ajax::success(); } throw new Exception(__('Aucune methode correspondante à : ', __FILE__) . init('action')); /* * *********Catch exeption*************** */ } catch (Exception $e) { ajax::error(displayExeption($e), $e->getCode()); }