]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttTeamHelper.class.php
Dropped legacy role field.
[timetracker.git] / WEB-INF / lib / ttTeamHelper.class.php
index 1cf0d270d3efe4b555968b924f18f9a24b1a0831..b30b9ccda5bcfb7b71ecb97ab36c373b18cdc023 100644 (file)
@@ -71,6 +71,7 @@ class ttTeamHelper {
   // The getActiveUsers obtains all active users in a given team.
   static function getActiveUsers($options = null) {
     global $user;
+    global $i18n;
     $mdb2 = getConnection();
 
     if (isset($options['getAllFields']))
@@ -82,6 +83,9 @@ class ttTeamHelper {
     if (is_a($res, 'PEAR_Error'))
       return false;
     while ($val = $res->fetchRow()) {
+      // Localize top manager role name, as it is not localized in db.
+      if ($val['rank'] == 512)
+        $val['role_name'] = $i18n->getKey('role.top_manager.label');
       $user_list[] = $val;
     }
 
@@ -695,7 +699,6 @@ class ttTeamHelper {
     $result = array();
     $mdb2 = getConnection();
 
-    $role_manager = ROLE_MANAGER;
     $sql = "select t.name as team_name, u.id as manager_id, u.name as manager_name, u.login as manager_login, u.email as manager_email
       from tt_teams t
       inner join tt_users u on (u.team_id = t.id)