From e42c5bc2f5c5ca59e05e58347a7b1163a4d82e95 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 27 Mar 2024 22:27:56 -0400 Subject: [PATCH] Major UI Updates to projects, created project details which display project stats tickets and tasks, tickets can be linked to a project, soon will add all users who contributed to a project and some more stats along with a nice timeline from created to deadline --- client_tickets.php | 3 + post/ticket.php | 6 +- project_add_modal.php | 25 +++ project_details.php | 345 ++++++++++++++++++++++++++++++++++++++++++ projects.php | 79 +++++++--- ticket.php | 2 + ticket_add_modal.php | 28 ++++ ticket_edit_modal.php | 28 ++++ tickets.php | 1 + 9 files changed, 496 insertions(+), 21 deletions(-) create mode 100644 project_details.php diff --git a/client_tickets.php b/client_tickets.php index a10de9c5..b5d6bbce 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -181,6 +181,9 @@ $total_scheduled_tickets = intval($row['total_scheduled_tickets']); } else { $ticket_assigned_to_display = nullable_htmlentities($row['user_name']); } + + $project_id = intval($row['ticket_project_id']); + $contact_name = nullable_htmlentities($row['contact_name']); $contact_email = nullable_htmlentities($row['contact_email']); $contact_archived_at = nullable_htmlentities($row['contact_archived_at']); diff --git a/post/ticket.php b/post/ticket.php index 1ac2f621..d0ea42d4 100644 --- a/post/ticket.php +++ b/post/ticket.php @@ -23,6 +23,7 @@ if (isset($_POST['add_ticket'])) { $vendor_id = intval($_POST['vendor']); $asset_id = intval($_POST['asset']); $location_id = intval($_POST['location']); + $project_id = intval($_POST['project']); $use_primary_contact = intval($_POST['use_primary_contact']); @@ -51,7 +52,7 @@ if (isset($_POST['add_ticket'])) { mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1"); - mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_billable = '$billable', ticket_status = '$ticket_status', ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_location_id = $location_id, ticket_asset_id = $asset_id, ticket_created_by = $session_user_id, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_client_id = $client_id, ticket_invoice_id = 0"); + mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_billable = '$billable', ticket_status = '$ticket_status', ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_vendor_id = $vendor_id, ticket_location_id = $location_id, ticket_asset_id = $asset_id, ticket_created_by = $session_user_id, ticket_assigned_to = $assigned_to, ticket_contact_id = $contact, ticket_client_id = $client_id, ticket_invoice_id = 0, ticket_project_id = $project_id"); $ticket_id = mysqli_insert_id($mysqli); @@ -153,10 +154,11 @@ if (isset($_POST['edit_ticket'])) { $vendor_id = intval($_POST['vendor']); $asset_id = intval($_POST['asset']); $location_id = intval($_POST['location']); + $project_id = intval($_POST['project']); $client_id = intval($_POST['client_id']); $ticket_number = intval($_POST['ticket_number']); - mysqli_query($mysqli, "UPDATE tickets SET ticket_subject = '$subject', ticket_priority = '$priority', ticket_billable = $billable, ticket_details = '$details', ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_contact_id = $contact_id, ticket_vendor_id = $vendor_id, ticket_location_id = $location_id, ticket_asset_id = $asset_id WHERE ticket_id = $ticket_id"); + mysqli_query($mysqli, "UPDATE tickets SET ticket_subject = '$subject', ticket_priority = '$priority', ticket_billable = $billable, ticket_details = '$details', ticket_vendor_ticket_number = '$vendor_ticket_number', ticket_contact_id = $contact_id, ticket_vendor_id = $vendor_id, ticket_location_id = $location_id, ticket_asset_id = $asset_id, ticket_project_id = $project_id WHERE ticket_id = $ticket_id"); //Logging mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Ticket', log_action = 'Modify', log_description = '$session_name modified ticket $ticket_number - $subject', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $ticket_id"); diff --git a/project_add_modal.php b/project_add_modal.php index 9a754a85..b3a52cab 100644 --- a/project_add_modal.php +++ b/project_add_modal.php @@ -33,6 +33,31 @@ + + +
+ +
+
+ +
+ +
+
+ + + diff --git a/ticket_edit_modal.php b/ticket_edit_modal.php index 19104829..6404661c 100644 --- a/ticket_edit_modal.php +++ b/ticket_edit_modal.php @@ -29,6 +29,9 @@ +
@@ -222,6 +225,31 @@ +
+ +
+ +
+
+ +
+ +
+
+ +
+ diff --git a/tickets.php b/tickets.php index 9766c06f..957baa8e 100644 --- a/tickets.php +++ b/tickets.php @@ -328,6 +328,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']); $ticket_updated_at_display = "$ticket_updated_at_time_ago
$ticket_updated_at"; } $ticket_closed_at = nullable_htmlentities($row['ticket_closed_at']); + $project_id = intval($row['ticket_project_id']); $client_id = intval($row['ticket_client_id']); $client_name = nullable_htmlentities($row['client_name']); $contact_name = nullable_htmlentities($row['contact_name']);