From 6d97aa2d273464e3cb6703a0527793c52583d4cd Mon Sep 17 00:00:00 2001 From: msquare Date: Wed, 5 Oct 2016 22:28:39 +0200 Subject: continue working on shifts calendar renderer --- includes/model/AngelType_model.php | 11 ++++------- includes/model/Shifts_model.php | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'includes/model') diff --git a/includes/model/AngelType_model.php b/includes/model/AngelType_model.php index d01cf905..be15dc59 100644 --- a/includes/model/AngelType_model.php +++ b/includes/model/AngelType_model.php @@ -124,14 +124,11 @@ function AngelTypes() { * Returns AngelType id array */ function AngelType_ids() { - $angelType_source = sql_select("SELECT `id` FROM `AngelTypes`"); - if ($angelType_source === false) { - return false; - } - if (count($angelType_source) > 0) { - return $angelType_source; + $result = sql_select("SELECT `id` FROM `AngelTypes`"); + if ($result === false) { + engelsystem_error("Unable to load angeltypes."); } - return null; + return select_array($result, 'id', 'id'); } /** diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index 6721c30e..5a38abdd 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -49,7 +49,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter, $user) { AND `ShiftEntry`.`SID` = `Shifts`.`SID` ) )"; - } elseif ($_SESSION['user_shifts']['filled'][0] == 1) { + } elseif ($_SESSION['user_shifts']['filled'][0] == ShiftsFilter::FILLED_FILLED) { $SQL .= " AND ( nat.`count` <= entries.`count` -- cgit v1.2.3-54-g00ecf