summaryrefslogtreecommitdiff
path: root/includes/view
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-29 13:18:28 +0100
committermsquare <msquare@notrademark.de>2017-12-29 13:18:28 +0100
commit14584b96114d2fcb0dabe49a9c857ff241421cc8 (patch)
treea20a378bc55b74d451b072ed0349e70120d398bb /includes/view
parentbe6bd2f3d37751c72cefe47a8e10459f66c46397 (diff)
small improvements of user view
Diffstat (limited to 'includes/view')
-rw-r--r--includes/view/User_view.php28
1 files changed, 17 insertions, 11 deletions
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 2b92923e..fff2952e 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -439,8 +439,6 @@ function User_view_myshifts($shifts, $user_source, $its_me, $tshirt_score, $tshi
'actions' => ''
];
}
- } elseif($user_source['force_active']) {
- $myshifts_table[] = success(_('You have done enough to get a t-shirt.'), true);
}
return $myshifts_table;
}
@@ -471,7 +469,22 @@ function User_view(
$tshirt_admin
) {
$user_name = htmlspecialchars($user_source['Vorname']) . ' ' . htmlspecialchars($user_source['Name']);
- $myshifts_table = User_view_myshifts($shifts, $user_source, $its_me, $tshirt_score, $tshirt_admin);
+ $myshifts_table = '';
+ if($its_me || $admin_user_privilege) {
+ $my_shifts = User_view_myshifts($shifts, $user_source, $its_me, $tshirt_score, $tshirt_admin);
+ if(count($my_shifts) > 0) {
+ $myshifts_table = table([
+ 'date' => _('Day &amp; time'),
+ 'duration' => _('Duration'),
+ 'room' => _('Location'),
+ 'shift_info' => _('Name &amp; workmates'),
+ 'comment' => _('Comment'),
+ 'actions' => _('Action')
+ ], $my_shifts);
+ } elseif($user_source['force_active']) {
+ $myshifts_table = success(_('You have done enough to get a t-shirt.'), true);
+ }
+ }
return page_with_title(
'<span class="icon-icon_angel"></span> '
@@ -529,14 +542,7 @@ function User_view(
User_groups_render($user_groups)
]),
($its_me || $admin_user_privilege) ? '<h2>' . _('Shifts') . '</h2>' : '',
- ($its_me || $admin_user_privilege) ? table([
- 'date' => _('Day &amp; time'),
- 'duration' => _('Duration'),
- 'room' => _('Location'),
- 'shift_info' => _('Name &amp; workmates'),
- 'comment' => _('Comment'),
- 'actions' => _('Action')
- ], $myshifts_table) : '',
+ $myshifts_table,
$its_me ? info(
glyph('info-sign') . _('Your night shifts between 2 and 8 am count twice.'),
true