FEAT_CLAIM_STATUS_FOR_MAIL_TEMPLATE
This commit is contained in:
parent
d9bd488f2a
commit
93fc0a2307
@ -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 {
|
||||||
|
|||||||
@ -1,31 +1,31 @@
|
|||||||
<style>
|
<style>
|
||||||
.table th,
|
.table th,
|
||||||
.table td {
|
.table td {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.dataTable tbody td {
|
table.dataTable tbody td {
|
||||||
padding: 4px 4px !important;
|
padding: 4px 4px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col-12 {
|
.col-12 {
|
||||||
|
|
||||||
max-width: 98% !important;
|
max-width: 98% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dataTables_filter {
|
.dataTables_filter {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-align-input {
|
.right-align-input {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.addbtnStyle {
|
.addbtnStyle {
|
||||||
margin-left: 20px !important;
|
margin-left: 20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-dropdown-menu {
|
.custom-dropdown-menu {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: #ffffff !important;
|
background-color: #ffffff !important;
|
||||||
@ -35,22 +35,22 @@ table.dataTable tbody td {
|
|||||||
min-width: 10rem;
|
min-width: 10rem;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-dropdown-menu .dropdown-item {
|
.custom-dropdown-menu .dropdown-item {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
padding: 0.5rem 1rem !important;
|
padding: 0.5rem 1rem !important;
|
||||||
color: #212529 !important;
|
color: #212529 !important;
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-dropdown-menu .dropdown-item:hover {
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
background-color: #f8f9fa !important;
|
background-color: #f8f9fa !important;
|
||||||
color: #16181b !important;
|
color: #16181b !important;
|
||||||
cursor: pointer !important;
|
cursor: pointer !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@ -75,12 +75,21 @@ table.dataTable tbody td {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?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'] ?? ""; ?>
|
||||||
|
<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>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
<a href="javascript: void(0);"
|
<a href="javascript: void(0);"
|
||||||
@ -88,9 +97,9 @@ table.dataTable tbody td {
|
|||||||
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a class="dropdown-item" href="#"
|
<a class="dropdown-item" href="#"
|
||||||
onclick="getMailTemplateData(<?=$row['id']?>)"><i
|
onclick="getMailTemplateData(<?= $row['id'] ?>)"><i
|
||||||
class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a class="dropdown-item" onclick="deleteTemplate(<?=$row['id']?>)"><i
|
<a class="dropdown-item" onclick="deleteTemplate(<?= $row['id'] ?>)"><i
|
||||||
class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -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,10 +234,14 @@ table.dataTable tbody td {
|
|||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
<!-------------------------------------------------------------------------------------------------->
|
<!-------------------------------------------------------------------------------------------------->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Datatable document ready
|
$(document).ready(function() {
|
||||||
$(document).ready(function() {
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// Datatable document ready
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
var ticketsTable = $('#scroll-horizontal-datatable');
|
var ticketsTable = $('#scroll-horizontal-datatable');
|
||||||
|
|
||||||
@ -259,7 +281,7 @@ $(document).ready(function() {
|
|||||||
minHeight: 400,
|
minHeight: 400,
|
||||||
extraButtons: [{
|
extraButtons: [{
|
||||||
name: 'info',
|
name: 'info',
|
||||||
iconURL: '<?= base_url()."public"; ?>/assets/images/image-solid.svg', // Replace with the actual icon URL
|
iconURL: '<?= base_url() . "public"; ?>/assets/images/image-solid.svg', // Replace with the actual icon URL
|
||||||
exec: function(editor) {
|
exec: function(editor) {
|
||||||
const fileInput = document.getElementById("Question_title_fileInput");
|
const fileInput = document.getElementById("Question_title_fileInput");
|
||||||
fileInput.click();
|
fileInput.click();
|
||||||
@ -400,14 +422,14 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function openModal() {
|
function openModal() {
|
||||||
var myModal = new bootstrap.Modal(document.getElementById('new_mail_template'));
|
var myModal = new bootstrap.Modal(document.getElementById('new_mail_template'));
|
||||||
myModal.show();
|
myModal.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteTemplate(id) {
|
function deleteTemplate(id) {
|
||||||
const url = '<?= base_url("ticket/crud_mail_template/3") ?>';
|
const url = '<?= base_url("ticket/crud_mail_template/3") ?>';
|
||||||
const data = {
|
const data = {
|
||||||
id: id
|
id: id
|
||||||
@ -452,9 +474,9 @@ function deleteTemplate(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMailTemplateData(id) {
|
function getMailTemplateData(id) {
|
||||||
const template_name = 'new_mail_template';
|
const template_name = 'new_mail_template';
|
||||||
$('.loader').fadeIn();
|
$('.loader').fadeIn();
|
||||||
$('.loader-mask').fadeIn();
|
$('.loader-mask').fadeIn();
|
||||||
@ -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
|
||||||
@ -515,10 +538,10 @@ function getMailTemplateData(id) {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
const table = document.getElementById("scroll-horizontal-datatable");
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
|
|
||||||
// Create custom dropdown
|
// Create custom dropdown
|
||||||
@ -603,5 +626,5 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
activeDropdown = null;
|
activeDropdown = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user