Example #1
0
 /**
  * Redirect from an appliy path
  * @param string $path
  * @return string
  */
 public function redirectApplyPath($path)
 {
     $this->redirectPath('apply/' . $this->_application->getProgram()->getShortName() . '/' . $this->_application->getCycle()->getName() . '/' . $path);
 }
Example #2
0
 public function getMaximumDisplayForApplication(\Jazzee\Entity\Application $application)
 {
     $display = new \Jazzee\Display\Union();
     $hasProgramRole = false;
     foreach ($this->roles as $role) {
         if (!$role->isGlobal() and $role->getProgram()->getId() == $application->getProgram()->getId()) {
             $hasProgramRole = true;
             if ($roleDisplay = $role->getDisplayForApplication($application)) {
                 $display->addDisplay($roleDisplay);
             } else {
                 $display->addDisplay(new \Jazzee\Display\FullApplication($application));
                 break;
                 //we interupt the loop here because once we have included a full display there is no reason to continue
             }
         }
     }
     //Temporary solution global users dont generally have program roles, but get access to all the elementns
     //for any action they can see
     if (!$hasProgramRole) {
         $display->addDisplay(new \Jazzee\Display\FullApplication($application));
     }
     return $display;
 }