blob: ca8ba35ce52602ce6e063f2c9d5d55d7aee3e1fd [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::ADMIN);
4
5
6if (!security::checkParams("POST", [
7 ["id", security::PARAM_NEMPTY],
8 ["name", security::PARAM_NEMPTY]
9])) {
10 security::go("incidenttypes.php?msg=empty");
11}
12
13$id = (int)$_POST["id"];
14$name = $_POST["name"];
15$present = ((isset($_POST["present"]) && $_POST["present"] == 1) ? 1 : 0);
16$paid = ((isset($_POST["paid"]) && $_POST["paid"] == 1) ? 1 : 0);
17$workerfill = ((isset($_POST["workerfill"]) && $_POST["workerfill"] == 1) ? 1 : 0);
18$notifies = ((isset($_POST["notifies"]) && $_POST["notifies"] == 1) ? 1 : 0);
19$autovalidates = ((isset($_POST["autovalidates"]) && $_POST["autovalidates"] == 1) ? 1 : 0);
20$hidden = ((isset($_POST["hidden"]) && $_POST["hidden"] == 1) ? 1 : 0);
21
22if (incidents::editType($id, $name, $present, $paid, $workerfill, $notifies, $autovalidates, $hidden)) {
23 security::go("incidenttypes.php?msg=modified");
24} else {
25 security::go("incidenttypes.php?msg=unexpected");
26}