/** * Icinga Editor - Předloha sledovaných služeb * * @package IcingaEditor * @subpackage WebUI * @author Vitex <*****@*****.**> * @copyright 2012 Vitex@hippy.cz (G) */ require_once 'includes/IEInit.php'; $oPage->onlyForLogged(); $stemplate = new IEStemplate($oPage->getRequestValue('stemplate_id', 'int')); switch ($oPage->getRequestValue('action')) { case 'new': $stemplate->setDataValue($stemplate->nameColumn, _('Nová předloha')); $stemplate->insertToSQL(); $stemplate->setDataValue($stemplate->nameColumn, _('Nová předloha') . ' #' . $stemplate->getId()); $stemplate->updateToMySQL(); break; case 'copyhost': $host = new IEHost($oPage->getRequestValue('host_id', 'int')); $stemplate->setDataValue($stemplate->nameColumn, $host->getName()); $stemplate->setDataValue('services', $host->getServices()); if ($stemplate->saveToSQL()) { $stemplate->addStatusMessage(sprintf(_('Vytvořena nová předloha sledovaných služeb: %s'), $stemplate->getName()), 'success'); } else { $stemplate->addStatusMessage(sprintf(_('Nebyla vytvořena nová předloha')), 'warning'); } break; case 'export': $stemplate->transfer($oPage->getRequestValue('destination'));