Beispiel #1
0
$custom_name = Util::htmlentities($custom_name, ENT_QUOTES);
$custom_old_name = Util::htmlentities($custom_old_name, ENT_QUOTES);
if ($action == "modify") {
    Incident_type::update($conn, $inctype_id, $inctype_descr, $custom == 1 ? "custom" : "");
    $location = "incidenttype.php";
} elseif ($action == "modify_ct") {
    Incident_custom::update_custom($conn, $custom_name, $custom_type, $custom_options, $custom_required, $inctype_id, $custom_old_name);
    $location = "modifyincidenttypeform.php?id=" . urlencode($inctype_id);
} elseif ($action == "modify_pos") {
    Incident_custom::update_ord($conn, $custom_oldpos, $custom_newpos, $inctype_id, $custom_old_name);
    $location = "modifyincidenttypeform.php?id=" . urlencode($inctype_id);
} elseif ($action == "add" && trim($custom_name) != "" && trim($custom_type) != "") {
    if (in_array($custom_type, $options) && $custom_options != '' || !in_array($custom_type, $options)) {
        $next_ord = Incident_custom::get_next_ord($conn, $inctype_id);
        $params = array($inctype_id, $custom_name, $custom_type, $custom_options, $custom_required, $next_ord);
        Incident_custom::insert_custom($conn, $params);
        $location = "modifyincidenttypeform.php?id=" . urlencode($inctype_id);
    }
} elseif ($action == "delete" && trim($custom_name) != "") {
    Incident_custom::delete_custom($conn, $inctype_id, $custom_name);
    $location = "modifyincidenttypeform.php?id=" . urlencode($inctype_id);
}
$db->close($conn);
?>
    <p> <?php 
echo gettext("Action type succesfully updated");
?>
 </p>
<?php 
sleep(1);
echo "<script>window.location='{$location}';</script>";