FIX_header access and UTR Details Validation

This commit is contained in:
sanjeev.p 2026-04-01 15:28:55 +05:30
parent bc0fbc0e95
commit 60c07556da
3 changed files with 14 additions and 8 deletions

View File

@ -122,7 +122,7 @@ class Acl
// ===================== POLICY TRANSACTION / BDS =====================
'#^/policy_tranction#' => [
'roles' => [ HEAD_ROLE_ID,ADMIN_ROLE_ID, MANAGER_ROLE_ID, ACCOUNT_MANAGER_ROLE_ID],
'roles' => [ HEAD_ROLE_ID,ADMIN_ROLE_ID, MANAGER_ROLE_ID, ACCOUNT_MANAGER_ROLE_ID,STAFF_ROLE_ID],
'teams' => [FINANCE_TEAM_ID,POS_TEAM_ID]
],
'#^/dmsSearch#' => [

View File

@ -1307,7 +1307,7 @@ class TicketController extends BaseController
'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']],
'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []],
'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 ~!#$%&*\-_+=|:.,]+$/]','errors' => ['regex_match' => 'UTR Details only allows alphanumeric, spaces, and ~ ! # $ % & * - _ + = | : . , ']],
'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']],
'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []],
'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']],
@ -1418,7 +1418,7 @@ class TicketController extends BaseController
'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']],
'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []],
'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']],
'utr_details' => [ 'label' => 'UTR Details', 'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 ~!#$%&*\-_+=|:.,]+$/]','errors' => ['regex_match' => 'UTR Details only allows alphanumeric, spaces, and ~ ! # $ % & * - _ + = | : . , ']],
'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']],
'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []],
'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']],
@ -1672,7 +1672,8 @@ class TicketController extends BaseController
'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']],
'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []],
'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 ~!#$%&*\-_+=|:.,]+$/]','errors' => ['regex_match' => 'UTR Details only allows alphanumeric, spaces, and ~ ! # $ % & * - _ + = | : . , ']],
'errors' => [ 'regex_match' => 'UTR Details only allows alphanumeric, spaces, and ~ ! # $ % & * - _ + = | : . , '],
'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']],
'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []],
'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']],
@ -1783,7 +1784,7 @@ class TicketController extends BaseController
'approved_date' => ['label' => 'Approved Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Approved Date must be dd/mm/yyyy.']],
'approved_letter' => ['label' => 'Approved Letter','rules' => 'permit_empty','errors' => []],
'approved_description' => ['label' => 'Approved Description','rules' => 'permit_empty','errors' => []],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'UTR Details contains invalid characters.']],
'utr_details' => ['label' => 'UTR Details','rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 ~!#$%&*\-_+=|:.,]+$/]','errors' => ['regex_match' => 'UTR Details only allows alphanumeric, spaces, and ~ ! # $ % & * - _ + = | : . , ']],
'settled_date' => ['label' => 'Settled Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Settled Date must be dd/mm/yyyy.']],
'settle_letter' => ['label' => 'Settle Letter','rules' => 'permit_empty','errors' => []],
'pay_initiate_date' => ['label' => 'Payment Initiate Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Payment Initiate Date must be dd/mm/yyyy.']],

View File

@ -2107,9 +2107,14 @@ body[data-sidebar-size="condensed"] .footer {
<?php if ((in_array(get_role_id(), [1, 5])) || ((in_array(get_role_id(), [2, 3, 4])) && in_array(FINANCE_TEAM_ID, user_team())) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
<?php if (in_array(get_role_id(), [1, 5]) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team())) { ?>
<?php if (
get_role_id() != 4 // Global Guard: Exclude Role 4
&& (
in_array(get_role_id(), [1, 5]) // Case 1: Role 1 or 5
|| in_array(MANAGEMENT_TEAM_ID, user_team()) // Case 2: Any Role + Management Team
|| in_array(POS_TEAM_ID, user_team()) // Case 3: Any Role + POS Team
)
) { ?>
<li>
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
<i class="ri-file-chart-fill"></i>