Added Ticket Templates and the ability to add Tasks to the template, reworked the ticket details tasks and adding tasks

This commit is contained in:
johnnyq
2024-03-28 21:09:32 -04:00
parent 08fc72ded7
commit 89a1c5d2d8
10 changed files with 742 additions and 115 deletions

View File

@@ -56,6 +56,17 @@ if (isset($_POST['add_ticket'])) {
$ticket_id = mysqli_insert_id($mysqli);
// Add Tasks
if (!empty($_POST['tasks'])) {
foreach ($_POST['tasks'] as $task) {
$task_name = sanitizeInput($task);
// Check that task_name is not-empty (For some reason the !empty on the array doesnt work here like in watchers)
if (!empty($task_name)) {
mysqli_query($mysqli,"INSERT INTO tasks SET task_name = '$task_name', task_ticket_id = $ticket_id");
}
}
}
// Add Watchers
if (!empty($_POST['watchers'])) {
foreach ($_POST['watchers'] as $watcher) {