diff options
author | Philip Häusler <msquare@notrademark.de> | 2014-08-23 01:55:18 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2014-08-23 01:55:18 +0200 |
commit | f5a094fd8b32d44767f7fc30a65f407f4e1d9945 (patch) | |
tree | eac9a223e103c3066ef6e0b57e0bf215eaa89a72 /includes/controller/users_controller.php | |
parent | 74647e16d37fac9425a4561b49618b52cdc3e75c (diff) |
add user view, better bootstrap
Diffstat (limited to 'includes/controller/users_controller.php')
-rw-r--r-- | includes/controller/users_controller.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index f65f54e3..77997278 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -35,9 +35,22 @@ function user_controller() { $admin_user_privilege = in_array('admin_user', $privileges); + $shifts = Shifts_by_user($user_source); + foreach ($shifts as &$shift) { + $shift['needed_angeltypes'] = sql_select("SELECT DISTINCT `AngelTypes`.* FROM `ShiftEntry` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` WHERE `ShiftEntry`.`SID`=" . sql_escape($shift['SID']) . " ORDER BY `AngelTypes`.`name`"); + foreach ($shift['needed_angeltypes'] as &$needed_angeltype) { + $needed_angeltype['users'] = sql_select(" + SELECT `ShiftEntry`.`freeloaded`, `User`.* + FROM `ShiftEntry` + JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` + WHERE `ShiftEntry`.`SID`=" . sql_escape($shift['SID']) . " + AND `ShiftEntry`.`TID`=" . sql_escape($needed_angeltype['id'])); + } + } + return array( $user_source['Nick'], - User_view($user_source) + User_view($user_source, $admin_user_privilege, User_is_freeloader($user_source), User_shift_state($user_source), User_angeltypes($user_source), User_groups($user_source), $shifts, $user['UID'] == $user_source['UID']) ); } |