summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/controller/users_controller.php8
-rw-r--r--includes/view/User_view.php4
2 files changed, 9 insertions, 3 deletions
diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php
index ae297851..aca20a2c 100644
--- a/includes/controller/users_controller.php
+++ b/includes/controller/users_controller.php
@@ -224,6 +224,12 @@ function user_controller()
if ($user_source['api_key'] == '') {
User_reset_api_key($user_source, false);
}
+
+ if($user_source['force_active']) {
+ $tshirt_score = _('Enough');
+ } else {
+ $tshirt_score = round(User_tshirt_score($user_source), 2) . 'h';
+ }
return [
$user_source['Nick'],
@@ -235,7 +241,7 @@ function user_controller()
User_groups($user_source),
$shifts,
$user['UID'] == $user_source['UID'],
- User_tshirt_score($user_source),
+ $tshirt_score,
in_array('admin_active', $privileges)
)
];
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 16267635..8d47dc47 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -429,10 +429,10 @@ function User_view_myshifts($shifts, $user_source, $its_me, $tshirt_score, $tshi
'comment' => '',
'actions' => ''
];
- if ($its_me || $tshirt_admin) {
+ if (config('enable_tshirt_size', false) && ($its_me || $tshirt_admin)) {
$myshifts_table[] = [
'date' => '<b>' . _('Your t-shirt score') . '&trade;:</b>',
- 'duration' => '<b>' . round($tshirt_score, 2) . ' h</b>',
+ 'duration' => '<b>' . $tshirt_score . '</b>',
'room' => '',
'shift_info' => '',
'comment' => '',