コード例 #1
0
 public function createWorkspaceTeamParameters(Workspace $workspace)
 {
     $params = new WorkspaceTeamParameters();
     $params->setWorkspace($workspace);
     $params->setIsPublic(true);
     $params->setSelfRegistration(false);
     $params->setSelfUnregistration(false);
     $this->om->persist($params);
     $this->om->flush();
     return $params;
 }
コード例 #2
0
 /**
  * @EXT\Route(
  *     "/workspace/team/parameters/{params}/edit",
  *     name="claro_team_parameters_edit"
  * )
  * @EXT\ParamConverter("user", options={"authenticatedUser" = true})
  * @EXT\Template("ClarolineTeamBundle:Team:teamParamsEditForm.html.twig")
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function teamParamsEditAction(WorkspaceTeamParameters $params, User $user)
 {
     $workspace = $params->getWorkspace();
     $this->checkWorkspaceManager($workspace, $user);
     $form = $this->formFactory->create(new TeamParamsType(), $params);
     $form->handleRequest($this->request);
     if ($form->isValid()) {
         $this->teamManager->persistWorkspaceTeamParameters($params);
         return new RedirectResponse($this->router->generate('claro_team_manager_menu', ['workspace' => $workspace->getId()]));
     } else {
         return ['form' => $form->createView(), 'params' => $params, 'workspace' => $workspace];
     }
 }