From cf20bc1c293d50886c306a7a5fd2e83191313611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Wed, 26 Mar 2014 18:51:34 +0100 Subject: [PATCH] test for existing shifts --- includes/pages/user_shifts.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index a80a6622..1e94b99f 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -296,6 +296,12 @@ function view_user_shifts() { $ical_shifts = array(); $days = sql_select_single_col("SELECT DISTINCT DATE(FROM_UNIXTIME(`start`)) AS `id`, DATE(FROM_UNIXTIME(`start`)) AS `name` FROM `Shifts` ORDER BY `start`"); + + if (count($days) == 0) { + error(_("The administration has not configured any shifts yet.")); + redirect('?'); + } + $rooms = sql_select("SELECT `RID` AS `id`, `Name` AS `name` FROM `Room` WHERE `show`='Y' ORDER BY `Name`"); if (count($rooms) == 0) {