From: Nik Okuntseff Date: Fri, 16 Mar 2018 00:17:08 +0000 (+0000) Subject: Fixed creating and editing teams by admin - broken during roles revamp. X-Git-Tag: timetracker_1.19-1~1028 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8f4b1979cdee8d42f8098f80e79e8ca0509841fb;p=timetracker.git Fixed creating and editing teams by admin - broken during roles revamp. --- diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index 002dac22..9ce34ff7 100644 --- a/WEB-INF/lib/ttImportHelper.class.php +++ b/WEB-INF/lib/ttImportHelper.class.php @@ -139,7 +139,7 @@ class ttImportHelper { foreach ($this->users as $key=>$user_item) { $user_id = ttUserHelper::insert(array( 'team_id' => $this->team_id, - 'role' => $user_item['ROLE'], + 'role_id' => $user_item['ROLE_ID'], // Note: NOT mapped value. Not implemented currently, need to fix. 'client_id' => $user_item['CLIENT_ID'], // Note: NOT mapped value, replaced in CLIENT handler. 'name' => $user_item['NAME'], 'login' => $user_item['LOGIN'], diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index a90ee7f6..1cf0d270 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -698,7 +698,8 @@ class ttTeamHelper { $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 and u.role = $role_manager) + inner join tt_users u on (u.team_id = t.id) + inner join tt_roles r on (r.id = u.role_id and r.rank = 512) where t.id = $team_id"; $res = $mdb2->query($sql); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 918caff6..a1a57597 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.46.4083 | Copyright © Anuko | +  Anuko Time Tracker 1.17.47.4084 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/admin_team_add.php b/admin_team_add.php index 6626a8d8..08a19311 100644 --- a/admin_team_add.php +++ b/admin_team_add.php @@ -107,7 +107,6 @@ if ($request->isPost()) { // Team created, now create a team manager. $user_id = ttUserHelper::insert(array( 'team_id' => $team_id, - 'role' => ROLE_MANAGER, 'role_id' => $role_id, 'name' => $cl_manager_name, 'login' => $cl_manager_login, diff --git a/register.php b/register.php index 13cf5574..92e97be6 100644 --- a/register.php +++ b/register.php @@ -109,7 +109,6 @@ if ($request->isPost()) { // Team created, now create a team manager. $user_id = ttUserHelper::insert(array( 'team_id' => $team_id, - 'role' => ROLE_MANAGER, // TODO: this is now out of sync (324 vs 512 for new role id). Work in progress. 'role_id' => $role_id, 'name' => $cl_manager_name, 'login' => $cl_manager_login,