} else { $pMonitoringServicedef = new PluginMonitoringServicedef(); if ($_POST['plugin_monitoring_servicedefs_id'] == '0') { // Add the service $id = $_POST['id']; unset($_POST['id']); $_POST['plugin_monitoring_servicedefs_id'] = $pMonitoringServicedef->add($_POST); $_POST['id'] = $id; } else { $pMonitoringServicedef->getFromDB($_POST['plugin_monitoring_servicedefs_id']); if ($pMonitoringServicedef->fields['is_template'] == '0') { $pMonitoringServicedef->update($_POST); } } if (isset($_POST['arg'])) { $_POST['arguments'] = exportArrayToDB($_POST['arg']); } if (isset($_POST['alias_commandservice'])) { $_POST['alias_command'] = $_POST['alias_commandservice']; } $pMonitoringService->update($_POST); } glpi_header($_SERVER['HTTP_REFERER']); } } if (isset($_GET["id"])) { $pMonitoringService->showForm($_GET["id"]); } else { $pMonitoringService->showForm('', array(), $_GET['services_id']); } commonFooter();