X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttImportHelper.class.php;h=002dac2212f9bb3c5d05fabe9cc32a6dcf463f41;hb=813f43a9406fb5adfb8c6e89cd97b06a11da58c9;hp=b6c7b8b3ae8e9ac1080e74171fa8261c39a277ee;hpb=1ad0313b11df884c04ca0354abcbc18e4b334537;p=timetracker.git diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index b6c7b8b3..002dac22 100644 --- a/WEB-INF/lib/ttImportHelper.class.php +++ b/WEB-INF/lib/ttImportHelper.class.php @@ -53,6 +53,7 @@ class ttImportHelper { // The following arrays are maps between entity ids in the file versus the database. // In the file they are sequential (1,2,3...) while in the database the entities have different ids. var $userMap = array(); // User ids. + var $roleMap = array(); // Role ids. var $projectMap = array(); // Project ids. var $taskMap = array(); // Task ids. var $clientMap = array(); // Client ids. @@ -314,12 +315,20 @@ class ttImportHelper { } if ($name == 'ROLE' && $this->canImport) { - ttRoleHelper::insert(array( + $this->roleMap[$this->currentElement['ID']] = ttRoleHelper::insert(array( 'team_id' => $this->team_id, 'name' => $this->currentElement['NAME'], 'rank' => $this->currentElement['RANK'], 'rights' => $this->currentElement['RIGHTS'], 'status' => $this->currentElement['STATUS'])); + + // Update role_id for tt_users to a mapped value. + // We did not do it during user insertion because roleMap was not ready then. + // TODO: write setMappedRole function. + /* + if ($this->currentElement['ID'] != $this->roleMap[$this->currentElement['ID']]) + ttRoleHelper::setMappedRole($this->team_id, $this->currentElement['ID'], $this->roleMap[$this->currentElement['ID']]); + */ } $this->currentTag = ''; }