From b47b6ed7e421ae91c5dc7607d874479bfc0e9e4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philip=20H=C3=A4usler?=
Date: Tue, 11 Oct 2011 18:35:29 +0200
Subject: [PATCH] #5 begin edit shifts feature, simplified needed angels
---
includes/pages/user_shifts.php | 6 ++----
templates/user_shifts_edit.html | 16 +++-------------
2 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php
index 4ebf6254..d0754d8b 100644
--- a/includes/pages/user_shifts.php
+++ b/includes/pages/user_shifts.php
@@ -33,10 +33,10 @@ function user_shifts() {
$room_array[$room['RID']] = $room['Name'];
// Engeltypen laden
- $types = sql_select("SELECT * FROM `AngelTypes` ORDER BY `Name`");
+ $types = sql_select("SELECT * FROM `NeededAngelTypes` JOIN `AngelTypes` ON (`NeededAngelTypes`.`angel_type_id` = `AngelTypes`.`TID`) WHERE `shift_id`=".sql_escape($shift_id)." ORDER BY `AngelTypes`.`Name`");
$needed_angel_types = array ();
foreach ($types as $type)
- $needed_angel_types[$type['TID']] = 0;
+ $needed_angel_types[$type['TID']] = $type['count'];
$name = $shift['name'];
$rid = $shift['RID'];
@@ -58,8 +58,6 @@ function user_shifts() {
'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
));
}
diff --git a/templates/user_shifts_edit.html b/templates/user_shifts_edit.html
index 705ceffe..f129e5e4 100644
--- a/templates/user_shifts_edit.html
+++ b/templates/user_shifts_edit.html
@@ -26,20 +26,10 @@
Ende:
-
- Benötigte Engel:
-
- Benötigte Engel vom Ort übernehmen.
-
-
- Es werden folgende Engel benötigt:
-
%angel_types%
+ Benötigte Engel:
+ %angel_types%
-
+
\ No newline at end of file