CHANGES_Ticket policy
This commit is contained in:
parent
938279db03
commit
020e436470
@ -96,6 +96,7 @@ class ThzController extends BaseController
|
||||
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$data['client_list'] = $this->clientModel->getCreatedByUserName();
|
||||
|
||||
return $this->loadLayout('thz_list', $data);
|
||||
}
|
||||
|
||||
@ -149,7 +150,7 @@ class ThzController extends BaseController
|
||||
|
||||
$policyIds = array_column($details, 'policy_id');
|
||||
$policyIds = array_filter($policyIds);
|
||||
$clientPolicy = $this->clientPolicyModel->whereIn('policy_id', $policyIds)->where('is_active', 1)->get()->getResultArray();
|
||||
$clientPolicy = $this->clientPolicyModel->whereIn('id', $policyIds)->where('is_active', 1)->get()->getResultArray();
|
||||
$result['client_details'] = $details;
|
||||
$result['policy_details'] = empty($clientPolicy) ? [] : $clientPolicy ;
|
||||
|
||||
@ -195,14 +196,19 @@ class ThzController extends BaseController
|
||||
if ($returnType === 'api') {
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
|
||||
}else{
|
||||
$toGetRelated = $result['master'][0]['created_by'];
|
||||
$toGetCreatedBy = $result['master'][0]['created_by'];
|
||||
$toGetPolicyId = (!empty($result['master'][0]['policy_id']) && strtolower($result['master'][0]['policy_id']) !== 'null')
|
||||
? $result['master'][0]['policy_id']
|
||||
: '';
|
||||
|
||||
$result['related_tickets'] = $this->thzMasterModel
|
||||
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
|
||||
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
|
||||
->where('thz_master.created_by', $toGetRelated)
|
||||
->where('thz_master.created_by', $toGetCreatedBy)
|
||||
->findAll();
|
||||
$result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
|
||||
// 2,3,4 remain person varannum.
|
||||
$result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : '';
|
||||
return $this->loadLayout('thz_notes', $result);
|
||||
}
|
||||
|
||||
@ -449,6 +455,23 @@ class ThzController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
public function getPolicyTerms($client_policy_id)
|
||||
{
|
||||
$policy_data = $this->clientPolicyModel->where('is_active', 1)->where('id', $client_policy_id)->first();
|
||||
|
||||
$policy_terms = [];
|
||||
if(isset($policy_data['policy_terms']) && !empty($policy_data['policy_terms'])){
|
||||
|
||||
$raw_terms = json_decode($policy_data['policy_terms'] ?? [] , true) ?? [];
|
||||
|
||||
$ticketController = new TicketController();
|
||||
$policy_terms = $ticketController->convertTermsToDisplay($raw_terms);
|
||||
}
|
||||
|
||||
$data['policy_terms'] = $policy_terms;
|
||||
return view('view_policy_terms', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -498,14 +498,14 @@ td .text-muted {
|
||||
let opt = document.createElement("option");
|
||||
opt.value = p.policy_no;
|
||||
opt.text = p.policy_no;
|
||||
opt.setAttribute("data-id", p.policy_id);
|
||||
opt.setAttribute("data-id", p.id);
|
||||
policySelect.appendChild(opt);
|
||||
});
|
||||
|
||||
// If you want to auto-select the first real policy instead of "Select Policy"
|
||||
policySelect.value = policies[0].policy_no;
|
||||
document.getElementById('policy_no').value = policies[0].policy_no || "";
|
||||
document.getElementById('policy_id').value = policies[0].policy_id;
|
||||
document.getElementById('policy_id').value = policies[0].id;
|
||||
}
|
||||
} else {
|
||||
toastr.warning(response.message || "No details found.", 'warning');
|
||||
|
||||
@ -126,10 +126,19 @@
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Policy Number</div>
|
||||
<div class="col-7 text-end"><?= (!empty($master[0]['policy_no']) && strtolower($master[0]['policy_no']) !== 'null')
|
||||
? $master[0]['policy_no']
|
||||
: 'N/A'; ?>
|
||||
</div>
|
||||
<div class="col-7 text-end">
|
||||
<?= (!empty($master[0]['policy_no']) && strtolower($master[0]['policy_no']) !== 'null')
|
||||
? '<u class="text-warning">
|
||||
<a href="javascript:void(0);"
|
||||
class="text-warning"
|
||||
data-toggle="modal"
|
||||
data-target="#PolicyModal"
|
||||
data-id="'.$master[0]['policy_id'].'">'
|
||||
.$master[0]['policy_no'].'
|
||||
</a>
|
||||
</u>'
|
||||
: 'N/A'; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-5">Assigned To</div>
|
||||
@ -207,7 +216,7 @@
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 100%;">
|
||||
<p class="text-center"><i>No Data Found</i></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -336,6 +345,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="PolicyModal" 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">Policy Terms</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body card-scroll" style="padding-top:5px!important;">
|
||||
<?php if(!empty($policy_terms)):
|
||||
echo $policy_terms;
|
||||
else: ?>
|
||||
<div class="d-flex justify-content-center align-items-center" style="height: 100%;">
|
||||
<p class="text-center"><i>No Data Found</i></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user