From 89d8a070d9a98c17b8652d38619db80a1cda9c8e Mon Sep 17 00:00:00 2001 From: xuwhite <73076134+xuwhite@users.noreply.github.com> Date: Sun, 28 Jan 2024 20:57:59 +0100 Subject: [PATCH] add hint admin_shifts no location, shift type or angeltype (#1337) --- includes/pages/admin_shifts.php | 6 ++++++ resources/lang/de_DE/default.po | 9 +++++++++ resources/lang/en_US/default.po | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index f435cec2..420c408b 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -41,11 +41,13 @@ function admin_shifts() // Locations laden $locations = Location::orderBy('name')->get(); + $no_locations = $locations->isEmpty(); $location_array = $locations->pluck('name', 'id')->toArray(); // Load angeltypes /** @var AngelType[] $types */ $types = AngelType::all(); + $no_angeltypes = $types->isEmpty(); $needed_angel_types = []; foreach ($types as $type) { $needed_angel_types[$type->id] = 0; @@ -54,6 +56,7 @@ function admin_shifts() // Load shift types /** @var ShiftType[]|Collection $shifttypes_source */ $shifttypes_source = ShiftType::all(); + $no_shifttypes = $shifttypes_source->isEmpty(); $shifttypes = []; foreach ($shifttypes_source as $shifttype) { $shifttypes[$shifttype->id] = $shifttype->name; @@ -501,6 +504,9 @@ function admin_shifts() icon('clock-history') ) . form([$reset], '', 'display:inline'), [ + $no_locations ? warning(__('admin_shifts.no_locations')) : '', + $no_shifttypes ? warning(__('admin_shifts.no_shifttypes')) : '', + $no_angeltypes ? warning(__('admin_shifts.no_angeltypes')) : '', msg(), form([ div('row', [ diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 3d2747fc..8294ce72 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -2074,3 +2074,12 @@ msgstr "Schicht Ort wurde von %s nach %s verschoben" msgid "notification.shift.updated.shift" msgstr "Die aktualisierte Schicht:" + +msgid "admin_shifts.no_locations" +msgstr "Es wurde noch kein Ort erstellt. Ohne können keine Schichten erstellt werden." + +msgid "admin_shifts.no_shifttypes" +msgstr "Es wurde noch kein Schichttyp erstellt. Ohne können keine Schichten erstellt werden." + +msgid "admin_shifts.no_angeltypes" +msgstr "Es wurde noch kein Engeltyp erstellt. Ohne können keine Schichten erstellt werden." diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 6ad9e303..8a844db0 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -953,3 +953,12 @@ msgstr "Actions" msgid "general.back" msgstr "Back" + +msgid "admin_shifts.no_locations" +msgstr "No location has been created yet. Shifts can't be created without one." + +msgid "admin_shifts.no_shifttypes" +msgstr "No shift type has been created yet. Shifts can't be created without one." + +msgid "admin_shifts.no_angeltypes" +msgstr "No angeltype has been created yet. Shifts can't be created without one."