MERGE_TEST_OPPORTUNITIES
This commit is contained in:
commit
dfe90153e9
@ -2288,6 +2288,8 @@ class LeadsController extends BaseController
|
||||
// 'Insurer' => $rfq_data['insurer_name'] ?? " - ",
|
||||
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
|
||||
'Mortality Experience for last 3 years' => $claim_history == "1" ? "Mentioned in Claims sheet" : "Nil",
|
||||
|
||||
];
|
||||
}else {
|
||||
|
||||
|
||||
@ -968,6 +968,58 @@ class TicketController extends BaseController
|
||||
return $extra_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overlay conditional `required` rules onto a base validation rule-set based on the
|
||||
* submitted `claim_status_id`. For example, when claim_status_id is a "Settled" status
|
||||
* (11/24/34/44), fields like `utr_details` and `settled_date` are promoted from
|
||||
* `permit_empty` to `required` so the request is rejected when they are blank.
|
||||
*
|
||||
* Letter URL fields (`approved_letter`, `settle_letter`) accept an alternative PDF
|
||||
* upload, so they are intentionally not promoted here; that pairing is enforced by
|
||||
* the upload validation flow. `approved_description` stays optional to match the
|
||||
* existing UI contract.
|
||||
*/
|
||||
private function applyClaimStatusConditionalRules(array $rules): array
|
||||
{
|
||||
$claimStatusId = (int) $this->request->getPost('claim_status_id');
|
||||
if ($claimStatusId <= 0) {
|
||||
return $rules;
|
||||
}
|
||||
|
||||
if (!isset($this->extraFields[$claimStatusId]) || !is_array($this->extraFields[$claimStatusId])) {
|
||||
return $rules;
|
||||
}
|
||||
|
||||
$requiredFields = $this->extraFields[$claimStatusId];
|
||||
$skipFields = ['approved_letter', 'settle_letter', 'approved_description'];
|
||||
|
||||
foreach ($requiredFields as $field) {
|
||||
if (in_array($field, $skipFields, true) || !isset($rules[$field])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$existingRules = $rules[$field]['rules'] ?? '';
|
||||
$parts = $existingRules === ''
|
||||
? []
|
||||
: array_values(array_filter(array_map('trim', explode('|', $existingRules)), function ($part) {
|
||||
return $part !== '' && $part !== 'permit_empty';
|
||||
}));
|
||||
|
||||
if (!in_array('required', $parts, true)) {
|
||||
array_unshift($parts, 'required');
|
||||
}
|
||||
$rules[$field]['rules'] = implode('|', array_unique($parts));
|
||||
|
||||
if (!isset($rules[$field]['errors']) || !is_array($rules[$field]['errors'])) {
|
||||
$rules[$field]['errors'] = [];
|
||||
}
|
||||
$label = $rules[$field]['label'] ?? ucwords(str_replace('_', ' ', $field));
|
||||
$rules[$field]['errors']['required'] = $label . ' is required for the selected claim status.';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function view_ticket($ticket_id)
|
||||
{
|
||||
// $ticket_data = $this->ticketMasterModel->where('id', $ticket_id)->where('is_active', 1)->first();
|
||||
@ -1456,6 +1508,8 @@ class TicketController extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
$rules = $this->applyClaimStatusConditionalRules($rules);
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
return $this->response->setStatusCode(400)->setJSON([
|
||||
'status' => false,
|
||||
@ -1944,6 +1998,9 @@ class TicketController extends BaseController
|
||||
'return_remark' => ['label' => 'Return Remark','rules' => 'permit_empty','errors' => []],
|
||||
];
|
||||
}
|
||||
|
||||
$rules = $this->applyClaimStatusConditionalRules($rules);
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
return $this->response->setStatusCode(400)->setJSON([
|
||||
'status' => false,
|
||||
@ -3053,7 +3110,7 @@ class TicketController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function getLastMatchedStatus($incoming_form_values, $old_ticket_data)
|
||||
public function getLastMatchedStatusOld($incoming_form_values, $old_ticket_data)
|
||||
{
|
||||
if (empty($incoming_form_values) || !isset($incoming_form_values['claim_status_id']) || !isset($incoming_form_values['extra_fields_array_for_validate'])) {
|
||||
return null;
|
||||
@ -3122,6 +3179,71 @@ class TicketController extends BaseController
|
||||
return $lastMatchedStatus;
|
||||
}
|
||||
|
||||
public function getLastMatchedStatus($incoming_form_values, $old_ticket_data)
|
||||
{
|
||||
// Preserve the incoming claim_status_id (if any) as the safe fallback so callers
|
||||
// never accidentally nullify the status when validation inputs are missing.
|
||||
$incomingStatus = $incoming_form_values['claim_status_id'] ?? null;
|
||||
|
||||
if (empty($incoming_form_values) || !isset($incoming_form_values['extra_fields_array_for_validate'])) {
|
||||
return $incomingStatus;
|
||||
}
|
||||
|
||||
$lastMatchedStatus = $incomingStatus;
|
||||
|
||||
$statusMapping = json_decode($incoming_form_values['extra_fields_array_for_validate'], true);
|
||||
if (!is_array($statusMapping) || empty($statusMapping)) {
|
||||
return $incomingStatus;
|
||||
}
|
||||
|
||||
// Drop transitional / aggregate statuses that should never be auto-selected.
|
||||
$removeKeys = is_array($this->removeArrayKey) ? $this->removeArrayKey : [];
|
||||
$statusMapping = array_diff_key($statusMapping, $removeKeys);
|
||||
|
||||
$oldStatusId = is_array($old_ticket_data) ? ($old_ticket_data['claim_status_id'] ?? null) : null;
|
||||
|
||||
$skipFields = ['approved_description'];
|
||||
|
||||
foreach ($statusMapping as $status => $requiredFields) {
|
||||
if (empty($requiredFields)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip the current/old status — we only advance forward to a newer status.
|
||||
if ($oldStatusId !== null && (int) $status === (int) $oldStatusId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!is_array($requiredFields)) {
|
||||
$requiredFields = [$requiredFields];
|
||||
}
|
||||
|
||||
$allFieldsMatched = true;
|
||||
foreach ($requiredFields as $field) {
|
||||
if (in_array($field, $skipFields, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($incoming_form_values[$field]) || $incoming_form_values[$field] === '' || $incoming_form_values[$field] === null) {
|
||||
$allFieldsMatched = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($allFieldsMatched) {
|
||||
$lastMatchedStatus = $status;
|
||||
}
|
||||
}
|
||||
|
||||
// When a TPA number is present, promote the base "registered" statuses
|
||||
// (1 -> 2 for standard, 67 -> 68 for the alternate flow).
|
||||
if (!empty($incoming_form_values['tpa_no']) && in_array((int) $lastMatchedStatus, [1, 67], true)) {
|
||||
$lastMatchedStatus = ((int) $lastMatchedStatus === 1) ? 2 : 68;
|
||||
}
|
||||
|
||||
return $lastMatchedStatus;
|
||||
}
|
||||
|
||||
public function getPolicyStartDate()
|
||||
{
|
||||
|
||||
|
||||
@ -148,10 +148,22 @@ class UserModel extends Model
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
// The user_teams join produces one row per (user, team) pair, so users
|
||||
// belonging to multiple teams appear multiple times. Collapse to one
|
||||
// row per user while keeping a team_id from [6, 7] when available, so
|
||||
// the existing in_array($user['team_id'], [6, 7]) checks in the views
|
||||
// continue to work correctly.
|
||||
$deduped = [];
|
||||
foreach ($data as $row) {
|
||||
$userId = $row['id'];
|
||||
if (!isset($deduped[$userId])) {
|
||||
$deduped[$userId] = $row;
|
||||
} elseif (in_array($row['team_id'], [6, 7])) {
|
||||
$deduped[$userId]['team_id'] = $row['team_id'];
|
||||
}
|
||||
}
|
||||
|
||||
// dd($data);
|
||||
|
||||
return $data;
|
||||
return array_values($deduped);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2172,7 +2172,7 @@
|
||||
// <label for="first_year_${increment}">Year<span class="text-danger">*</span></label>
|
||||
// <select class="form-control first_year_" id="first_year_${increment}" name="first_year[]">
|
||||
// <option value="">Select Year</option>
|
||||
// <?php foreach ($lastFiveYears as $year) {echo "<option value='$year'>$year</option>";} ?>
|
||||
// <?php foreach ($lastFiveYears ?? [] as $year) {echo "<option value='$year'>$year</option>";} ?>
|
||||
// </select>
|
||||
// </div>
|
||||
// <div class="form-group col-md-2">
|
||||
@ -2187,7 +2187,7 @@
|
||||
// <label for="first_cause_of_death_${increment}">Nature/Cause Of Death <span class="text-danger">*</span></label>
|
||||
// <select class="form-control" id="first_cause_of_death_${increment}" name="first_cause_of_death[]">
|
||||
// <option value="">Select Cause of Death</option>
|
||||
// <?php foreach ($causeOfDeath as $cause => $death_value) {echo "<option value='$cause'>$death_value</option>";} ?>
|
||||
// <?php foreach ($causeOfDeath ?? [] as $cause => $death_value) {echo "<option value='$cause'>$death_value</option>";} ?>
|
||||
// </select>
|
||||
// </div>
|
||||
// <div class="form-group col-md-2 lifeClaimFields" style="display:none;">
|
||||
@ -2198,7 +2198,7 @@
|
||||
// <label for="claim_type_${increment}">Claim Type<span class="text-danger">*</span></label>
|
||||
// <select class="form-control" id="claim_type_${increment}" name="claim_type[]">
|
||||
// <option value="">Select Claim Type</option>
|
||||
// <?php foreach ($gpaClaimType as $claimType => $claim_value) {echo "<option value='$claimType'>$claim_value</option>";} ?>
|
||||
// <?php foreach ($gpaClaimType ?? [] as $claimType => $claim_value) {echo "<option value='$claimType'>$claim_value</option>";} ?>
|
||||
// </select>
|
||||
// </div>
|
||||
// <div class="form-group col-md-2">
|
||||
@ -2245,7 +2245,7 @@
|
||||
}
|
||||
|
||||
function getClaimHistoryLabel(leadType) {
|
||||
return String(leadType) === '1' ? 'Mortality Claims' : 'Claims History';
|
||||
return String(leadType) === '1' ? 'Mortality Experience' : 'Claims Experience';
|
||||
}
|
||||
|
||||
function shouldShowClaimHistorySwitch(leadType, policyTypeId) {
|
||||
@ -2304,7 +2304,7 @@
|
||||
<label for="first_year_${increment}">Year<span class="text-danger claim-required-star">*</span></label>
|
||||
<select class="form-control first_year_ claim-input" id="first_year_${increment}" name="first_year[]">
|
||||
<option value="">Select Year</option>
|
||||
<?php foreach ($lastFiveYears as $year) {
|
||||
<?php foreach ($lastFiveYears ?? [] as $year) {
|
||||
echo "<option value='$year'>$year</option>";
|
||||
} ?>
|
||||
</select>
|
||||
@ -2361,7 +2361,7 @@
|
||||
<label for="first_cause_of_death_${increment}">Nature/Cause Of Death <span class="text-danger claim-required-star">*</span></label>
|
||||
<select class="form-control claim-input" id="first_cause_of_death_${increment}" name="first_cause_of_death[]">
|
||||
<option value="">Select Cause of Death</option>
|
||||
<?php foreach ($causeOfDeath as $cause => $death_value) {
|
||||
<?php foreach ($causeOfDeath ?? [] as $cause => $death_value) {
|
||||
echo "<option value='$cause'>$death_value</option>";
|
||||
} ?>
|
||||
</select>
|
||||
@ -2381,7 +2381,7 @@
|
||||
<label for="claim_type_${increment}">Claim Type<span class="text-danger">*</span></label>
|
||||
<select class="form-control" id="claim_type_${increment}" name="claim_type[]">
|
||||
<option value="">Select Claim Type</option>
|
||||
<?php foreach ($gpaClaimType as $claimType => $claim_value) {
|
||||
<?php foreach ($gpaClaimType ?? [] as $claimType => $claim_value) {
|
||||
echo "<option value='$claimType'>$claim_value</option>";
|
||||
} ?>
|
||||
</select>
|
||||
|
||||
@ -400,7 +400,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
|
||||
<?php
|
||||
$savedViewers = [];
|
||||
if (!empty($lead_edit_data['rfq_qcr_viewers'] ?? null)) {
|
||||
$decoded = json_decode($lead_edit_data['rfq_qcr_viewers'], true);
|
||||
$decoded = json_decode($lead_edit_data['rfq_qcr_viewers'] ?? "", true);
|
||||
if (is_array($decoded)) $savedViewers = $decoded;
|
||||
}
|
||||
?>
|
||||
@ -906,11 +906,11 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
|
||||
})
|
||||
|
||||
function getClaimHistoryLabel(leadType) {
|
||||
return String(leadType) === '1' ? 'Mortality Claims' : 'Claims History';
|
||||
return String(leadType) === '1' ? 'Mortality Experience' : 'Claims Experience';
|
||||
}
|
||||
|
||||
function getClaimDetailsSectionTitle(leadType) {
|
||||
return String(leadType) === '1' ? 'Mortality Claims' : 'Claim Details';
|
||||
return String(leadType) === '1' ? 'Mortality Experience' : 'Claims Experience';
|
||||
}
|
||||
|
||||
function shouldShowNonEbClaimHistory(leadType) {
|
||||
@ -1402,7 +1402,7 @@ var pageBackButton = '<a href="<?= base_url('leads/list') ?>" class="topbar-icon
|
||||
<label for="first_year_${increment}">Year<span class="text-danger claim-required-star">*</span></label>
|
||||
<select class="form-control claim-input first_year_" id="first_year_${increment}" name="first_year[]">
|
||||
<option value="">Select Year</option>
|
||||
<?php foreach ($lastFiveYears as $year) {
|
||||
<?php foreach ($lastFiveYears ?? [] as $year) {
|
||||
echo "<option value='$year'>$year</option>";
|
||||
} ?>
|
||||
</select>
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
: [['year' => '', 'claim_amount' => '', 'status' => '', 'policy_type' => '', 'date_of_loss' => '', 'cause_of_loss' => '']];
|
||||
$leadType = (int) ($lead_edit_data['lead_type'] ?? 0);
|
||||
$showClaimsSection = in_array($leadType, [1, 2, 3], true);
|
||||
$claimHistoryLabel = $leadType === 1 ? 'Mortality Claims' : 'Claims History';
|
||||
$claimHistoryLabel = $leadType === 1 ? 'Mortality Experience' : 'Claims Experience';
|
||||
?>
|
||||
<?php if ($showClaimsSection) { ?>
|
||||
<div class="custom-control custom-switch">
|
||||
|
||||
@ -64,8 +64,8 @@
|
||||
&& in_array((int) $lead_edit_data['lead_type'], [1, 2, 3], true)
|
||||
&& in_array((int) $lead_edit_data['policy_type_id'], [1, 6, 7], true);
|
||||
$claimHistoryLabel = (isset($lead_edit_data['lead_type']) && (int) $lead_edit_data['lead_type'] === 1)
|
||||
? 'Mortality Claims'
|
||||
: 'Claims History';
|
||||
? 'Mortality Experience'
|
||||
: 'Claims Experience';
|
||||
?>
|
||||
<?php if ($showClaimHistorySwitch) { ?>
|
||||
<div class="custom-control custom-switch">
|
||||
|
||||
@ -579,6 +579,42 @@
|
||||
var doa;
|
||||
var STATUS_SECTION_CLASSES = ['cda_ir', 'settled', 'approved', 'rejected', 'up_qdr', 'up_cnu', 'canceled', 'returned', 'payment', 'non_id'];
|
||||
var statusSectionInitialValues = {};
|
||||
// Cached full mapping of claim_status_id -> required fields.
|
||||
// The hidden input gets destructively reduced when the status dropdown changes,
|
||||
// so we capture the full map once at load time for use by frontend required-logic.
|
||||
var STATUS_REQUIRED_FIELDS_MAP = {};
|
||||
|
||||
function initStatusRequiredFieldsMap() {
|
||||
var raw = $('#extra_fields_array_for_validate').val();
|
||||
if (!raw) {
|
||||
STATUS_REQUIRED_FIELDS_MAP = {};
|
||||
return;
|
||||
}
|
||||
try {
|
||||
var parsed = JSON.parse(raw);
|
||||
STATUS_REQUIRED_FIELDS_MAP = (parsed && typeof parsed === 'object') ? parsed : {};
|
||||
} catch (e) {
|
||||
STATUS_REQUIRED_FIELDS_MAP = {};
|
||||
}
|
||||
}
|
||||
|
||||
function getRequiredFieldsForSelectedStatus() {
|
||||
if (!STATUS_REQUIRED_FIELDS_MAP) {
|
||||
return [];
|
||||
}
|
||||
var selected = $('#claim_status_id').val();
|
||||
if (selected === undefined || selected === null || selected === '') {
|
||||
return [];
|
||||
}
|
||||
var fields = STATUS_REQUIRED_FIELDS_MAP[selected];
|
||||
if (Array.isArray(fields)) {
|
||||
return fields;
|
||||
}
|
||||
if (fields) {
|
||||
return [fields];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
function captureSectionInitialValues(sectionClass) {
|
||||
if (!sectionClass) {
|
||||
@ -656,12 +692,40 @@
|
||||
return;
|
||||
}
|
||||
if (sectionClass === 'approved' || sectionClass === 'settled') {
|
||||
// The URL-or-File letter pair has its own validity rules (see enforceLetterPairRules).
|
||||
// We still need to enforce required on the other status-mandated fields
|
||||
// (e.g. utr_details, settled_date, approved_amount, approved_date), which the
|
||||
// previous early-return was skipping.
|
||||
enforceLetterPairRules();
|
||||
updateSectionRequiredLabels(sectionClass, hasSectionChanged(sectionClass));
|
||||
|
||||
var letterPairIds = sectionClass === 'approved'
|
||||
? ['approved_letter', 'approved_letter_file', 'approved_description']
|
||||
: ['settle_letter', 'settle_letter_file'];
|
||||
|
||||
var statusRequiredFields = getRequiredFieldsForSelectedStatus();
|
||||
var sectionChanged = hasSectionChanged(sectionClass);
|
||||
|
||||
$('.' + sectionClass).find('input, textarea, select').each(function () {
|
||||
var id = this.id;
|
||||
if (!id || letterPairIds.indexOf(id) !== -1) {
|
||||
return;
|
||||
}
|
||||
var statusRequires = statusRequiredFields.indexOf(id) !== -1;
|
||||
$(this).prop('required', statusRequires || sectionChanged);
|
||||
});
|
||||
|
||||
var statusMandatesSection = false;
|
||||
for (var i = 0; i < statusRequiredFields.length; i++) {
|
||||
if ($('.' + sectionClass + ' #' + statusRequiredFields[i]).length > 0) {
|
||||
statusMandatesSection = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
updateSectionRequiredLabels(sectionClass, sectionChanged || statusMandatesSection);
|
||||
return;
|
||||
}
|
||||
var changed = hasSectionChanged(sectionClass);
|
||||
$('.' + sectionClass).find('input, textarea, select').each(function() {
|
||||
$('.' + sectionClass).find('input, textarea, select').each(function () {
|
||||
if (this.id === 'approved_description') {
|
||||
return;
|
||||
}
|
||||
@ -738,6 +802,7 @@
|
||||
allowInput: false
|
||||
});
|
||||
|
||||
initStatusRequiredFieldsMap();
|
||||
updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
||||
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
|
||||
GlobelExtraFields = extraFields;
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<?php $page_name = $page_name ?? ""; ?>
|
||||
|
||||
<style>
|
||||
|
||||
.table-container {
|
||||
@ -496,8 +498,8 @@
|
||||
</div>
|
||||
|
||||
<div class="col-2" style="position: relative;right: 255px;">
|
||||
<?php if($lead_data['demography_file_status'] == "failed") { ?>
|
||||
<a href="<?= base_url('util/getMemberDataExcelFileErrors?lead_id=').$lead_data['id'] ?>"
|
||||
<?php if($lead_data['demography_file_status'] ?? "" == "failed") { ?>
|
||||
<a href="<?= base_url('util/getMemberDataExcelFileErrors?lead_id=') . ($lead_data['id'] ?? '') ?>"
|
||||
class="mdi mdi-information-outline text-danger"
|
||||
style="cursor: pointer; font-size: 27px"
|
||||
data-toggle="tooltip"
|
||||
@ -801,7 +803,7 @@
|
||||
<div class="form-group col-md-4">
|
||||
<label for="cc">CC </label>
|
||||
<select class="form-control" id="cc" name="cc" required multiple>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList; } ?>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList ?? []; } ?>
|
||||
<?php if (isset($exclusiveUserList)) { ?>
|
||||
<?php foreach ($exclusiveUserList as $user) { ?>
|
||||
<?php if ($page_name == "RFQ" || in_array($user['role'],[1,5]) || in_array($user['team_id'],[6,7])) { ?>
|
||||
@ -981,7 +983,7 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="placement_cc">CC </label>
|
||||
<select class="form-control" id="placement_cc" name="placement_cc" required multiple>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList; } ?>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList ?? []; } ?>
|
||||
<?php if (isset($exclusiveUserList)) { ?>
|
||||
>
|
||||
<?php foreach ($exclusiveUserList as $user) { ?>
|
||||
@ -1356,7 +1358,7 @@ let intervalId;
|
||||
$(document).ready(function () {
|
||||
console.log("Document ready");
|
||||
|
||||
var demography_file_status_for_hide_and_show = '<?= $lead_data['demography_file_status'] ?>';
|
||||
var demography_file_status_for_hide_and_show = '<?= $lead_data['demography_file_status'] ?? "" ?>';
|
||||
toggleButtons(demography_file_status_for_hide_and_show);
|
||||
|
||||
let lead_status = '<?= isset($lead_data['status']) ? $lead_data['status'] : '' ?>';
|
||||
@ -1404,7 +1406,7 @@ $('.remove-icon').on('click', function() {
|
||||
|
||||
var currentThrdottedMenu = '';
|
||||
var proposal_colum_count = 1;
|
||||
var demography_file_status = '<?= $lead_data['demography_file_status'] ?>';
|
||||
var demography_file_status = '<?= $lead_data['demography_file_status'] ?? "" ?>';
|
||||
|
||||
var over_all_column_data = {
|
||||
"Proposal 1": {
|
||||
@ -1818,7 +1820,7 @@ function addSuggestionsToTable() {
|
||||
<span class="dropdown" onclick="showThreeDottedMenu(event)">
|
||||
<button class="dropbtn">⋮</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="#" class="addInsurer">Add Insurer</a>
|
||||
<a href="#" class="F">Add Insurer</a>
|
||||
<a href="#" class="qcrProposal" style="background-color: rgb(221, 221, 221);">
|
||||
QCR <i class="mdi mdi-checkbox-marked" style="color: green; margin-left: 8px;"></i>
|
||||
</a>
|
||||
@ -2549,7 +2551,7 @@ function detachDynamicEventListeners() {
|
||||
|
||||
function addInsurer(event) {
|
||||
|
||||
const insurers = <?= json_encode($insurer); ?>;
|
||||
const insurers = <?= json_encode($insurer ?? []); ?>;
|
||||
|
||||
selectInsurer(insurers).then(result => {
|
||||
|
||||
@ -2701,7 +2703,7 @@ function dupInsurer(event) {
|
||||
const thPosition = getThPosition(event);
|
||||
console.log(thPosition);
|
||||
|
||||
const insurers = <?= json_encode($insurer); ?>;
|
||||
const insurers = <?= json_encode($insurer ?? []); ?>;
|
||||
|
||||
selectInsurer(insurers).then(result => {
|
||||
|
||||
@ -3217,7 +3219,7 @@ function changeInsurer(event) {
|
||||
}
|
||||
|
||||
// let newInsurerName = prompt("Enter New insurer name:");
|
||||
const insurers = <?= json_encode($insurer); ?>;
|
||||
const insurers = <?= json_encode($insurer ?? []); ?>;
|
||||
|
||||
selectInsurer(insurers).then(result => {
|
||||
|
||||
@ -4124,7 +4126,7 @@ function appendInput(data) {
|
||||
<div class="form-group col-md-6">
|
||||
<label for="client_cc">CC </label>
|
||||
<select class="form-control" id="client_cc" name="client_cc" required multiple>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList; } ?>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList ?? []; } ?>
|
||||
<?php if (isset($exclusiveUserList)) { ?>
|
||||
<?php foreach ($exclusiveUserList as $user) { ?>
|
||||
<?php if ($page_name == "RFQ" || in_array($user['role'],[1,5]) || in_array($user['team_id'],[6,7])) { ?>
|
||||
@ -4139,7 +4141,7 @@ function appendInput(data) {
|
||||
<div class="form-group col-md-6">
|
||||
<label for="client_bcc">BCC </label>
|
||||
<select class="form-control" id="client_bcc" name="client_bcc" required multiple>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList; } ?>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList ?? []; } ?>
|
||||
<?php if (isset($exclusiveUserList)) { ?>
|
||||
<?php foreach ($exclusiveUserList as $user) { ?>
|
||||
<?php if ($page_name == "RFQ" || in_array($user['role'],[1,5]) || in_array($user['team_id'],[6,7])) { ?>
|
||||
@ -4190,7 +4192,7 @@ function appendInput(data) {
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_cc">CC </label>
|
||||
<select class="form-control" id="client_cc" name="client_cc" required multiple>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList; } ?>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList ?? []; } ?>
|
||||
<?php if (isset($exclusiveUserList)) { ?>
|
||||
<?php foreach ($exclusiveUserList as $user) { ?>
|
||||
<?php if ($page_name == "RFQ" || in_array($user['role'],[1,5]) || in_array($user['team_id'],[6,7])) { ?>
|
||||
@ -4205,10 +4207,11 @@ function appendInput(data) {
|
||||
<div class="form-group col-md-4">
|
||||
<label for="client_bcc">BCC </label>
|
||||
<select class="form-control" id="client_bcc" name="client_bcc" required multiple>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList; } ?>
|
||||
<?php if($page_name == "RFQ") { $exclusiveUserList = $userList ?? []; } ?>
|
||||
<?php if (isset($exclusiveUserList)) { ?>
|
||||
<?php foreach ($exclusiveUserList as $user) { ?>
|
||||
<?php if ($page_name == "RFQ" || in_array($user['role'],[1,5]) || in_array($user['team_id'],[6,7])) { ?>
|
||||
<option value="<?= $user['id'];?>">
|
||||
<?= $user['first_name'].' - '.$user['email'];?>
|
||||
</option>
|
||||
<?php } } ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user