summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2012-12-28 20:55:13 +0100
committerPhilip Häusler <msquare@notrademark.de>2012-12-28 20:55:13 +0100
commit7044c07c009ccaf4a0d9f27ab24e0cddaddcbae4 (patch)
tree70eca6f5efb8d1c4f6aa5bef8747e2e27615076a
parentda14940813fc5a37add81733412cf6eed23a3fab (diff)
link to edit page and shift mates on myshifts page
-rw-r--r--includes/pages/admin_angel_types.php4
-rw-r--r--includes/pages/user_myshifts.php21
-rw-r--r--public/css/base.css14
-rw-r--r--templates/user_myshifts.html2
4 files changed, 36 insertions, 5 deletions
diff --git a/includes/pages/admin_angel_types.php b/includes/pages/admin_angel_types.php
index d5841d1c..bb4e1d52 100644
--- a/includes/pages/admin_angel_types.php
+++ b/includes/pages/admin_angel_types.php
@@ -86,11 +86,11 @@ function admin_angel_types() {
return page(array (
buttons(array (
- button(page_link_to('admin_angel_types'), "Back", 'back')
+ button(page_link_to('admin_angel_types'), "Back", 'cancel')
)),
sprintf("Do you want to delete angel type %s?", $name),
buttons(array (
- button(page_link_to('admin_angel_types') . '&show=delete&id=' . $id . '&ack', "Delete", 'delete')
+ button(page_link_to('admin_angel_types') . '&show=delete&id=' . $id . '&ack', "Delete", 'ok')
))
));
} else
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index f38a81d0..353eac56 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -15,8 +15,11 @@ function user_myshifts() {
list ($shifts_user) = sql_select("SELECT * FROM `User` WHERE `UID`=" . sql_escape($id) . " LIMIT 1");
- if ($id != $user['UID'])
+ if ($id != $user['UID']) {
$msg .= info(sprintf("You are viewing %s's shifts.", $shifts_user['Nick']), true);
+ if(in_array('admin_user', $privileges))
+ $msg .= buttons(array(button(page_link_to('admin_user') . '&amp;id=' . $shifts_user['UID'], "Edit " . $shifts_user['Nick'], 'edit')));
+ }
if (isset ($_REQUEST['reset'])) {
if ($_REQUEST['reset'] == "ack") {
@@ -76,7 +79,21 @@ function user_myshifts() {
$html .= '<td>' . date("Y-m-d", $shift['start']) . '</td>';
$html .= '<td>' . date("H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . '</td>';
$html .= '<td>' . $shift['Name'] . '</td>';
- $html .= '<td>' . $shift['name'] . '</td>';
+ $html .= '<td>' . $shift['name'];
+
+ $needed_angel_types_source = 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($needed_angel_types_source as $needed_angel_type) {
+ $html .= '<br><b>' . $needed_angel_type['name'] . ':</b> ';
+
+ $users_source = sql_select("SELECT `User`.* FROM `ShiftEntry` JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` WHERE `ShiftEntry`.`SID`=" . sql_escape($shift['SID']) . " AND `ShiftEntry`.`TID`=" . sql_escape($needed_angel_type['id']));
+ $shift_entries = array();
+ foreach($users_source as $user_source) {
+ $shift_entries[] = $user_source['Nick'];
+ }
+ $html .= join(", ", $shift_entries);
+ }
+
+ $html .= '</td>';
$html .= '<td>' . $shift['Comment'] . '</td>';
$html .= '<td>';
if ($id == $user['UID'])
diff --git a/public/css/base.css b/public/css/base.css
index 6b030319..a97f31c4 100644
--- a/public/css/base.css
+++ b/public/css/base.css
@@ -350,6 +350,20 @@ tr:hover .hidden {
background: #fff;
}
+.button.edit {
+ background: url('../pic/icons/pencil.png') 2px 2px no-repeat;
+ padding-left: 20px;
+}
+
+.button.ok {
+ background: url('../pic/icons/tick.png') 2px 2px no-repeat;
+ padding-left: 20px;
+}
+
+.button.cancel {
+ background: url('../pic/icons/cross.png') 2px 2px no-repeat;
+ padding-left: 20px;
+}
.form {
border: 1px solid #888;
diff --git a/templates/user_myshifts.html b/templates/user_myshifts.html
index 43e97b03..178ad684 100644
--- a/templates/user_myshifts.html
+++ b/templates/user_myshifts.html
@@ -15,7 +15,7 @@
Ort
</th>
<th>
- Name
+ Name &amp; Kollegen
</th>
<th>
Kommentar