@EXT\Route(
"/team/{team}/manager/index",
name="claro_team_manager_team_index"
)
@EXT\ParamConverter("manager", options={"authenticatedUser" = true})
@EXT\Template()

@param Team $team
@param User $user
964714
public function managerTeamIndexAction(Team $team, User $manager)
    {
        $workspace = $team->getWorkspace();
        $this->checkWorkspaceManager($workspace, $manager);
        $users = $team->getUsers();
        $params = $this->teamManager->getParametersByWorkspace($workspace);

        return array(
            'workspace' => $workspace,
            'users' => $users,
            'team' => $team,
            'params' => $params
        );
    }
491900
public function onMerge(MergeUsersEvent $event)
    {
        // Replace team manager of Team nodes
        $teamManagerCount = $this->manager->replaceManager($event->getRemoved(), $event->getKept());
        $event->addMessage("[ClarolineTeamBundle] updated Team count (by team manager): $teamManagerCount");

        // Replace user of Team nodes
        $teamUserCount = $this->manager->replaceUser($event->getRemoved(), $event->getKept());
        $event->addMessage("[ClarolineTeamBundle] updated Team count (by user): $teamUserCount");
    }
610542
private function getManagerForUser($user)
    {
        $tries = [];

        foreach ($this->managers as $manager) {
            if ($manager->supportsUser($user)) {
                return $manager;
            }

            $tries[] = get_class($manager);
        }

        throw new \RuntimeException(
            sprintf(
                'User "%s" is not supported by any UserManager. Tried "%s".',
                $user,
                implode('", "', $tries)
            )
        );
    }
630208
public function teamUserslistAction(Team $team)
    {
        $this->checkToolAccess($team->getWorkspace());

        $users = $team->getUsers();

        return array('team' => $team, 'users' => $users);
    }
642605
public function getTeamDrop(Dropzone $dropzone, Team $team, User $user, $withCreation = false)
    {
        $drop = $this->dropRepo->findOneBy(['dropzone' => $dropzone, 'teamUuid' => $team->getUuid()]);

        if ($withCreation) {
            if (empty($drop)) {
                $this->om->startFlushSuite();
                $drop = new Drop();
                $drop->setUser($user);
                $drop->setDropzone($dropzone);
                $drop->setTeamId($team->getId());
                $drop->setTeamUuid($team->getUuid());
                $drop->setTeamName($team->getName());

                foreach ($team->getRole()->getUsers() as $teamUser) {
                    $drop->addUser($teamUser);
                    /* TODO: checks that a valid status is not overwritten */
                    $this->resourceEvalManager->createResourceEvaluation(
                        $dropzone->getResourceNode(),
                        $teamUser,
                        null,
                        ['status' => AbstractResourceEvaluation::STATUS_INCOMPLETE]
                    );
                }
                $this->om->persist($drop);
                $this->om->endFlushSuite();

                $this->eventDispatcher->dispatch('log', new LogDropStartEvent($dropzone, $drop));
            } elseif (!$drop->hasUser($user)) {
                $this->om->startFlushSuite();
                $drop->addUser($user);
                $this->resourceEvalManager->createResourceEvaluation(
                    $dropzone->getResourceNode(),
                    $user,
                    null,
                    ['status' => AbstractResourceEvaluation::STATUS_INCOMPLETE]
                );
                $this->om->persist($drop);
                $this->om->endFlushSuite();
            }
        }

        return $drop;
    }
477864
public function update(UserRequest $request, User $user)
    {
        $user->update($request->all());

        return $this->makeRedirect(true, 'admin.users.index', __('update'));
    }
206785
public function update(User $user, MemberCategory $memberCategory)
    {
        return $this->allowForRoleOnTeam($user, 'Coach', $memberCategory->team_id);
    }
12318
private function mapUserToVersion(User $user, Request $request)
    {
        $content = $this->repository->getContentService()->loadContent($user->id);
        $request->headers->set('Url', $request->getPathInfo());

        return new Version(
            $content,
            $this->repository->getContentTypeService()->loadContentType($content->contentInfo->contentTypeId),
            $this->repository->getContentService()->loadRelations($content->getVersionInfo()),
            $request->getPathInfo()
        );
    }
480551
public function getTeamDrops(Dropzone $dropzone, User $user)
    {
        $drops = $this->dropRepo->findTeamDrops($dropzone, $user);

        return $drops;
    }
1001855
public function userTeamIndexAction(Team $team, User $currentUser)
    {
        $workspace = $team->getWorkspace();
        $this->checkToolAccess($workspace);
        $isTeamMember = $this->isTeamMember($team, $currentUser);
        $isTeamManager = $this->isTeamManager($team, $currentUser);

        if (!$isTeamMember && !$isTeamManager) {

            throw new AccessDeniedException();
        }
        $users = $team->getUsers();
        $params = $this->teamManager->getParametersByWorkspace($workspace);

        return array(
            'workspace' => $workspace,
            'currentUser' => $currentUser,
            'users' => $users,
            'team' => $team,
            'params' => $params,
            'isTeamMember' => $isTeamMember,
            'isTeamManager' => $isTeamManager
        );
    }
399063
public function users($team, $params = array(), $options = array())
    {
        $path = sprintf("/teams/%s/users", $team);
        return $this->client->getCollection($path, $params, $options);
    }
497932
public function editAction(User $user)
    {
        $this->assignElectronicAddressOptions();

        $this->view->assignMultiple([
            'currentUser' => $this->currentUser,
            'user' => $user,
            'availableRoles' => $this->policyService->getRoles()
        ]);
    }
487239
public function bulletinPointsDiversWidgetAction(User $user)
    {
        $pointsDivers = $this->totauxManager->getMoyennePointsDivers($user);

        $params = array('pointsDivers' => $pointsDivers);

        return $this->render('LaurentBulletinBundle::BulletinPointsDiversWidget.html.twig', $params);
    }
831757
public function index(Request $request)
    {
        $teams = $this->service->paginated($request->user()->id);
        return view('team.index')->with('teams', $teams);
    }
511848
public function teamEditFormAction(Team $team, User $user)
    {
        $workspace = $team->getWorkspace();
        $isWorkspaceManager = $this->isWorkspaceManager($workspace, $user);
        $isTeamManager = $this->isTeamManager($team, $user);

        if (!$isWorkspaceManager && !$isTeamManager) {

            throw new AccessDeniedException();
        }
        $form = $this->formFactory->create(new TeamEditType(), $team);

        return array(
            'form' => $form->createView(),
            'team' => $team,
            'workspace' => $workspace
        );
    }
254824
public function addTeams(ArrayCollection $teams)
    {
        foreach ($teams as $team) {
            $team->addUser($this);
            $this->teams->add($team);
        }
    }
505680
public function teamParamsEditFormAction(
        WorkspaceTeamParameters $params,
        User $user
    )
    {
        $workspace = $params->getWorkspace();
        $this->checkWorkspaceManager($workspace, $user);
        $form = $this->formFactory->create(new TeamParamsType(), $params);

        return array(
            'form' => $form->createView(),
            'params' => $params,
            'workspace' => $workspace
        );
    }