Example #1
0
 /**
  * @Route("/{id}/info", name="area_edk_message_info")
  */
 public function infoAction($id)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     return $action->run($this, $id, function ($item) {
         return ['transitions' => $item->getAllowedTransitions($this->getUser(), $this->hasRole('ROLE_AREA_MANAGER')), 'currentUser' => $this->getUser()];
     });
 }
Example #2
0
 protected function onProfile($id, Request $request)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     $entity = $this->getMembership()->getItem();
     return $action->set('profilePageSubtitle', $this->profilePageSubtitle())->fetch(function ($repository, $id) use($entity) {
         return $repository->getItem($entity, $id);
     })->run($this, $id);
 }
Example #3
0
 protected function performInfo($id)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug())->set('ajaxReloadPage', self::AJAX_RELOAD_PAGE)->set('ajaxUpdatePage', self::AJAX_UPDATE_PAGE)->set('ajaxChatFeedPage', self::AJAX_FEED_PAGE)->set('ajaxChatPostPage', self::AJAX_POST_PAGE)->set('areaInfoPage', self::AREA_INFO_PAGE)->set('isArea', $this->isArea());
     if (!$this->isArea()) {
         $action->set('approvePage', self::APPROVE_PAGE)->set('revokePage', self::REVOKE_PAGE);
     }
     return $action->run($this, $id);
 }
 /**
  * @Route("/{id}/info", name="user_area_request_info")
  */
 public function infoAction($id, Request $request)
 {
     $action = new InfoAction($this->crudInfo);
     return $action->run($this, $id, function (AreaRequest $item) use($request) {
         $settings = $this->getProjectSettings();
         $settings->setProject($item->getProject());
         $formModel = $this->getExtensionPoints()->getImplementation(CoreExtensions::AREA_REQUEST_FORM, $item->getProject()->createExtensionPointFilter()->fromSettings($settings, CoreSettings::AREA_REQUEST_FORM));
         return ['summary' => $formModel->createSummary(), 'text' => $this->chooseText($item, $request)];
     });
 }
 protected function performInfo($id, $routeInfoLink, $areaInfoLink, Request $request)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     $action->set('isArea', $this->isArea());
     $action->set('routeInfoLink', $routeInfoLink);
     $action->set('areaInfoLink', $areaInfoLink);
     return $action->run($this, $id);
 }
Example #6
0
 /**
  * @Route("/{id}/info", name="admin_user_info")
  */
 public function infoAction($id)
 {
     $action = new InfoAction($this->crudInfo);
     return $action->run($this, $id, function (User $user) {
         $loaders = $this->getExtensionPoints()->findImplementations(CoreExtensions::MEMBERSHIP_LOADER, new ExtensionPointFilter());
         $places = [];
         foreach ($loaders as $loader) {
             foreach ($loader->loadProjectRepresentations($user) as $place) {
                 $places[] = $place;
             }
         }
         return ['places' => $places];
     });
 }
 /**
  * @Route("/{id}/info", name="project_course_info")
  */
 public function infoAction($id)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     return $action->run($this, $id);
 }
Example #8
0
 /**
  * @Route("/{id}/info", name="project_area_info")
  */
 public function infoAction($id, Request $request)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     $action->set('ajaxMembersPage', 'project_area_ajax_members');
     return $action->run($this, $id, function (Area $item) use($request) {
         $event = $this->get('event_dispatcher')->dispatch(CantigaEvents::UI_CTXMENU_PROJECT_AREA, new ContextMenuEvent($item));
         $html = $this->renderInformationExtensions(CoreExtensions::AREA_INFORMATION, $request, $item);
         $formModel = $this->extensionPointFromSettings(CoreExtensions::AREA_FORM, CoreSettings::AREA_FORM);
         return ['progressBarColor' => $item->getPercentCompleteness() < 50 ? 'red' : ($item->getPercentCompleteness() < 80 ? 'orange' : 'green'), 'summary' => $formModel->createSummary(), 'extensions' => $html, 'links' => $event->getLinks()];
     });
 }
 /**
  * @Route("/{id}/info", name="project_area_request_info")
  */
 public function infoAction($id, Request $request)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     return $action->run($this, $id, function (AreaRequest $item) use($request) {
         $formModel = $this->extensionPointFromSettings(CoreExtensions::AREA_REQUEST_FORM, CoreSettings::AREA_REQUEST_FORM);
         return ['summary' => $formModel->createSummary(), 'text' => $this->chooseText($item, $request), 'actions' => $this->chooseActionsForState($item)];
     });
 }
Example #10
0
 /**
  * @Route("/{id}/info", name="project_area_group_info")
  */
 public function infoAction($id, Request $request)
 {
     $repository = $this->get(self::REPOSITORY_NAME);
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     return $action->run($this, $id, function ($group) use($repository, $request) {
         $html = $this->renderInformationExtensions(CoreExtensions::PROJECT_GROUP_INFORMATION, $request, $group);
         return ['areas' => $repository->findGroupAreas($group), 'extensions' => $html];
     });
 }
Example #11
0
 /**
  * @Route("/{id}/info", name="group_area_info")
  */
 public function infoAction($id, Request $request)
 {
     $action = new InfoAction($this->crudInfo);
     $action->slug($this->getSlug());
     $action->set('ajaxMembersPage', 'group_area_ajax_members');
     return $action->run($this, $id, function (Area $item) use($request) {
         $html = $this->renderInformationExtensions(CoreExtensions::AREA_INFORMATION, $request, $item);
         $formModel = $this->extensionPointFromSettings(CoreExtensions::AREA_FORM, CoreSettings::AREA_FORM);
         return ['progressBarColor' => $item->getPercentCompleteness() < 50 ? 'red' : ($item->getPercentCompleteness() < 80 ? 'orange' : 'green'), 'summary' => $formModel->createSummary(), 'extensions' => $html];
     });
 }