diff options
author | Philip Häusler <msquare@notrademark.de> | 2014-08-24 15:49:46 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2014-08-24 15:51:42 +0200 |
commit | 0e2b2573420cf318fc2cbd605b987adf7c2b60c1 (patch) | |
tree | 853b51c6a814a5477ca7f5e709cfdbccd68652d1 /includes/model/User_model.php | |
parent | 25b5096c7e3b0879ef640afa1ab646f1e4f3f282 (diff) |
begin to refactor user shift state
Diffstat (limited to 'includes/model/User_model.php')
-rw-r--r-- | includes/model/User_model.php | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/includes/model/User_model.php b/includes/model/User_model.php index 45600676..7d2809f7 100644 --- a/includes/model/User_model.php +++ b/includes/model/User_model.php @@ -4,23 +4,6 @@ */ /** - * Returns -seconds until free if user is busy or seconds until next shift. - * 0 if there is an error or no upcoming shift. - * - * @param User $user - */ -function User_shift_state($user) { - $shifts = ShiftEntries_upcoming_for_user($user); - if ($shifts === false) - return 0; - if (count($shifts) == 0) - return 0; - if ($shifts[0]['start'] < time()) - return $shifts[0]['end'] - time(); - return $shifts[0]['start'] - time(); -} - -/** * Returns true if user is freeloader * * @param User $user |