summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-03-26 18:51:34 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-03-26 18:51:34 +0100
commitcf20bc1c293d50886c306a7a5fd2e83191313611 (patch)
tree9afae3dfbcf1f77b5b840cd3f4fb12d8e8032775 /includes
parentdc7a56f4225837964cc2ec06060cc0fae1929e76 (diff)
test for existing shifts
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/user_shifts.php6
1 files changed, 6 insertions, 0 deletions
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) {