mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Drag and Drop Ticket Template Tasks
This commit is contained in:
22
ajax.php
22
ajax.php
@@ -705,4 +705,24 @@ if (isset($_POST['update_ticket_tasks_order'])) {
|
||||
// return a response
|
||||
echo json_encode(['status' => 'success']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['update_task_templates_order'])) {
|
||||
// Update multiple task templates order
|
||||
enforceUserPermission('module_support', 2);
|
||||
|
||||
$positions = $_POST['positions'];
|
||||
$ticket_template_id = intval($_POST['ticket_template_id']);
|
||||
|
||||
foreach ($positions as $position) {
|
||||
$id = intval($position['id']);
|
||||
$order = intval($position['order']);
|
||||
|
||||
mysqli_query($mysqli, "UPDATE task_templates SET task_template_order = $order WHERE task_template_ticket_template_id = $ticket_template_id AND task_template_id = $id");
|
||||
}
|
||||
|
||||
// return a response
|
||||
echo json_encode(['status' => 'success']);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user