From 93fc0a23075e00678802abc1a9b519f61e13a304 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Tue, 25 Feb 2025 17:02:20 +0530 Subject: [PATCH] FEAT_CLAIM_STATUS_FOR_MAIL_TEMPLATE --- app/Controllers/TicketController.php | 26 + app/Views/ticket_mail_template.php | 909 ++++++++++++++------------- 2 files changed, 492 insertions(+), 443 deletions(-) diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 60394874..36007889 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -593,6 +593,17 @@ class TicketController extends BaseController $data['policy_type'] = $this->ticketType; $data['placeHolders'] = $this->placeHolders; $data['ticket_data'] = $this->ticketMailTemplateModel->where('is_active', 1)->findAll(); + + foreach ($data['ticket_data'] as $key => $ticket_data) { + + $tooltip_array = $this->claimStatus->select('claim_status')->where('ticket_type',$data['ticket_data'][$key]['ticket_type'])->where('trigger_type',$data['ticket_data'][$key]['trigger_type'])->where('is_active',1)->first(); + if (isset($tooltip_array) && $tooltip_array != null){ + $data['ticket_data'][$key]['tool_tip'] = $tooltip_array['claim_status']; + }else{ + $data['ticket_data'][$key]['tool_tip'] =$data['ticket_data'][$key]['template_name']; + } + } + // dd($data['ticket_data']); $data['ticket_type'] = $this->ticketType; $data['trigger_type'] = $this->triggerType; return $this->loadLayout('ticket_mail_template', $data); @@ -621,6 +632,21 @@ class TicketController extends BaseController } elseif ($action == 2) { $table_id = (int)$this->request->getPost('id'); $data = $this->ticketMailTemplateModel->where('id', $table_id)->where('is_active', 1)->first(); + if ($data && isset($data['ticket_type']) && isset($data['trigger_type'])) { + $tooltip_array = $this->claimStatus->select('claim_status') + ->where('ticket_type', $data['ticket_type']) + ->where('trigger_type', $data['trigger_type']) + ->where('is_active', 1) + ->first(); + + $data['tool_tip'] = (isset($tooltip_array['claim_status'])) + ? $tooltip_array['claim_status'] + : $data['template_name']; + } else { + // Handle case where $data is null or missing required fields + $data = $data ?: []; // Ensure $data is an array if null + $data['tool_tip'] = $data['template_name']; + } if ($data) { return $this->respond(['status' => true, 'data' => $data], 200); } else { diff --git a/app/Views/ticket_mail_template.php b/app/Views/ticket_mail_template.php index 511cf300..213312b4 100644 --- a/app/Views/ticket_mail_template.php +++ b/app/Views/ticket_mail_template.php @@ -1,56 +1,56 @@
@@ -75,28 +75,37 @@ table.dataTable tbody td { - $row){ ?> - - - - - - - - - - + $row) { ?> + +   + + + + + + + + + + + + @@ -135,11 +144,11 @@ table.dataTable tbody td {
@@ -149,11 +158,11 @@ table.dataTable tbody td { @@ -171,6 +180,12 @@ table.dataTable tbody td { +
+ + +
+ +
@@ -191,12 +206,15 @@ table.dataTable tbody td {
@@ -216,392 +234,397 @@ table.dataTable tbody td { - + \ No newline at end of file