diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 6dce2803..0141ef61 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -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); diff --git a/app/Models/ThzMasterNotesModel.php b/app/Models/ThzMasterNotesModel.php index d2a7191f..413781df 100644 --- a/app/Models/ThzMasterNotesModel.php +++ b/app/Models/ThzMasterNotesModel.php @@ -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; diff --git a/app/Views/thz_list.php b/app/Views/thz_list.php index eb16be9b..0decca6b 100644 --- a/app/Views/thz_list.php +++ b/app/Views/thz_list.php @@ -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; diff --git a/app/Views/thz_notes.php b/app/Views/thz_notes.php index 7cc9747a..c1134d52 100644 --- a/app/Views/thz_notes.php +++ b/app/Views/thz_notes.php @@ -175,8 +175,11 @@
= $conv['notes'] ?>
- + + + = $conv['notes_type'] ?>