Neue Plugins: Speiseplan und „Gemeinsam feiern, erinnern und willkommen heißen“
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m34s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m55s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 4m28s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 4m19s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 3m34s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 3m29s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m34s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m55s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 4m28s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 4m19s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 3m34s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 3m29s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m7s
- Gemeinsam: Personalnachrichten je Monat in sechs Tabellen; Geburtstage aus dem Geburtstags-Plugin (neue Abfrage BirthdayList::inMonth) - Speiseplan: Wochenbilder im Voraus, PDF → Bild im Browser, aktuelle und nächste Woche, Allergie-PDF, randloser A4-Druck, Löschen nach zwei Wochen - Beide optional (zunächst abgeschaltet), eigene Pflegerechte Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b50d089946
commit
97879ce243
181 changed files with 520 additions and 711 deletions
|
|
@ -80,6 +80,30 @@ class BirthdayList
|
|||
->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Alle eingetragenen Geburtstage eines Monats (wer im Profil zugestimmt hat),
|
||||
* nach Tag sortiert – z. B. für „Gemeinsam feiern“.
|
||||
*
|
||||
* @return list<array{date: string, person: array<string, mixed>}>
|
||||
*/
|
||||
public function inMonth(int $year, int $month): array
|
||||
{
|
||||
return Birthday::query()
|
||||
->where('month', $month)
|
||||
->whereHas('user', fn ($q) => $q->where('is_active', true))
|
||||
->with('user')
|
||||
->get()
|
||||
->filter(fn (Birthday $b) => checkdate($month, $b->day, $year) || ($month === 2 && $b->day === 29))
|
||||
->sortBy(fn (Birthday $b) => sprintf('%02d', $b->day).mb_strtolower($b->user->last_name.' '.$b->user->first_name))
|
||||
->map(fn (Birthday $b) => [
|
||||
// 29. Februar in Nicht-Schaltjahren am 28. feiern
|
||||
'date' => Carbon::create($year, $month, checkdate($month, $b->day, $year) ? $b->day : 28)->toDateString(),
|
||||
'person' => (new PersonResource($b->user))->resolve(),
|
||||
])
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
|
||||
public function isBirthdayToday(User $user): bool
|
||||
{
|
||||
return (bool) Birthday::query()->where('user_id', $user->id)->first()?->isOn(Carbon::today());
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ function remove(entry) {
|
|||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div v-if="visible.length && !(empty && !canManage)" class="grid max-w-5xl gap-6">
|
||||
<div v-if="visible.length && !(empty && !canManage)" class="grid gap-6">
|
||||
<section
|
||||
v-for="section in visible"
|
||||
:key="section.key"
|
||||
|
|
@ -123,7 +123,7 @@ function remove(entry) {
|
|||
</section>
|
||||
</div>
|
||||
|
||||
<div v-else class="max-w-5xl rounded-lg border bg-card">
|
||||
<div v-else class="rounded-lg border bg-card">
|
||||
<EmptyState :icon="Sparkles" title="Keine Einträge in diesem Monat" text="Hier stehen neue Kolleginnen und Kollegen, Wechsel, Geburtstage, Jubiläen, Verabschiedungen und Gedenken." />
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue