mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Feature: Added the ability to edit the order of the tasks this is not the best solution but works we recommend setting them in orders of 5 or 10 so there is wiggle room to add tasks in between
This commit is contained in:
@@ -34,6 +34,7 @@ if (isset($_POST['edit_task'])) {
|
||||
|
||||
$task_id = intval($_POST['task_id']);
|
||||
$task_name = sanitizeInput($_POST['name']);
|
||||
$task_order = intval($_POST['order']);
|
||||
$is_ticket = intval($_POST['is_ticket']);
|
||||
|
||||
if($is_ticket == 1) {
|
||||
@@ -41,14 +42,12 @@ if (isset($_POST['edit_task'])) {
|
||||
$sql = mysqli_query($mysqli, "SELECT * FROM tasks LEFT JOIN tickets ON ticket_id = task_ticket_id WHERE task_id = $task_id");
|
||||
$row = mysqli_fetch_array($sql);
|
||||
$client_id = intval($row['ticket_client_id']);
|
||||
mysqli_query($mysqli, "UPDATE tasks SET task_name = '$task_name' WHERE task_id = $task_id");
|
||||
mysqli_query($mysqli, "UPDATE tasks SET task_name = '$task_name', task_order = $task_order WHERE task_id = $task_id");
|
||||
} else {
|
||||
$client_id = 0;
|
||||
mysqli_query($mysqli, "UPDATE task_templates SET task_template_name = '$task_name' WHERE task_template_id = $task_id");
|
||||
mysqli_query($mysqli, "UPDATE task_templates SET task_template_name = '$task_name', task_template_order = $task_order WHERE task_template_id = $task_id");
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Logging
|
||||
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Task', log_action = 'Edit', log_description = '$session_name edited task $task_name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $task_id");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user