From ee5ae53a4158bfeb2d32762e2a7729d1277a319a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 7 Jan 2022 18:20:16 -0500 Subject: [PATCH] Updated ticket details layout and added some additional functionality thanks to @aftechro --- post.php | 18 +++++++ ticket.php | 156 +++++++++++++++++++++++++++++++++-------------------- 2 files changed, 117 insertions(+), 57 deletions(-) diff --git a/post.php b/post.php index 9c9bff2f..2c4a076a 100644 --- a/post.php +++ b/post.php @@ -4884,6 +4884,24 @@ if(isset($_POST['edit_ticket'])){ } +if(isset($_POST['assign_ticket'])){ + + $ticket_id = intval($_POST['ticket_id']); + $assigned_to = intval($_POST['assigned_to']); + + mysqli_query($mysqli,"UPDATE tickets SET ticket_updated_at = NOW(), ticket_assigned_to = $assigned_to WHERE ticket_id = $ticket_id AND company_id = $session_company_id"); + + mysqli_query($mysqli,"INSERT INTO ticket_replies SET ticket_reply = 'Ticket re-assigned', ticket_reply_created_at = NOW(), ticket_reply_by = $session_user_id, ticket_reply_ticket_id = $ticket_id, company_id = $session_company_id") or die(mysqli_error($mysqli)); + + //Logging + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Modified', log_description = '$subject', log_created_at = NOW(), company_id = $session_company_id, log_user_id = $session_user_id"); + + $_SESSION['alert_message'] = "Ticket re-assigned"; + + header("Location: " . $_SERVER["HTTP_REFERER"]); + +} + if(isset($_GET['delete_ticket'])){ $ticket_id = intval($_GET['delete_ticket']); diff --git a/ticket.php b/ticket.php index a61cf602..7875460d 100644 --- a/ticket.php +++ b/ticket.php @@ -90,6 +90,12 @@ if(isset($_GET['ticket_id'])){ $ticket_assigned_to_display = $row['user_name']; } + if($contact_id == $primary_contact){ + $primary_contact_display = "Primary Contact"; + }else{ + $primary_contact_display = "Needs approval"; + } + ?> @@ -135,59 +141,6 @@ if(isset($_GET['ticket_id'])){ -
- -
- -
-
-
-
-
-
- -
- -
-
-
- - - -
-
-
- - -
-
-
- - - -
- -
- - - - - -
- -
- + +
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+ + + +
+
+
+ + +
+
+
+ + + +
+ +
+ +
+ +
@@ -262,7 +258,7 @@ if(isset($_GET['ticket_id'])){

Client

- +
@@ -273,8 +269,10 @@ if(isset($_GET['ticket_id'])){

Contact

- +
+ +
@@ -319,7 +317,7 @@ if(isset($_GET['ticket_id'])){

Asset

- +
-

Details

@@ -359,6 +356,51 @@ if(isset($_GET['ticket_id'])){
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+ + + +
+ +
+ + +