Esempio n. 1
0
 public function removeAssignee(TBGIdentifiableClass $assignee)
 {
     $user_id = 0;
     $team_id = 0;
     if ($assignee instanceof TBGUser) {
         $user_id = $assignee->getID();
         TBGProjectAssignedUsersTable::getTable()->removeUserFromProject($this->getID(), $assignee->getID());
         foreach ($this->getAssignedUsers() as $user) {
             if ($user->getID() == $user_id) {
                 return;
             }
         }
     } else {
         $team_id = $assignee->getID();
         TBGProjectAssignedTeamsTable::getTable()->removeTeamFromProject($this->getID(), $assignee->getID());
         foreach ($this->getAssignedTeams() as $team) {
             if ($team->getID() == $team_id) {
                 return;
             }
         }
     }
     TBGContext::removeAllPermissionsForCombination($user_id, 0, $team_id, $this->getID());
 }