{{-- resources/views/probation/cases/show.blade.php Tabbed case workspace — one screen for every work-stream. Each tab lives in its own partial (probation/cases/_*.blade.php). --}} @extends('layouts.app') @section('title', $case->serial_number . ' - ICMIS') @push('styles') @endpush @section('content') @php $rt = 'probation.' . $module['routeKey']; $ct = $module['caseType']; $isSI = $ct === 'social_inquiry'; $isSup = !empty($module['isSupervision']); // Supervision / Interventions / Empowerment / Completion $isCso = $ct === 'community_service'; $remarks = !empty($module['hasRemarks']); $residency = $module['residency'] ?? null; $hasOutcome = empty($module['noOutcome']); $alerts = $alerts ?? []; // tab list — "Supervision Summary" sits between the last two tabs (CSO analysis 18) $tabs = [['t-overview', 'Overview'], ['t-ledger', 'Case Ledger']]; if (!$isSI) $tabs[] = ['t-nok', 'Next of Kin']; if ($isSI) $tabs[] = ['t-inquiry', 'Interviews']; $tabs[] = ['t-assess', 'Assessments']; $tabs[] = ['t-conf', 'Case Conferences']; $tabs[] = ['t-reports', 'Reports']; if ($residency) $tabs[] = ['t-residency', ['probation_hostel' => 'Hostel', 'halfway_house' => 'Halfway House', 'borstal' => 'Borstal Vacancy'][$residency]]; if ($isCso) $tabs[] = ['t-cso', 'CSO Quantification']; if ($isSup) { $tabs[] = ['t-superv', 'Supervision']; $tabs[] = ['t-interv', 'Interventions']; $tabs[] = ['t-emp', 'Empowerment']; } $tabs[] = ['t-docs', 'Documents']; if ($remarks) $tabs[] = ['t-remarks', 'Remarks']; if ($isSup) $tabs[] = ['t-complete', 'Completion']; if ($hasOutcome) $tabs[] = ['t-outcome', 'Outcome']; if ($isSup) array_splice($tabs, count($tabs) - 1, 0, [['t-summary', 'Supervision Summary']]); @endphp
@include('probation.cases._aftercare_nav') @if(session('duplicate_url'))
Open the matching case
@endif {{-- header --}}
@if($case->photo_path) Photo @endif

{{ optional($case->prisoner)->name }}

@unless($isCso)@endunless {{ $module['clientLabel'] ?? 'Offender' }} · Ref. No. {{ $case->serial_number }} · {{ $module['title'] }} · {{ optional($case->branch)->branch_name }} @if($case->aftercare_category) · {{ config('probation.aftercare_categories')[$case->aftercare_category] ?? $case->aftercare_category }}@endif @if($case->is_voluntary) · Voluntary supervision@endif
@if($case->wasConverted())
Retrieved from {{ \App\Models\ProbationCase::labelForType($case->converted_from_case_type) }} ({{ $case->converted_from_serial }}) on {{ optional($case->converted_at)->format('d M Y') }}
@else
{{ $isSI ? 'Registered' : 'Direct placement' }} — {{ $module['title'] }}
@endif
{{ $case->status_label }} @if($isSup){{ $case->intensity ? ucfirst($case->intensity).' intensity' : 'No intensity set' }}@endif @if($case->isAssigned()){{ optional($case->officer)->name }}@elseUnassigned@endif @foreach(config('probation_workflow.flags') as $f => $fl) @if($case->{$f}){{ $fl }}@endif @endforeach
Edit @if($case->completion && $case->completion->certificate_no && empty($module['noCertificate'])) Certificate @endif
{{-- alerts: progress reports / conferences / plan due --}} @if(count($alerts))
@foreach($alerts as $al)
{{ $al['text'] }} @if($al['tab'])@endif
@endforeach
@endif {{-- tabs --}}
@include('probation.cases._overview')
@include('probation.cases._supervision_ledger', ['case' => $case]) @include('probation.cases._ledger', ['case' => $case])
@if(!$isSI)
@include('probation.cases._next_of_kin', ['case' => $case])
@endif @if($isSI)
@include('probation.cases._interviews')
@endif
@include('probation.cases._flags') @include('probation.cases._assessments', ['case' => $case])
@include('probation.cases._conferences')
@include('probation.cases._reports')
@if($residency)
@include('probation.cases._residency')
@endif @if($isCso)
@include('probation.cases._cso_work', ['case' => $case, 'agencies' => $agencies ?? collect()])
@endif @if($isSup)
@include('probation.cases._supervision_tab')
@include('probation.cases._interventions', ['case' => $case])
@include('probation.cases._empowerment')
@endif
@include('probation.cases._documents')
@if($remarks)
@include('probation.cases._remarks', ['case' => $case])
@endif @if($isSup)
@include('probation.cases._summary')
@include('probation.cases._completion')
@endif @if($hasOutcome)
@include('probation.cases._outcome', ['case' => $case])
@endif
@if(session('open_tab')) @endif @endsection