From 723961c19e030903a0fb863a95cd5a0a0520d89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Thu, 13 Aug 2015 11:22:25 +0200 Subject: [PATCH] User shift admins see free and occupied shifts by default --- includes/pages/user_shifts.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index eb74d640..c330fc45 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -371,9 +371,13 @@ function view_user_shifts() { $_SESSION['user_shifts'] = array(); if (! isset($_SESSION['user_shifts']['filled'])) { - $_SESSION['user_shifts']['filled'] = array( + // User shift admins see free and occupied shifts by default + $_SESSION['user_shifts']['filled'] = in_array('user_shifts_admin', $privileges) ? [ + 0, + 1 + ] : [ 0 - ); + ]; } foreach (array(