Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
e18870a97c
@ -81,6 +81,9 @@ class ThzController extends BaseController
|
||||
|
||||
|
||||
$data = $this->request->getGet();
|
||||
if ($returnType === 'web' && in_array(get_role_id(), [2,3,4])) {
|
||||
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
|
||||
}
|
||||
|
||||
$tickets = $this->fetchTicketsBasedOnrole($data);
|
||||
|
||||
|
||||
@ -529,8 +529,9 @@ rgba(0, 153, 158, 0.5) (transparent)
|
||||
background-color: #ECECEC !important;
|
||||
}
|
||||
|
||||
.app-font-family {
|
||||
font-family: 'Poppins' !important;
|
||||
.app-font-family,
|
||||
.app-font-family *:not(.mdi):not(.fa):not(.material-icons) {
|
||||
font-family: 'Poppins' !important;
|
||||
}
|
||||
|
||||
.app-title { font-size: 18px; }
|
||||
|
||||
@ -254,13 +254,13 @@ table thead th {
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap text-custom-black text-custom app-font-family">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ticket No</th>
|
||||
<th>Name</th>
|
||||
<th>Ticket ID</th>
|
||||
<th class="app-text-left">Name</th>
|
||||
<th>Policy Number</th>
|
||||
<th>Ticket Type</th>
|
||||
<th>Subject</th>
|
||||
<th>Status</th>
|
||||
<th>Assign To</th>
|
||||
<th class="app-text-left">Assign To</th>
|
||||
<th>Created At</th>
|
||||
<th>Updated At</th>
|
||||
</tr>
|
||||
@ -294,14 +294,14 @@ table thead th {
|
||||
<td class="app-text-left">
|
||||
<?php if (!empty($row['created_at'])):
|
||||
$cdt = new DateTime($row['created_at']);
|
||||
echo $cdt->format('d/m/Y') . "<br><span class='time'>" . $cdt->format('h:i a') . "</span>";
|
||||
echo $cdt->format('d/m/Y') . "<br><span class='time'> " . $cdt->format('h:i a') . "</span>";
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
<td class="app-text-left">
|
||||
<?php if (!empty($row['updated_at'])):
|
||||
$udt = new DateTime($row['updated_at']);
|
||||
echo $udt->format('d/m/Y') . "<br><span class='time'>" . $udt->format('h:i a') . "</span>";
|
||||
echo $udt->format('d/m/Y') . "<br><span class='time'> " . $udt->format('h:i a') . "</span>";
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
@ -318,7 +318,7 @@ table thead th {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="ticketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade app-font-family" id="ticketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" style="margin:5px auto!important;">
|
||||
<div class="modal-content">
|
||||
<form id="ticketForm">
|
||||
@ -330,7 +330,7 @@ table thead th {
|
||||
|
||||
<!-- first row -->
|
||||
<div class="d-flex w-100 justify-content-between align-items-center">
|
||||
<h4 class="modal-title app-font-family mb-0" id="modalLabel">New Ticket</h4>
|
||||
<h4 class="modal-title app-font-family mb-0" id="modalLabel" style="font-size:27px !important">New Ticket</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
@ -436,13 +436,15 @@ table thead th {
|
||||
|
||||
<div class="form-group col-md-12 app-font-family">
|
||||
<label for="subject">Subject<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject" required>
|
||||
<input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject" required maxlength="150">
|
||||
<small id="subjectCounter" class="form-text text-muted app-text-right">0/150</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 app-font-family">
|
||||
<label for="message">Message<span class="text-danger">*</span></label>
|
||||
<!-- <input type="text" class="form-control" id="message" name="message" placeholder="Enter Message"> -->
|
||||
<textarea class="form-control" id="message" name="message" placeholder="Enter Message" rows="4" required></textarea>
|
||||
<textarea class="form-control" id="message" name="message" placeholder="Enter Message" rows="4" required maxlength="1500"></textarea>
|
||||
<small id="messageCounter" class="form-text text-muted text-end app-text-right">0/1500</small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -457,7 +459,7 @@ table thead th {
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="AssignModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade app-font-family" id="AssignModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -714,7 +716,7 @@ $(document).ready(function() {
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
buttons: [
|
||||
{
|
||||
text: '<i class="mdi mdi-plus app-text-white" ></i><span class="app-text-white"> Create New Ticket </span>',
|
||||
text: '<i class="mdi mdi-plus app-text-white" ></i><span class="app-text-white app-font-family btn-custom"> Create New Ticket </span>',
|
||||
className: 'btn app-btn-primary app-btn-border-radius app-text-white mr-2',
|
||||
action: function(e, dt, node, config) {
|
||||
openTicket();
|
||||
@ -722,22 +724,24 @@ $(document).ready(function() {
|
||||
},
|
||||
{
|
||||
extend: 'collection',
|
||||
text: '<span class="app-text-white"> Export </span><i class="mdi mdi-menu-down app-text-white"></i>',
|
||||
text: '<span class="app-text-white app-font-family btn-custom"> Export </span><i class="mdi mdi-menu-down app-text-white"></i>',
|
||||
className: 'btn app-btn-secondary app-btn-border-radius app-text-white',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'ticket-List'
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: ' Excel',
|
||||
title: 'ticket-List',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
}
|
||||
}
|
||||
{
|
||||
extend: 'csv',
|
||||
text: '<i class="mdi mdi-file-delimited app-text-white" ></i><span class="app-text-white app-font-family btn-custom"> CSV </span>',
|
||||
title: 'Tickets',
|
||||
className: 'app-btn-primary app-text-white',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: '<i class="mdi mdi-file-excel app-text-white" ></i><span class="app-text-white app-font-family btn-custom"> EXCEL </span>',
|
||||
title: 'Tickets',
|
||||
exportOptions: {
|
||||
orthogonal: 'sort'
|
||||
},
|
||||
className: 'app-btn-primary app-text-white',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -757,6 +761,39 @@ $(document).ready(function() {
|
||||
} else {
|
||||
console.error("Table Not found.");
|
||||
}
|
||||
|
||||
const subjectInput = document.getElementById("subject");
|
||||
const subjectCounter = document.getElementById("subjectCounter");
|
||||
|
||||
subjectInput.addEventListener("input", function () {
|
||||
const subjectLength = subjectInput.value.length;
|
||||
subjectCounter.textContent = `${subjectLength}/150`;
|
||||
|
||||
if (subjectLength > 150) {
|
||||
toastr.error('Subject cannot exceed 150 characters', 'Warning');
|
||||
subjectInput.classList.add('is-invalid');
|
||||
} else {
|
||||
subjectInput.classList.remove('is-invalid');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const messageInput = document.getElementById("message");
|
||||
const messageCounter = document.getElementById("messageCounter");
|
||||
|
||||
messageInput.addEventListener("input", function () {
|
||||
const messageLength = messageInput.value.length;
|
||||
messageCounter.textContent = `${messageLength}/1500`;
|
||||
|
||||
if (messageLength > 1500) {
|
||||
toastr.error('Message cannot exceed 1500 characters', 'Warning');
|
||||
messageInput.classList.add('is-invalid');
|
||||
} else {
|
||||
messageInput.classList.remove('is-invalid');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function viewTicket(ticket_id){
|
||||
|
||||
@ -157,10 +157,11 @@ hr{
|
||||
<div class="row" id="notes-body">
|
||||
|
||||
<!-- Left Details -->
|
||||
<div class="col-4" id="notes-body-left">
|
||||
<div class="col-5" id="notes-body-left">
|
||||
<div class="card master-card" style="background:#F5FFFF;">
|
||||
<div class="card-header d-flex justify-content-between align-items-center" style="background:none; border:none;">
|
||||
<p class="sub-title-text app-font-family mb-0">Details</p>
|
||||
<?php if($master[0]['status'] !== "Closed") : ?>
|
||||
<a href="javascript:void(0);" onclick="openEditTicket()">
|
||||
<i class="mdi mdi-pencil edit-icon" title="Edit"></i>
|
||||
<!-- <i class="mdi mdi-pencil"
|
||||
@ -170,23 +171,24 @@ hr{
|
||||
onmouseout="this.style.color='#555'; this.style.fontSize='15px';">
|
||||
</i> -->
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="card-body card-scroll sub-title-text app-font-family" style="padding:0 27px !important; background:#F5FFFF;">
|
||||
<div class="row mb-2 ml-o">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Ticket ID</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['thz_id'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Ticket ID</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['thz_id'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Name</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['name'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Name</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['name'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Mobile</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['mobile'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Mobile</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['mobile'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Policy Number</div>
|
||||
<div class="col-7 app-text text-end app-font-family">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Policy Number</div>
|
||||
<div class="col-8 app-text text-end app-font-family" style="font-weight: 500 !important;">
|
||||
<?= (!empty($master[0]['policy_no']) && strtolower($master[0]['policy_no']) !== 'null')
|
||||
? '<u class="app-text-black">
|
||||
<a href="javascript:void(0);"
|
||||
@ -202,28 +204,28 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Assigned To</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['assignee_name'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Assigned To</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['assignee_name'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Status</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['status'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Status</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['status'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Ticket Type</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['ticket_type'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Ticket Type</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important;"><?= $master[0]['ticket_type'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Subject</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['subject'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Subject</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important; text-align: justify;"><?= $master[0]['subject'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Message</div>
|
||||
<div class="col-7 app-text app-text-black text-end app-font-family"><?= $master[0]['message'];?></div>
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Message</div>
|
||||
<div class="col-8 app-text app-text-black text-end app-font-family" style="font-weight: 500 !important; text-align: justify;"><?= $master[0]['message'];?></div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5 app-subtitle app-text-grey app-font-family">Related Tickets</div>
|
||||
<div class="col-7 app-text text-end app-font-family">
|
||||
<div class="col-4 app-subtitle app-text-grey app-font-family">Related Tickets</div>
|
||||
<div class="col-8 app-text text-end app-font-family" style="font-weight: 500 !important;">
|
||||
<u class="text-warning">
|
||||
<a href="javascript:void(0);"
|
||||
class="text-warning"
|
||||
@ -244,7 +246,7 @@ hr{
|
||||
|
||||
<!-- Right Conversation -->
|
||||
|
||||
<div class="col-8">
|
||||
<div class="col-7">
|
||||
|
||||
<!-- Conversation Card -->
|
||||
<div class="card mb-3 conversation-card">
|
||||
@ -259,7 +261,7 @@ hr{
|
||||
<hr/>
|
||||
<!-- Top Row: Message + Badge -->
|
||||
<div class="d-flex justify-content-between align-items-start app-text app-text-black app-font-family">
|
||||
<p class="mb-1 ml-0 mr-0 app-font-family"><?= $conv['notes'] ?></p>
|
||||
<p class="mb-1 ml-0 mr-0 app-font-family" style="font-weight: 400 !important;"><?= $conv['notes'] ?></p>
|
||||
<!-- <?php if(!empty($conv['notes_by'])): ?>
|
||||
<span class="badge bg-warning text-dark"><?= $conv['notes_by'] ?></span>
|
||||
<?php endif; ?> -->
|
||||
@ -270,8 +272,8 @@ hr{
|
||||
|
||||
<!-- Bottom Row: Name + Date -->
|
||||
<div class="d-flex justify-content-between small text-muted" style="padding-top: 5px;">
|
||||
<span class="app-font-family"><i class="mdi mdi-account"></i> <?= $conv['name'] ?></span>
|
||||
<span style="font-size:9px; app-font-family"><?= date("j F Y h:i a", strtotime($conv['created_at'])) ?></span>
|
||||
<span class="app-font-family" style="font-weight: 400 !important;"><i class="mdi mdi-account"></i> <?= $conv['name'] ?></span>
|
||||
<span style="font-size:9px; font-weight: 400 !important;" class="app-font-family"><?= date("j F Y h:i a", strtotime($conv['created_at'])) ?></span>
|
||||
</div>
|
||||
|
||||
<!-- <?php echo $i < count($notes)-1 ? '<hr/>' : ''; ?> -->
|
||||
@ -313,12 +315,12 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade app-text-black" id="EditModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade app-text-black app-font-family" id="EditModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form id="ticketForm">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title title-text app-font-family" id="EditModalLabel">Update</h4>
|
||||
<h4 class="modal-title title-text" id="EditModalLabel" style="font-size:27px !important">Update</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
@ -375,12 +377,12 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="relatedTicketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade app-font-family" id="relatedTicketModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content" style="border-radius:15px;">
|
||||
|
||||
<div class="modal-header" style="border-bottom-width:0;">
|
||||
<h4 class="modal-title title-text app-font-family">Related Tickets</h4>
|
||||
<h4 class="modal-title title-text app-font-family" style="font-size:27px !important">Related Tickets</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
@ -388,9 +390,9 @@ hr{
|
||||
|
||||
<?php if(!empty($related_tickets)): foreach($related_tickets as $j => $rt): ?>
|
||||
<div class="card related-ticket-card app-font-family app-text"
|
||||
style="cursor: pointer;"
|
||||
onclick="window.location='<?= base_url().'ticketConversationList?return_type=web&thz_id='.$rt['thz_id'] ?>'">
|
||||
<div class="card-body">
|
||||
style="cursor: pointer;"
|
||||
onclick="window.location='<?= base_url().'/ticketConversationList?return_type=web&thz_id='.$rt['thz_id']; ?>'">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center" style="margin-bottom: 10px !important;">
|
||||
<h5 class="app-font-family app-text"><?php echo '# '.$rt['thz_id']." / ".$rt['ticket_type']; ?></h5>
|
||||
<small classs="app-font-family" style="font-size:7px;">
|
||||
@ -420,7 +422,7 @@ hr{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="PolicyModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade app-font-family" id="PolicyModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content" style="border-radius:15px;">
|
||||
|
||||
@ -549,19 +551,4 @@ hr{
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
// attach click event to the div
|
||||
$(document).on('click', '.related-ticket-card', function(){
|
||||
|
||||
let relatedId = $(this).data('related-ticket-id');
|
||||
console.log("Related Ticket ID:", relatedId);
|
||||
|
||||
window.open("<?php echo base_url('/ticketConversationList?return_type=web&thz_id=')?>"+relatedId,"_blank");
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user