FEAT_CLAIM_STATUS_FOR_MAIL_TEMPLATE

This commit is contained in:
Srinivas-Saravanan 2025-02-25 17:02:20 +05:30
parent d9bd488f2a
commit 93fc0a2307
2 changed files with 492 additions and 443 deletions

View File

@ -593,6 +593,17 @@ class TicketController extends BaseController
$data['policy_type'] = $this->ticketType; $data['policy_type'] = $this->ticketType;
$data['placeHolders'] = $this->placeHolders; $data['placeHolders'] = $this->placeHolders;
$data['ticket_data'] = $this->ticketMailTemplateModel->where('is_active', 1)->findAll(); $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['ticket_type'] = $this->ticketType;
$data['trigger_type'] = $this->triggerType; $data['trigger_type'] = $this->triggerType;
return $this->loadLayout('ticket_mail_template', $data); return $this->loadLayout('ticket_mail_template', $data);
@ -621,6 +632,21 @@ class TicketController extends BaseController
} elseif ($action == 2) { } elseif ($action == 2) {
$table_id = (int)$this->request->getPost('id'); $table_id = (int)$this->request->getPost('id');
$data = $this->ticketMailTemplateModel->where('id', $table_id)->where('is_active', 1)->first(); $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) { if ($data) {
return $this->respond(['status' => true, 'data' => $data], 200); return $this->respond(['status' => true, 'data' => $data], 200);
} else { } else {

View File

@ -77,7 +77,16 @@ table.dataTable tbody td {
<?php if (isset($ticket_data)) { ?> <?php if (isset($ticket_data)) { ?>
<?php foreach ($ticket_data as $index => $row) { ?> <?php foreach ($ticket_data as $index => $row) { ?>
<tr> <tr>
<td><?php echo $row['template_name'] ?? ""; ?></td> <td> <?php echo $row['template_name'] ?? ""; ?> &nbsp;
<i class="fe-alert-circle"
style="color: #000;"
aria-hidden="true"
data-toggle="tooltip"
data-placement="top"
title="<?php echo ($row['tool_tip'] ?? ''); ?>"></i>
</td>
<td><?php echo $ticket_type[$row['ticket_type']] ?? ""; ?></td> <td><?php echo $ticket_type[$row['ticket_type']] ?? ""; ?></td>
<td><?php echo $trigger_type[$row['trigger_type']] ?? ""; ?></td> <td><?php echo $trigger_type[$row['trigger_type']] ?? ""; ?></td>
<td><?= $row['is_auto_mail'] == 1 ? 'Auto' : "Manual" ?></td> <td><?= $row['is_auto_mail'] == 1 ? 'Auto' : "Manual" ?></td>
@ -171,6 +180,12 @@ table.dataTable tbody td {
</div> </div>
<div class="form-group col-md-6">
<label for="claim_status_for_template">Claim Status</label>
<input type="text" readonly id="claim_status_for_template" class="form-control" />
</div>
</div> </div>
<div class="form-row"> <div class="form-row">
@ -192,11 +207,14 @@ table.dataTable tbody td {
style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;"> style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
<option value="">PlaceHolders</option> <option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $key => $value): ?> <?php foreach ($placeHolders as $key => $value): ?>
<?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>member_mobile <?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?> ?>member_mobile
<?php $valueChange = str_replace('_', ' ', $value);
$valueChange = ucwords($valueChange); ?>
<option value="<?php echo $key; ?>"><?php echo $valueChange; ?></option> <option value="<?php echo $key; ?>"><?php echo $valueChange; ?></option>
</option> </option>
<?php //} ?> <?php //}
?>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
</div> </div>
@ -216,7 +234,11 @@ table.dataTable tbody td {
</div><!-- /.modal --> </div><!-- /.modal -->
<!--------------------------------------------------------------------------------------------------> <!-------------------------------------------------------------------------------------------------->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script> <script>
// Datatable document ready // Datatable document ready
$(document).ready(function() { $(document).ready(function() {
@ -481,6 +503,7 @@ function getMailTemplateData(id) {
$('#primaryKey').val(res.data.id); $('#primaryKey').val(res.data.id);
$('#policy_type').val(res.data.ticket_type).change(); $('#policy_type').val(res.data.ticket_type).change();
$('#trigger_type').val(res.data.trigger_type).change(); $('#trigger_type').val(res.data.trigger_type).change();
$('#claim_status_for_template').val(res.data.tool_tip);
$('.jodit-wysiwyg').html(res.data.mail_content); $('.jodit-wysiwyg').html(res.data.mail_content);
// Set the auto mail switch // Set the auto mail switch