@php
$moWorkspaceNotice = trim((string) ($draftPayload['mo_workspace_notice'] ?? ''));
@endphp
@if($moWorkspaceNotice !== '')
@endif
@if($createPlanFixedLayout)
@php
$visitPeriodChangeQuery = [];
foreach ($initialSchemes ?? [] as $__row) {
$__sid = (int) ($__row['scheme_id'] ?? 0);
if ($__sid > 0) {
$visitPeriodChangeQuery['scheme_ids'][] = $__sid;
$visitPeriodChangeQuery['locked_scheme_ids'][] = $__sid;
}
}
@endphp
New visit plan
— Type {{ $createPlanTypeCode }}
· Month {{ $createPlanMonthLabel }}
· Year {{ $createPlanYearDisplay }}
@if (! empty($planFormSelectedMecRegion['show']))
· Region {{ $planFormSelectedMecRegion['name'] }}
@endif
@if (! empty($planFormSelectedMecRegion['id']))
@endif
@endif
@if($checkerEditMode || $isEdit)
@if($checkerEditMode)
@elseif($isEdit && empty($declinedSchemesEditMode))
@php
$planTypeValue = old('plan_type', $draftPayload['plan_type'] ?? $plan?->plan_type);
$planTypeLabels = [
'RVP' => 'Regular Visit Plan (RVP)',
'CVP' => 'Compliance Visit Plan (CVP)',
'SVP' => 'Special Visit Plan (SVP)',
'DRP' => 'Desk Review Plan (DRP)',
'ERP' => 'Evaluation Report Plan (ERP)',
'PMP' => 'Project Monitoring Plan (PMP)',
];
$editPlanPeriodTypeCode = strtoupper(trim((string) $planTypeValue));
if (! in_array($editPlanPeriodTypeCode, \App\Support\PlanningWing::allPlanTypes(), true)) {
$editPlanPeriodTypeCode = 'RVP';
}
$editPlanPeriodMonthNum = (int) old('month', $draftPayload['month'] ?? $plan?->month ?? ($defaultMonth ?? now()->month));
$editPlanPeriodYearNum = (int) old('year', $draftPayload['year'] ?? $plan?->year ?? ($defaultYear ?? now()->year));
if ($editPlanPeriodMonthNum < 1 || $editPlanPeriodMonthNum > 12) {
$editPlanPeriodMonthNum = (int) now()->month;
}
if ($editPlanPeriodYearNum < 2000 || $editPlanPeriodYearNum > 2100) {
$editPlanPeriodYearNum = (int) now()->year;
}
$editPlanPeriodMonthLabel = \Carbon\Carbon::createFromDate($editPlanPeriodYearNum, $editPlanPeriodMonthNum, 1)->format('F');
$editPlanPeriodTypeLabel = $planTypeLabels[$editPlanPeriodTypeCode] ?? $editPlanPeriodTypeCode;
$periodEditQuery = [
'return_plan_id' => $plan->id,
'plan_type' => $editPlanPeriodTypeCode,
'month' => $editPlanPeriodMonthNum,
'year' => $editPlanPeriodYearNum,
];
foreach (collect($initialSchemes ?? [])->pluck('scheme_id')->map(fn ($id) => (int) $id)->filter()->unique()->values()->all() as $__sid) {
$periodEditQuery['scheme_ids'][] = $__sid;
$periodEditQuery['locked_scheme_ids'][] = $__sid;
}
$planPeriodEditUrl = route('plan.visit.period', $periodEditQuery);
@endphp
Plan period
— Type {{ $editPlanPeriodTypeCode }}
· Month {{ $editPlanPeriodMonthLabel }}
· Year {{ $editPlanPeriodYearNum }}
@if (! empty($planFormSelectedMecRegion['show']))
· Region {{ $planFormSelectedMecRegion['name'] }}
@endif
({{ $editPlanPeriodTypeLabel }})
Change plan period
@elseif(!empty($declinedSchemesEditMode) && $isEdit)
@if(!empty($partialDeclinedCorrectionMode))
Declined schemes. Correct or remove only the schemes marked below. Other schemes stay in RD review and are read-only until you return the corrected declined schemes to the active plan.
@else
Declined schemes. Update the schemes below, save a draft, then submit so they rejoin RD review on this same plan.
@endif
@if(!empty($pendingNewDeclinedSchemeAlerts))
@foreach($pendingNewDeclinedSchemeAlerts as $alert)
- {{ $alert['scheme_label'] ?? 'Scheme' }}: {{ $alert['message'] ?? '' }}
@endforeach
@endif
@endif
@endif
@if(!empty($planParticipantViewMode))
@if(!empty($participantHasEditableScheme))
Update visit details for schemes assigned to you. Schemes reassigned to another monitoring officer are read-only.
@else
You have no schemes assigned to you for editing on this plan.
@endif
@endif
@if(!empty($schemeSelectionUrl ?? null))
Add Schemes
@endif
@if(!empty($schemeSelectionUrl ?? null))
@endif