BUG_fix in ticket
This commit is contained in:
parent
5f95fa8399
commit
659b6fd122
@ -181,7 +181,7 @@ class ThzController extends BaseController
|
||||
->findAll();
|
||||
|
||||
if(!empty($result['master'])){
|
||||
$notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $ticketType );
|
||||
$notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $returnType );
|
||||
$result['notes'] = !empty($notes) ? $notes : [];
|
||||
}else{
|
||||
return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(400);
|
||||
|
||||
@ -76,17 +76,14 @@ class ThzMasterNotesModel extends Model
|
||||
|
||||
}
|
||||
|
||||
public function ticketConversationList($thz_id , $ticketType)
|
||||
public function ticketConversationList($thz_id , $returnType)
|
||||
{
|
||||
$ticketTypeFilter = "";
|
||||
|
||||
if ($ticketType == 'External') {
|
||||
if ($returnType == 'api') {
|
||||
//user only see his message
|
||||
$ticketTypeFilter = "AND thz_master_notes.notes_type = 'External' ";
|
||||
} elseif ($ticketType == 'Internal') {
|
||||
// internal team needs to see both the tickets
|
||||
$ticketTypeFilter = "AND ( thz_master_notes.notes_type = 'External' OR thz_master_notes.notes_type = 'Internal' ) ";
|
||||
}
|
||||
}
|
||||
|
||||
$integer_ticket_id = (int)$thz_id;
|
||||
|
||||
|
||||
@ -601,7 +601,7 @@ function viewTicket(ticket_id){
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
|
||||
let url = '<?= base_url('ticketConversationList?return_type=web¬es_ticket_type=Internal&thz_id='); ?>' + ticket_id;
|
||||
let url = '<?= base_url('ticketConversationList?return_type=web&thz_id='); ?>' + ticket_id;
|
||||
window.location.href = url;
|
||||
|
||||
|
||||
|
||||
@ -175,8 +175,11 @@
|
||||
<!-- Top Row: Message + Badge -->
|
||||
<div class="d-flex justify-content-between align-items-start">
|
||||
<p class="mb-1 mr-4"><?= $conv['notes'] ?></p>
|
||||
<?php if(!empty($conv['notes_by'])): ?>
|
||||
<!-- <?php if(!empty($conv['notes_by'])): ?>
|
||||
<span class="badge bg-warning text-dark"><?= $conv['notes_by'] ?></span>
|
||||
<?php endif; ?> -->
|
||||
<?php if (!empty($conv['notes_type']) && $conv['notes_type'] === "Internal"): ?>
|
||||
<span class="badge bg-warning text-dark"><?= $conv['notes_type'] ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@ -368,7 +371,7 @@
|
||||
toastr.success(response.message, 'success');
|
||||
$('#ticketModal').modal('hide');
|
||||
form.reset();
|
||||
window.location.href = "<?= base_url('ticketConversationList?return_type=web¬es_ticket_type=Internal&thz_id=') ?>" + id;
|
||||
window.location.href = "<?= base_url('ticketConversationList?return_type=web&thz_id=') ?>" + id;
|
||||
} else {
|
||||
toastr.error(response.message, 'error');
|
||||
}
|
||||
@ -400,7 +403,7 @@
|
||||
if (response.status === "success") {
|
||||
toastr.success(response.message, 'success');
|
||||
form.reset();
|
||||
window.location.href = "<?= base_url('ticketConversationList?return_type=web¬es_ticket_type=Internal&thz_id=') ?>" + id;
|
||||
window.location.href = "<?= base_url('ticketConversationList?return_type=web&thz_id=') ?>" + id;
|
||||
} else {
|
||||
toastr.error(response.message, 'error');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user