From 485bb6805538fec5553f0b3f0898392d5c286219 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 18 Sep 2023 16:29:19 -0400 Subject: [PATCH] A Ticket Contact is now optional --- post/ticket.php | 5 +++-- ticket_add_modal.php | 11 +++++++++-- ticket_edit_modal.php | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/post/ticket.php b/post/ticket.php index cf6afe9d..d28d9928 100644 --- a/post/ticket.php +++ b/post/ticket.php @@ -22,9 +22,10 @@ if (isset($_POST['add_ticket'])) { $vendor_ticket_number = sanitizeInput($_POST['vendor_ticket_number']); $vendor_id = intval($_POST['vendor']); $asset_id = intval($_POST['asset']); + $use_primary_contact = intval($_POST['use_primary_contact']); - // If no contact is selected automatically choose the primary contact for the client - if ($client_id > 0 && $contact == 0) { + // Add the primary contact as the ticket contact if use primary contact is checked + if ($use_primary_contact == 1) { $sql = mysqli_query($mysqli,"SELECT contact_id FROM contacts WHERE contact_client_id = $client_id AND contact_primary = 1"); $row = mysqli_fetch_array($sql); $contact = intval($row['contact_id']); diff --git a/ticket_add_modal.php b/ticket_add_modal.php index bf61b604..0a3ab29b 100644 --- a/ticket_add_modal.php +++ b/ticket_add_modal.php @@ -71,6 +71,13 @@ +
+
+ + +
+
+
@@ -126,8 +133,8 @@
- +