diff --git a/post/user/ticket.php b/post/user/ticket.php index 89c3b038..1e16c9b8 100644 --- a/post/user/ticket.php +++ b/post/user/ticket.php @@ -25,8 +25,9 @@ if (isset($_POST['add_ticket'])) { $asset_id = intval($_POST['asset']); $location_id = intval($_POST['location']); $project_id = intval($_POST['project']); - $use_primary_contact = intval($_POST['use_primary_contact']); + $use_primary_contact = intval($_POST['use_primary_contact'] ?? 0); $ticket_template_id = intval($_POST['ticket_template_id']); + $billable = intval($_POST['billable'] ?? 0); // Add the primary contact as the ticket contact if "Use primary contact" is checked if ($use_primary_contact == 1) { @@ -35,12 +36,6 @@ if (isset($_POST['add_ticket'])) { $contact = intval($row['contact_id']); } - if (!isset($_POST['billable'])) { - $billable = 1; - } else { - $billable = intval($_POST['billable']); - } - //Get the next Ticket Number and add 1 for the new ticket number $ticket_number = $config_ticket_next_number; $new_config_ticket_next_number = $config_ticket_next_number + 1; @@ -170,10 +165,10 @@ if (isset($_POST['edit_ticket'])) { $ticket_id = intval($_POST['ticket_id']); $contact_id = intval($_POST['contact']); - $notify = intval($_POST['contact_notify']); + $notify = intval($_POST['contact_notify'] ?? 0); $category_id = intval($_POST['category']); $ticket_subject = sanitizeInput($_POST['subject']); - $billable = intval($_POST['billable']); + $billable = intval($_POST['billable'] ?? 0); $ticket_priority = sanitizeInput($_POST['priority']); $details = mysqli_real_escape_string($mysqli, $_POST['details']); $vendor_ticket_number = sanitizeInput($_POST['vendor_ticket_number']); diff --git a/ticket_add_modal.php b/ticket_add_modal.php index 02016067..e38a0341 100644 --- a/ticket_add_modal.php +++ b/ticket_add_modal.php @@ -8,9 +8,7 @@