From 403c11047bf234c415b0aa7462d14bc758eedc04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Tue, 11 Oct 2011 18:29:26 +0200 Subject: [PATCH] #5 begin edit shifts feature --- includes/pages/user_shifts.php | 55 ++++++++++++++++++++++++++++++++- templates/user_shifts_edit.html | 45 +++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 templates/user_shifts_edit.html 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`"); diff --git a/templates/user_shifts_edit.html b/templates/user_shifts_edit.html new file mode 100644 index 00000000..705ceffe --- /dev/null +++ b/templates/user_shifts_edit.html @@ -0,0 +1,45 @@ + +
+
+ %msg% +

+ + +

+

+ %room_select% +

+

+ + +

+

+ + +

+

Benötigte Engel:

+

+ Benötigte Engel vom Ort übernehmen. +

+

+ Es werden folgende Engel benötigt: +

%angel_types% +

+ +

+
+