Skip to content
Snippets Groups Projects
Select Git revision
  • fa756948e5205a00fcf4930d79ce948b41c78980
  • master default protected
  • 1.4.2
  • 1.1.4
4 results

00-oracle-generate-schema-SYGAL.sql

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    IndexController.php 1.21 KiB
    <?php
    
    namespace Application\Controller;
    
    use Zend\Mvc\Controller\AbstractActionController;
    use Zend\View\Model\ViewModel;
    use Application\Interfaces\PersonnelAwareInterface;
    
    /**
     *
     */
    class IndexController extends AbstractActionController
    {
        use \Application\Service\Traits\ContextAwareTrait,
            \Application\Service\Traits\AnneeAwareTrait
        ;
    
        /**
         *
         * @return type
         */
        public function indexAction()
        {
            /* Prise en compte du changement d'année!! */
            $annee = $this->params()->fromQuery('annee');
            if ($annee){
                $annee = $this->getServiceAnnee()->get($annee);
                $this->getServiceContext()->setAnnee($annee);
            }
    
            $role = $this->getServiceContext()->getSelectedIdentityRole();
    
            $view = new ViewModel([
                'annee' => $this->getServiceContext()->getAnnee(),
                'role'  => $role,
            ]);
    
            if ($role && $personnel = $role->getPersonnel()) {
                // URL de la page affichant les indicateurs auxquels est abonné l'utilisateur
                $view->setVariable('abonnementsUrl', $this->url()->fromRoute('indicateur/abonnements', ['personnel' => $personnel->getId()]));
            }
    
            return $view;
        }
    }