/**
  * Display path player
  * @param  \Innova\PathBundle\Entity\Path\Path $path
  * @return array
  *
  * @Route(
  *      "/{id}",
  *      name     = "innova_path_player_wizard",
  *      defaults = { "stepId" = null },
  *      options  = { "expose" = true }
  * )
  * @Template("InnovaPathBundle:Wizard:player.html.twig")
  */
 public function displayAction(Path $path)
 {
     // Check User credentials
     $this->pathManager->checkAccess('OPEN', $path);
     $resourceIcons = $this->om->getRepository('ClarolineCoreBundle:Resource\\ResourceIcon')->findByIsShortcut(false);
     return array('_resource' => $path, 'userProgression' => $this->pathManager->getUserProgression($path), 'resourceIcons' => $resourceIcons, 'editEnabled' => $this->pathManager->isAllow('EDIT', $path));
 }
 /**
  * Display dashboard for path of users.
  *
  * @Route(
  *     "/userpath/{id}",
  *     name         = "innova_path_manage_results",
  *     requirements = {"id" = "\d+"},
  *     options      = {"expose" = true}
  * )
  * @Method("GET")
  * @ParamConverter("path", class="InnovaPathBundle:Path\Path", options={"id" = "id"})
  * @Template("InnovaPathBundle::manageResults.html.twig")
  */
 public function displayStepUnlockAction(Path $path)
 {
     //prevent direct access
     $this->pathManager->checkAccess('EDIT', $path);
     $data = [];
     $workspace = $path->getWorkspace();
     //retrieve users having access to the WS
     //TODO Optimize
     $users = $this->om->getRepository('ClarolineCoreBundle:User')->findUsersByWorkspace($workspace);
     $userdata = [];
     //for all users in the WS
     foreach ($users as $user) {
         //get their progression
         $userdata[] = ['user' => $user, 'progression' => $this->pathManager->getUserProgression($path, $user), 'locked' => $this->pathManager->getPathLockedProgression($path)];
     }
     $data = ['path' => $path, 'userdata' => $userdata];
     return ['_resource' => $path, 'workspace' => $workspace, 'data' => $data];
 }
 /**
  * Display path player.
  *
  * @param \Innova\PathBundle\Entity\Path\Path $path
  *
  * @return array
  *
  * @Route(
  *      "/{id}",
  *      name     = "innova_path_player_wizard",
  *      options  = { "expose" = true }
  * )
  * @Template("InnovaPathBundle:Wizard:player.html.twig")
  */
 public function displayAction(Path $path)
 {
     // Check User credentials
     $this->pathManager->checkAccess('OPEN', $path);
     return ['_resource' => $path, 'workspace' => $path->getWorkspace(), 'userProgression' => $this->pathManager->getUserProgression($path), 'editEnabled' => $this->pathManager->isAllow('EDIT', $path), 'totalProgression' => $this->userProgressionManager->calculateUserProgressionInPath($path)];
 }