diff --git a/app/Controllers/TicketController.php b/app/Controllers/TicketController.php index 55672be7..f98e0192 100644 --- a/app/Controllers/TicketController.php +++ b/app/Controllers/TicketController.php @@ -609,6 +609,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); @@ -637,6 +648,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 @@