{{ $momFieldsReadOnly ? 'View Minutes of Meeting' : 'Minutes of Meeting' }}
{{ $meeting->title }}
@if ($schemeTitleDisplay !== ''){{ $schemeTitleDisplay }}
@endif@extends('layouts.app')
@section('title', 'Minutes of Meeting — ' . \Illuminate\Support\Str::limit((string) ($meeting->title ?? ''), 80, '…'))
@push('stylesheets')
@if (! empty($momShowAttendedParticipantsPicker) || ! empty($momShowCoSignerPicker) || ! empty($momShowCoSignerSignatureSection) || ! empty($momShowCoSignerForwardSection) || ! empty($momShowOtherParticipantsEditor))
@endif
@endpush
@section('contents')
@php
$momLockedAfterSave = filter_var($momLockedAfterSave ?? false, FILTER_VALIDATE_BOOLEAN);
$momFieldsReadOnly = filter_var($momFieldsReadOnly ?? true, FILTER_VALIDATE_BOOLEAN);
$momRichTextHasContent = static function (?string $html): bool {
if ($html === null || trim((string) $html) === '') {
return false;
}
if (preg_match('/ 0
? 'project_concept_note_id='.$pcnId
: ($pcFormId > 0 ? 'pc_form_id='.$pcFormId : '');
}
$schemeMomModel = $schemeMom ?? null;
$momDeliberationsHtml = old('mom', $schemeMomModel instanceof \App\Models\PC\MwsMeetingSchemeMom ? ($schemeMomModel->mom ?? '') : ($meeting->mom ?? ''));
$momUnwrapRootOlToParagraphs = static function (?string $html): string {
$html = trim((string) $html);
if ($html === '' || ! preg_match('/^\s*
\s*(?:
)?\s*<\/p>|
))*\s*$/is', $html, $m)) {
return $html;
}
if (! preg_match_all('/
'.$inner.'
'; } return $out !== '' ? $out : $html; }; $momDeliberationsHtml = $momUnwrapRootOlToParagraphs($momDeliberationsHtml); $momDecisionsHtml = old('mom_decisions', $schemeMomModel instanceof \App\Models\PC\MwsMeetingSchemeMom ? ($schemeMomModel->mom_decisions ?? '') : ($meeting->mom_decisions ?? '')); $momTranscriptionValue = old('mom_transcription', $schemeMomModel instanceof \App\Models\PC\MwsMeetingSchemeMom ? ($schemeMomModel->mom_transcription ?? '') : ($meeting->mom_transcription ?? '')); $momDeliberationsHasContent = $momRichTextHasContent($momDeliberationsHtml); $momDecisionsHasContent = $momRichTextHasContent($momDecisionsHtml); $momDecisionsUseNestedScheme = ! $momDecisionsHasContent || \App\Support\MwsMomGovtPreviewHtml::usesNestedDecisionScheme($momDecisionsHtml); $momShowCoSignerPicker = filter_var($momShowCoSignerPicker ?? false, FILTER_VALIDATE_BOOLEAN); $momExpectedCoSignerCount = (int) ($momExpectedCoSignerCount ?? 0); // max 0 = no upper limit (see MwsMeeting::momCoSignerPickBounds); do not clamp 0 up to min. $momExpectedCoSignerMaxCount = (int) ($momExpectedCoSignerMaxCount ?? 0); if ($momExpectedCoSignerMaxCount > 0 && $momExpectedCoSignerMaxCount < $momExpectedCoSignerCount) { $momExpectedCoSignerMaxCount = $momExpectedCoSignerCount; } $momParticipantSignerOptions = is_array($momParticipantSignerOptions ?? null) ? $momParticipantSignerOptions : []; $momSelectedCoSignerUserIds = is_array($momSelectedCoSignerUserIds ?? null) ? array_map('intval', $momSelectedCoSignerUserIds) : []; $momShowCoSignerSignatureSection = filter_var($momShowCoSignerSignatureSection ?? false, FILTER_VALIDATE_BOOLEAN); $momShowCoSignerForwardSection = filter_var($momShowCoSignerForwardSection ?? false, FILTER_VALIDATE_BOOLEAN); $momCoSignerInteractive = $momShowCoSignerSignatureSection || $momShowCoSignerForwardSection; $momCoSignerSignature = is_array($momCoSignerSignature ?? null) ? $momCoSignerSignature : []; $momCoSignerSignUrl = $momCoSignerSignUrl ?? ''; $momSigRequired = $schemeMomModel instanceof \App\Models\PC\MwsMeetingSchemeMom ? ($schemeMomModel->effectiveMomSignatureCounts()['required'] ?? 0) : (int) ($meeting->required_count_signature ?? 0); $momSigApproved = $schemeMomModel instanceof \App\Models\PC\MwsMeetingSchemeMom ? ($schemeMomModel->effectiveMomSignatureCounts()['approved'] ?? 0) : (int) ($meeting->approve_count_signature ?? 0); $momPreviewUrl = $momPreviewUrl ?? route('meeting-workspace.meetings.mom.preview', $meeting).($momSubjectQuery !== '' ? '?'.$momSubjectQuery : ''); $schemeTitleDisplay = trim((string) ($schemeTitle ?? '')); $momHistoryDisplayRows = is_array($momHistoryDisplayRows ?? null) ? $momHistoryDisplayRows : []; $momVersionDisplayRows = is_array($momVersionDisplayRows ?? null) ? $momVersionDisplayRows : []; $momCoSignerChainDisplayRows = is_array($momCoSignerChainDisplayRows ?? null) ? $momCoSignerChainDisplayRows : []; if ($momCoSignerChainDisplayRows !== []) { $momSigApproved = count(array_filter( $momCoSignerChainDisplayRows, static fn (array $row): bool => ($row['status'] ?? '') === 'signed' )); $momSigRequired = count($momCoSignerChainDisplayRows); } $momPostSaveEditable = filter_var($momPostSaveEditable ?? false, FILTER_VALIDATE_BOOLEAN); $momReturnedToPrimary = filter_var($momReturnedToPrimary ?? false, FILTER_VALIDATE_BOOLEAN); $momPrimaryMayReviseReturned = filter_var($momPrimaryMayReviseReturned ?? false, FILTER_VALIDATE_BOOLEAN); $momAllParticipantOptions = is_array($momAllParticipantOptions ?? null) ? $momAllParticipantOptions : []; $momSelectedAttendedParticipantIds = is_array($momSelectedAttendedParticipantIds ?? null) ? array_map('intval', $momSelectedAttendedParticipantIds) : []; $momAttendedParticipantsDisplay = is_array($momAttendedParticipantsDisplay ?? null) ? $momAttendedParticipantsDisplay : []; $momAttendedParticipantLayout = is_array($momAttendedParticipantLayout ?? null) ? $momAttendedParticipantLayout : []; $momShowAttendedParticipantsPicker = filter_var($momShowAttendedParticipantsPicker ?? false, FILTER_VALIDATE_BOOLEAN); $momShowInChairPicker = filter_var($momShowInChairPicker ?? false, FILTER_VALIDATE_BOOLEAN); $momShowInChairReadonly = filter_var($momShowInChairReadonly ?? false, FILTER_VALIDATE_BOOLEAN); $momInChairOptions = is_array($momInChairOptions ?? null) ? $momInChairOptions : []; $momSelectedInChairUserId = (int) ($momSelectedInChairUserId ?? 0); $momInChairSelectedName = (string) ($momInChairSelectedName ?? ''); $momLetterheadSectionOptions = is_array($momLetterheadSectionOptions ?? null) ? $momLetterheadSectionOptions : []; $momSelectedLetterheadSectionId = (int) ($momSelectedLetterheadSectionId ?? 0); $momShowLetterheadSectionPicker = filter_var($momShowLetterheadSectionPicker ?? false, FILTER_VALIDATE_BOOLEAN); $momShowLetterheadSectionReadonly = filter_var($momShowLetterheadSectionReadonly ?? false, FILTER_VALIDATE_BOOLEAN); $momLetterheadSectionSelectedName = (string) ($momLetterheadSectionSelectedName ?? ''); $momShowAttendedParticipantsReadonly = filter_var($momShowAttendedParticipantsReadonly ?? false, FILTER_VALIDATE_BOOLEAN); $momOtherParticipants = is_array($momOtherParticipants ?? null) ? $momOtherParticipants : []; $momShowOtherParticipantsEditor = filter_var($momShowOtherParticipantsEditor ?? false, FILTER_VALIDATE_BOOLEAN); $momShowOtherParticipantsReadonly = filter_var($momShowOtherParticipantsReadonly ?? false, FILTER_VALIDATE_BOOLEAN); $momOtherParticipantDepartmentOptions = is_array($momOtherParticipantDepartmentOptions ?? null) ? array_values(array_filter(array_map('strval', $momOtherParticipantDepartmentOptions), static fn ($v) => trim($v) !== '')) : []; $momOtherParticipantDesignationOptions = is_array($momOtherParticipantDesignationOptions ?? null) ? array_values(array_filter(array_map('strval', $momOtherParticipantDesignationOptions), static fn ($v) => trim($v) !== '')) : []; $mwsMomOtherSelectOptionsHtml = static function (array $options, string $selected): string { $selected = trim($selected); $html = ''; $matched = false; foreach ($options as $opt) { $opt = trim((string) $opt); if ($opt === '') { continue; } $isSel = $selected !== '' && strcasecmp($opt, $selected) === 0; if ($isSel) { $matched = true; } $html .= ''; } if ($selected !== '' && ! $matched) { $html .= ''; } return $html; }; $momWorkingPaperAttached = filter_var($momWorkingPaperAttached ?? false, FILTER_VALIDATE_BOOLEAN); $momShowWorkingPaperAttachedCheckbox = filter_var($momShowWorkingPaperAttachedCheckbox ?? false, FILTER_VALIDATE_BOOLEAN); $mwsMomMayPersist = ($canEdit && ! $momLockedAfterSave) || $momPostSaveEditable || $momPrimaryMayReviseReturned; // Keep existing workflow: co-signatory Sign/Forward/Return has no extra Save button. $mwsMomShowSaveButton = $mwsMomMayPersist && ! $momCoSignerInteractive; $mwsMomShowDraftPreviewButton = $mwsMomShowSaveButton || $momCoSignerInteractive; @endphp{{ $meeting->title }}
@if ($schemeTitleDisplay !== ''){{ $schemeTitleDisplay }}
@endif