Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2025-02-25 18:15:29 +05:30
commit 300eaf806d
2 changed files with 492 additions and 443 deletions

View File

@ -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 {

View File

@ -77,7 +77,16 @@ table.dataTable tbody td {
<?php if (isset($ticket_data)) { ?>
<?php foreach ($ticket_data as $index => $row) { ?>
<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 $trigger_type[$row['trigger_type']] ?? ""; ?></td>
<td><?= $row['is_auto_mail'] == 1 ? 'Auto' : "Manual" ?></td>
@ -171,6 +180,12 @@ table.dataTable tbody td {
</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 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;">
<option value="">PlaceHolders</option>
<?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 $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
<?php // if($value == 'member_name' || $value == 'member_mobile' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){
?>member_mobile
<?php $valueChange = str_replace('_', ' ', $value);
$valueChange = ucwords($valueChange); ?>
<option value="<?php echo $key; ?>"><?php echo $valueChange; ?></option>
</option>
<?php //} ?>
<?php //}
?>
<?php endforeach; ?>
</select>
</div>
@ -216,7 +234,11 @@ table.dataTable tbody td {
</div><!-- /.modal -->
<!-------------------------------------------------------------------------------------------------->
<script>
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script>
// Datatable document ready
$(document).ready(function() {
@ -481,6 +503,7 @@ function getMailTemplateData(id) {
$('#primaryKey').val(res.data.id);
$('#policy_type').val(res.data.ticket_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);
// Set the auto mail switch