From 403c11047bf234c415b0aa7462d14bc758eedc04 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Tue, 11 Oct 2011 18:29:26 +0200 Subject: #5 begin edit shifts feature --- includes/pages/user_shifts.php | 55 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'includes/pages/user_shifts.php') diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 3c2e9330..4ebf6254 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -1,6 +1,7 @@ $type['TID'], + 'type' => $type['Name'], + 'value' => $needed_angel_types[$type['TID']] + )); + } + return template_render('../templates/user_shifts_edit.html', array ( + 'msg' => $msg, + 'name' => $name, + 'room_select' => $room_select, + 'start' => date("Y-m-d H:i", $start), + 'end' => date("Y-m-d H:i", $end), + 'angelmode_location_selected' => $_REQUEST['angelmode'] == 'location' ? 'checked="checked"' : '', + 'angelmode_manually_selected' => $_REQUEST['angelmode'] == 'manually' ? 'checked="checked"' : '', + 'angel_types' => $angel_types + )); + } // Schicht komplett löschen (nur für admins/user mit user_shifts_admin privileg) elseif (isset ($_REQUEST['delete_shift']) && in_array('user_shifts_admin', $privileges)) { if (isset ($_REQUEST['delete_shift']) && preg_match("/^[0-9]*$/", $_REQUEST['delete_shift'])) @@ -129,7 +182,7 @@ function user_shifts() { foreach ($shifts as $shift) { $shift_row = '' . date(($id == 0 ? "Y-m-d " : "") . "H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . ($id == 0 ? "
" . $shift['Name'] : "") . '' . $shift['name']; if (in_array('admin_shifts', $privileges)) - $shift_row .= ' [x]'; + $shift_row .= ' [edit] [x]'; $shift_row .= '
'; $show_shift = false; $angeltypes = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`TID`) WHERE `shift_id`=" . sql_escape($shift['SID']) . " AND `count` > 0 ORDER BY `AngelTypes`.`Name`"); -- cgit v1.2.3-70-g09d2