From 9af229094d1d6ae115f1b359e76a4e26952a1ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Mon, 5 Jan 2015 13:58:34 +0100 Subject: [PATCH] display user nicks on shift json export --- includes/pages/user_shifts.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index c32fb220..eb74d640 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -727,6 +727,7 @@ function view_user_shifts() { foreach ($angeltypes as &$angeltype) { $entries = sql_select("SELECT * FROM `ShiftEntry` JOIN `User` ON (`ShiftEntry`.`UID` = `User`.`UID`) WHERE `SID`='" . sql_escape($shift['SID']) . "' AND `TID`='" . sql_escape($angeltype['id']) . "' ORDER BY `Nick`"); $entry_list = array(); + $entry_nicks = []; $freeloader = 0; foreach ($entries as $entry) { if (in_array('user_shifts_admin', $privileges)) @@ -740,8 +741,11 @@ function view_user_shifts() { $freeloader ++; } $entry_list[] = $member; + $entry_nicks[] = $entry['Nick']; } $angeltype['taken'] = count($entries) - $freeloader; + $angeltype['angels'] = $entry_nicks; + // do we need more angles of this type? if ($angeltype['count'] - count($entries) + $freeloader > 0) { $inner_text = sprintf(ngettext("%d helper needed", "%d helpers needed", $angeltype['count'] - count($entries) + $freeloader), $angeltype['count'] - count($entries) + $freeloader);