/** * @todo create Exception for missing (user) id (or rebuild) * @throws EquipmentTypeIDMissingException */ public static function delete_organisation_unit() { if ($_GET['id']) { if ($_GET['key']) { if ($_GET['sure'] != "true") { $template = new HTMLTemplate("equipment/admin/equipment_type/delete_organisation_unit.html"); $paramquery = $_GET; $paramquery['sure'] = "true"; $params = http_build_query($paramquery); $template->set_var("yes_params", $params); $paramquery = $_GET; unset($paramquery['key']); $paramquery['action'] = "detail"; $params = http_build_query($paramquery); $template->set_var("no_params", $params); $template->output(); } else { $paramquery = $_GET; unset($paramquery['key']); unset($paramquery['sure']); $paramquery['action'] = "detail"; $params = http_build_query($paramquery); $equipment_type = new EquipmentType($_GET['id']); if ($equipment_type->delete_organisation_unit($_GET['key'])) { Common_IO::step_proceed($params, "Delete Organisation Unit", "Operation Successful", null); } else { Common_IO::step_proceed($params, "Delete Organisation Unit", "Operation Failed", null); } } } else { // error } } else { throw new EquipmentTypeIDMissingException(); } }