Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
4d9776ec3c
@ -102,7 +102,7 @@ class ThzController extends BaseController
|
||||
public function ticketList()
|
||||
{
|
||||
|
||||
try {
|
||||
// try {
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
|
||||
|
||||
@ -112,6 +112,9 @@ class ThzController extends BaseController
|
||||
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
|
||||
}
|
||||
|
||||
if ($returnType === 'web' && in_array(get_role_id(), [3])) {
|
||||
$data['clientIds'] = $this->clientModel->getClientIdBasedonLoggedInSessionID();
|
||||
}
|
||||
|
||||
$tickets = $this->fetchTicketsBasedOnrole($data);
|
||||
|
||||
@ -124,8 +127,9 @@ class ThzController extends BaseController
|
||||
} else {
|
||||
$data['ticket_data'] = $tickets;
|
||||
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['3', '4'])->findAll();
|
||||
// enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu , 2-"manager l2 " - ivangalum assign pannalam
|
||||
// 3,4 remain person varannum.
|
||||
// enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu , 2-"manager l2 " - ivangalum assign pannalam. 3,4 remain person varannum dropdown la.
|
||||
// Roles - 5 (Head) , 1 (Admin) and 2 (Manager) are already assigned to others, so the dropdown should not be shown.
|
||||
// 3 (Account Manager) and 4 (Staff) should be selectable, so have to show in dropdown .
|
||||
$data['client_list'] = $this->clientModel->getCreatedByUserName();
|
||||
$data['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
|
||||
$data['tab_name'] = "Tickets";
|
||||
@ -138,9 +142,9 @@ class ThzController extends BaseController
|
||||
'status' => 'success',
|
||||
'data' => $tickets,
|
||||
])->setStatusCode(200);
|
||||
} catch (\Throwable $e) {
|
||||
return handle_exception($e, $this->myLogger, $this->response);
|
||||
}
|
||||
// } catch (\Throwable $e) {
|
||||
// return handle_exception($e, $this->myLogger, $this->response);
|
||||
// }
|
||||
}
|
||||
|
||||
public function ticketConversationSave()
|
||||
@ -348,6 +352,7 @@ class ThzController extends BaseController
|
||||
// $id = $data['thz_id'] ?? null;
|
||||
$assign_to = $data['assign_to'] ?? null;
|
||||
$mobile = $data['mobile'] ?? null;
|
||||
$clientIds = $data['clientIds'] ?? null;
|
||||
|
||||
if (!empty($assign_to)) {
|
||||
// Tickets assigned to a staff
|
||||
@ -371,6 +376,17 @@ class ThzController extends BaseController
|
||||
->findAll();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($clientIds)) {
|
||||
return $this->thzMasterModel
|
||||
->select('thz_master.*, user_profiles.first_name as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->whereIn('thz_master.client_id', $clientIds)
|
||||
->orderBy('thz_master.created_at', 'desc')
|
||||
->findAll();
|
||||
}
|
||||
|
||||
|
||||
// All tickets (e.g., for managers)
|
||||
return $this->thzMasterModel
|
||||
->select('thz_master.*, user_profiles.first_name as assignee_name')
|
||||
|
||||
@ -239,5 +239,24 @@ class ClientModel extends Model
|
||||
|
||||
return $builder->getNumRows() > 0 ? true : false;
|
||||
}
|
||||
|
||||
|
||||
public function getClientIdBasedonLoggedInSessionID()
|
||||
{
|
||||
$user_id = get_session_userid();
|
||||
$builder = $this->db->table('client_rm rm')
|
||||
->select('c.id AS client_id')
|
||||
->join('clients c', 'c.id = rm.client_id', 'inner')
|
||||
->where('rm.is_active', 1)
|
||||
->where('c.is_active', 1)
|
||||
->where('rm.user_id', $user_id)
|
||||
->get();
|
||||
$result = $builder->getResultArray();
|
||||
|
||||
$clientIds = !empty($result) ? array_column($result, 'client_id') : [];
|
||||
// print_r($clientIds);die;
|
||||
return $clientIds;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -370,7 +370,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 approved" style="display: none;">
|
||||
<label class="label-font-size" for="approved_amount">Approved Amount</label> #
|
||||
<label class="label-font-size" for="approved_amount">Approved Amount</label> <span style="display:none"># REF : SVR</span>
|
||||
<input type="text" class="form-control" id="approved_amount" placeholder="Enter Approved Amount"
|
||||
value="<?= isset($ticket_data['approved_amount']) ? $ticket_data['approved_amount'] : '' ?>" name="approved_amount"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '');">
|
||||
@ -566,11 +566,11 @@
|
||||
allowInput: false
|
||||
});
|
||||
|
||||
// updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
||||
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
|
||||
GlobelExtraFields = extraFields;
|
||||
console.log("extraFields", extraFields);
|
||||
claimStatusFieldChanges(extraFields);
|
||||
updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -211,14 +211,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="modal-footer">
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-primary" data-dismiss="modal" aria-label="Close"
|
||||
onclick="toResetTheModelFields()">Submit</a>
|
||||
</div> -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user