From d7152ebc0918e9a29675bfe3dca9f20e821d1e4a Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 26 Dec 2020 02:35:49 +0100 Subject: [PATCH] Allow 0 minutes before/after schedule, fix room sorting --- includes/model/Room_model.php | 2 +- includes/pages/schedule/ImportSchedule.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php index 5c232648..eb788ebe 100644 --- a/includes/model/Room_model.php +++ b/includes/model/Room_model.php @@ -36,7 +36,7 @@ function Room_validate_name(string $name, int $room_id) */ function Rooms() { - return Room::all()->sortBy('name'); + return Room::orderBy('name')->get(); } /** diff --git a/includes/pages/schedule/ImportSchedule.php b/includes/pages/schedule/ImportSchedule.php index 455f445c..22f0391d 100644 --- a/includes/pages/schedule/ImportSchedule.php +++ b/includes/pages/schedule/ImportSchedule.php @@ -130,8 +130,8 @@ class ImportSchedule extends BaseController 'name' => 'required', 'url' => 'required', 'shift_type' => 'required|int', - 'minutes_before' => 'required|int', - 'minutes_after' => 'required|int', + 'minutes_before' => 'int', + 'minutes_after' => 'int', ]); if (!isset($this->getShiftTypes()[$data['shift_type']])) {