@php $schemeFilterCatalog = $schemeFilterCatalog ?? \App\Support\PlanIndexSchemeFilterCatalog::tripleSelectOptions(); $planSchemeFilters = plan_index_scheme_filters(); $planSchemeFilterChips = plan_index_scheme_filter_chips(); $planListTabStatus = visit_plan_index_status(); if ($planListTabStatus === '') { $rawStatus = (string) request()->query('status', ''); if (in_array($rawStatus, ['draft', 'in_process', 'approved'], true)) { $planListTabStatus = $rawStatus; } } $selectedProjectId = (int) ($planSchemeFilters['project_id'] ?? 0); $visitRangeDisplay = \App\Support\PlanListingSchemeFilters::visitDateRangeDisplay( $planSchemeFilters['visit_date_from'] ?? '', $planSchemeFilters['visit_date_to'] ?? '' ); $planSchemeSectionOpen = plan_index_has_scheme_filters() || $selectedProjectId > 0 || $visitRangeDisplay !== '' || (int) ($planSchemeFilters['monitoring_officer_id'] ?? 0) > 0; $mecUnifiedFilters = function_exists('is_mec_role') && is_mec_role(); $selectedPlanTypes = visit_plan_index_plan_types_from_request(); $selectedMecRegionIds = array_map( static fn (int $id) => (string) $id, resolve_mec_region_list_filter_ids(request()->query('mec_region_id')) ); @endphp
@if ($planListTabStatus !== '' && (string) request('status', '') === $planListTabStatus) @endif @if ($mecUnifiedFilters) {{-- Workspace MEC: all plan + scheme filters in one Show/Hide body (no nested tiers). --}}
@if (visit_plan_list_shows_region_filter())
@endif @if ((string) request('status', '') === '' || ! in_array((string) request('status', ''), ['draft', 'in_process', 'approved'], true))
@endif
@include('scheme-plan-changes.partials.scheme-triple-adp-uid-name', [ 'rootId' => 'planIndexSchemeTriple', 'selectName' => 'project_id', 'projectOptions' => $schemeFilterCatalog['projectOptions'] ?? [], 'adpOptions' => $schemeFilterCatalog['adpOptions'] ?? [], 'schemeCodeOptions' => $schemeFilterCatalog['schemeCodeOptions'] ?? [], 'selectedValue' => $selectedProjectId > 0 ? $selectedProjectId : null, 'colAdp' => 'col-12 col-md-6 col-lg-3', 'colUid' => 'col-12 col-md-6 col-lg-3', 'colName' => 'col-12 col-md-12 col-lg-6', ])
@if (visit_plan_list_shows_mo_filter())
@endif
@else
{{ __('Plan filters') }}
@if (visit_plan_list_shows_region_filter())
@endif @if ((string) request('status', '') === '' || ! in_array((string) request('status', ''), ['draft', 'in_process', 'approved'], true))
@endif

{{ __('Narrow visit plans to those that include a matching scheme, officer, or visit date.') }}

@include('scheme-plan-changes.partials.scheme-triple-adp-uid-name', [ 'rootId' => 'planIndexSchemeTriple', 'selectName' => 'project_id', 'projectOptions' => $schemeFilterCatalog['projectOptions'] ?? [], 'adpOptions' => $schemeFilterCatalog['adpOptions'] ?? [], 'schemeCodeOptions' => $schemeFilterCatalog['schemeCodeOptions'] ?? [], 'selectedValue' => $selectedProjectId > 0 ? $selectedProjectId : null, 'colAdp' => 'col-12 col-md-6 col-lg-3', 'colUid' => 'col-12 col-md-6 col-lg-3', 'colName' => 'col-12 col-md-12 col-lg-6', ])
@if (visit_plan_list_shows_mo_filter())
@endif
@endif
@if (count($planSchemeFilterChips) > 0)
{{ __('Active scheme filters') }}: @foreach ($planSchemeFilterChips as $chip) {{ $chip['label'] }}: {{ $chip['value'] }} @endforeach
@endif @if (plan_index_has_scheme_filters())

{{ __('Showing visit plans that include at least one matching scheme. Open a plan to jump to the match.') }}

@endif