Beispiel #1
0
     $hosts = $service->getDataValue('host_name');
     foreach ($hosts as $host_id => $host_name) {
         $host = new IEHost($host_id);
         $newService = new IEService($service->getId());
         $newService->setDataValue($service->userColumn, 0);
         $newService->setDataValue('public', 0);
         if ($newService->fork($host, $host->getDataValue($host->userColumn))) {
             $oUser->addStatusMessage(sprintf(_('Služba %s byla odvozena'), $newService->getName()), 'success');
         } else {
             $oUser->addStatusMessage(_('Služba nebyla odvozena'), 'error');
         }
     }
     $service->loadFromMySQL($service->getId());
     break;
 case 'swap':
     $service->swapTo($oPage->getRequestValue('new_service_id', 'int'));
     break;
 case 'export':
     $service->transferDeps($oPage->getRequestValue('destination'), $oPage->getRequestValue('rels'));
     break;
 default:
     if ($oPage->isPosted()) {
         if ($oPage->getRequestValue('action') != 'rename') {
             if ($oPage->getRequestValue('action') == 'clone') {
                 $oUser->addStatusMessage(_('Služba byla zklonovana'), 'info');
                 $service->unsetDataValue($service->getMyKey());
             } else {
                 $service->takeData($_POST);
             }
             $serviceID = $service->saveToMySQL();
             if (is_null($serviceID)) {