summaryrefslogtreecommitdiff
path: root/includes/pages/user_myshifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2012-12-29 15:38:55 +0100
committerPhilip Häusler <msquare@notrademark.de>2012-12-29 15:38:55 +0100
commit19e3cc3434fb6d14461a8ca9bcbd277cbe31029a (patch)
tree9e7b4a02efa09bdf2fe2ea0ae68e3b659bbe9b3f /includes/pages/user_myshifts.php
parent2d0b2542c9af24a9ec4dd05010bc554010151e61 (diff)
fixed leaving done shifts by angels bug
Diffstat (limited to 'includes/pages/user_myshifts.php')
-rw-r--r--includes/pages/user_myshifts.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php
index caa92cce..bfb234ff 100644
--- a/includes/pages/user_myshifts.php
+++ b/includes/pages/user_myshifts.php
@@ -60,7 +60,7 @@ function user_myshifts() {
$shift = sql_select("SELECT * FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " AND `UID`=" . sql_escape($shifts_user['UID']) . " LIMIT 1");
if (count($shift) > 0) {
$shift = $shift[0];
- if (($shift['start'] - time() < $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) {
+ if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) {
sql_query("DELETE FROM `ShiftEntry` WHERE `id`=" . sql_escape($id) . " LIMIT 1");
$msg .= success(Get_Text("pub_myshifts_signed_off"), true);
} else
@@ -89,7 +89,10 @@ function user_myshifts() {
$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'];
+ if($user['UID'] == $user_source['UID'])
+ $shift_entries[] = '<b>' . $user_source['Nick'] . '</b>';
+ else
+ $shift_entries[] = $user_source['Nick'];
}
$html .= join(", ", $shift_entries);
$timesum += ($shift['end'] - $shift['start']) / (60*60);