Shifts edit: Added schedule import warning

This commit is contained in:
Igor Scheller 2020-09-21 23:10:44 +02:00 committed by msquare
parent 6c3d51272c
commit e74eb6eee4
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@
use Engelsystem\Http\Exceptions\HttpForbidden; use Engelsystem\Http\Exceptions\HttpForbidden;
use Engelsystem\Models\Room; use Engelsystem\Models\Room;
use Engelsystem\Models\Shifts\ScheduleShift;
use Engelsystem\ShiftSignupState; use Engelsystem\ShiftSignupState;
/** /**
@ -59,6 +60,11 @@ function shift_edit_controller()
$shift_id = $request->input('edit_shift'); $shift_id = $request->input('edit_shift');
$shift = Shift($shift_id); $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 = []; $rooms = [];
foreach (Rooms() as $room) { foreach (Rooms() as $room) {

View File

@ -452,6 +452,12 @@ msgstr ""
msgid "Shift entry removed." msgid "Shift entry removed."
msgstr "Schichteintrag gelöscht." 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 #: includes/controller/shifts_controller.php:96
msgid "Please select a room." msgid "Please select a room."
msgstr "Bitte einen Raum auswählen." msgstr "Bitte einen Raum auswählen."