From 77c868e2097cbc1ea5e3031b34f75db75451fc11 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 24 Oct 2024 20:35:29 -0500 Subject: [PATCH] Allow for marking no-shows en-masse --- .../Tabulation/SeatAuditionFormController.php | 14 +++++++++++++- .../auditionSeating-unable-to-seat-card.blade.php | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Tabulation/SeatAuditionFormController.php b/app/Http/Controllers/Tabulation/SeatAuditionFormController.php index 30355b6..b7f90f0 100644 --- a/app/Http/Controllers/Tabulation/SeatAuditionFormController.php +++ b/app/Http/Controllers/Tabulation/SeatAuditionFormController.php @@ -47,6 +47,17 @@ class SeatAuditionFormController extends Controller $requestedEnsembleAccepts = false; } + // Deal with a mass no-show request + if ($request->input('mass-no-show')) { + $entries = $audition->entries()->forSeating()->withCount('scoreSheets')->with('flags')->get(); + foreach ($entries as $entry) { + if ($entry->scoreSheets_count == 0 && ! $entry->hasFlag('no_show')) { + $entry->addFlag('no_show'); + } + } + + } + $entryData = []; $entries = $this->ranker->rank('seating', $audition); $entries->load('student.school'); @@ -76,7 +87,8 @@ class SeatAuditionFormController extends Controller 'totalScore' => $totalScoreColumn, 'fullyScored' => $fullyScored, 'doubleData' => $doublerData, - 'doublerRequest' => $entry->student->doublerRequests()->where('event_id', $audition->event_id)->first()?->request, + 'doublerRequest' => $entry->student->doublerRequests()->where('event_id', + $audition->event_id)->first()?->request, ]; // If this entries double decision isn't made, block seating if ($doublerData && $doublerData[$entry->id]['status'] == 'undecided') { diff --git a/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php b/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php index 54711ea..a8d2ddf 100644 --- a/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php +++ b/resources/views/tabulation/auditionSeating-unable-to-seat-card.blade.php @@ -2,8 +2,14 @@ Unable to seat this audition @if(! $rightPanel['data']['allScored'])

The audition cannot be seated while it has unscored entries.

+
+ Unscored entries are No-Shows +
@endif + @if(! $rightPanel['data']['allScored'] && ! $rightPanel['data']['doublersResolved']) +
+ @endif @if(! $rightPanel['data']['doublersResolved'])

The audition cannot be seated while it has unresolved doublers.

@endif