From e74eb6eee4c6d5682f8f22042fff987ca8b5bec7 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 21 Sep 2020 23:10:44 +0200 Subject: [PATCH] Shifts edit: Added schedule import warning --- includes/controller/shifts_controller.php | 6 ++++++ resources/lang/de_DE/default.po | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php index 65283a7f..8036a537 100644 --- a/includes/controller/shifts_controller.php +++ b/includes/controller/shifts_controller.php @@ -2,6 +2,7 @@ use Engelsystem\Http\Exceptions\HttpForbidden; use Engelsystem\Models\Room; +use Engelsystem\Models\Shifts\ScheduleShift; use Engelsystem\ShiftSignupState; /** @@ -59,6 +60,11 @@ function shift_edit_controller() $shift_id = $request->input('edit_shift'); $shift = Shift($shift_id); + if (ScheduleShift::whereShiftId($shift['SID'])->first()) { + warning(__( + 'This shift was imported from a schedule so some changes will be overwritten with the next import.' + )); + } $rooms = []; foreach (Rooms() as $room) { diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 5e5c3884..55c0ad5b 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -452,6 +452,12 @@ msgstr "" msgid "Shift entry removed." msgstr "Schichteintrag gelöscht." +#: includes/controller/shifts_controller.php:65 +msgid "This shift was imported from a schedule so some changes will be overwritten with the next import." +msgstr "" +"Diese Schicht wurde aus einem Fahrplan importiert. " +"Dadurch werden einige Änderungen beim nächsten Import überschrieben." + #: includes/controller/shifts_controller.php:96 msgid "Please select a room." msgstr "Bitte einen Raum auswählen."