Loading module/Application/config/others/these.config.php +31 −11 Changes for module/Application/config/others/these.config.php: 31 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ return [ 'these', 'detail-identite', 'rechercher', 'depot-accueil' ], 'roles' => 'user', ], Loading Loading @@ -302,6 +303,18 @@ return [ 'router' => [ 'routes' => [ 'depot' => [ 'type' => 'Literal', 'options' => [ 'route' => '/depot', 'defaults' => [ '__NAMESPACE__' => 'Application\Controller', 'controller' => 'These', 'action' => 'depot-accueil', ], ], 'may_terminate' => true, ], 'these' => [ 'type' => 'Literal', 'options' => [ Loading Loading @@ -800,6 +813,13 @@ return [ 'label' => 'Thèses', 'route' => 'these', 'resource' => PrivilegeController::getResourceId('Application\Controller\These', 'index'), 'pages' => [], ], 'depot' => [ 'order' => -99, 'label' => 'Dépôt', 'route' => 'depot', 'resource' => PrivilegeController::getResourceId('Application\Controller\These', 'index'), 'pages' => [ 'roadmap' => [ 'label' => 'Feuille de route', Loading @@ -814,17 +834,6 @@ return [ 'etape' => null, 'visible' => 'Assertion\\These', ], 'divider-roadmap' => [ 'label' => null, 'uri' => '', 'withtarget' => true, 'paramsInject' => [ 'these', ], 'class' => 'divider', ], 'identite' => [ 'label' => 'Thèse', 'route' => 'these/identite', Loading @@ -837,6 +846,17 @@ return [ 'etape' => null, 'visible' => 'Assertion\\These', ], 'divider-roadmap' => [ 'label' => null, 'uri' => '', 'withtarget' => true, 'paramsInject' => [ 'these', ], 'class' => 'divider', ], 'points-de-vigilance' => [ 'label' => 'Points de vigilance', 'route' => 'these/points-de-vigilance', Loading module/Application/src/Application/Controller/TheseController.php +30 −0 Changes for module/Application/src/Application/Controller/TheseController.php: 30 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -172,6 +172,36 @@ class TheseController extends AbstractController return $this->redirect()->toRoute('these', [], ['query' => $queryParams]); } /** * Action servant l'accueil du menu Dépôt : * - pour un doctorant / directeur affiche la liste des thèses en cours * - pour un bu et mdd la liste des thèses en cours dans son établissement * - sinon un message disant de sélectionner une thèse via l'annuaire **/ public function depotAccueilAction() { $role = $this->userContextService->getSelectedIdentityRole(); $user = $this->userContextService->getIdentityDb(); $theses = []; switch ($role->getCode()) { case Role::CODE_DOCTORANT : $theses = $this->getTheseService()->getRepository()->findTheseByDoctorant($user->getIndividu()); break; case Role::CODE_DIRECTEUR_THESE : case Role::CODE_CODIRECTEUR_THESE : $theses = $this->getTheseService()->getRepository()->findTheseByActeur($user->getIndividu()); break; default : break; } return new ViewModel([ 'role' => $role, 'theses' => $theses, ]); } public function roadmapAction() { $these = $this->requestedThese(); Loading module/Application/src/Application/Entity/Db/Repository/TheseRepository.php +35 −0 Changes for module/Application/src/Application/Entity/Db/Repository/TheseRepository.php: 35 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application\Entity\Db\Repository; use Application\Entity\Db\Etablissement; use Application\Entity\Db\Individu; use Application\Entity\Db\These; use Application\ORM\Query\Functions\Year; use Application\QueryBuilder\TheseQueryBuilder; Loading Loading @@ -113,5 +114,39 @@ class TheseRepository extends DefaultEntityRepository return $results; } /** * @param Individu $individu * @return These[] */ public function findTheseByDoctorant(Individu $individu) { $qb = $this->createQueryBuilder('t') ->andWhere('th.individu = :individu') ->setParameter('individu', $individu) ->andWhere('t.etatThese = :encours') ->setParameter('encours', These::ETAT_EN_COURS) ->orderBy('t.id') ; return $qb->getQuery()->getResult(); } /** * @param Individu $individu * @return These[] */ public function findTheseByActeur(Individu $individu) { $qb = $this->createQueryBuilder('t') ->leftJoinActeur() ->andWhere('a.individu = :individu') ->setParameter('individu', $individu) ->andWhere('t.etatThese = :encours') ->setParameter('encours', These::ETAT_EN_COURS) ->orderBy('t.id') ; return $qb->getQuery()->getResult(); } } No newline at end of file module/Application/view/application/these/depot-accueil.phtml 0 → 100644 +40 −0 Changes for module/Application/view/application/these/depot-accueil.phtml: 40 added lines, 0 removed lines. Original line number Diff line number Diff line <?php /** * @var Role $role * @var These[] $theses */ use Application\Entity\Db\Role; use Application\Entity\Db\These; ?> <h1 class="page-header"> Accueil de la partie dépôt </h1> <div class="main"> <div id="content" class="jumbotron col-xs-12 col-md-10"> <?php if ($theses !== []) : ?> <p class="lead"> Pour accéder au dépôt d'une thèse cliquez sur le bouton détail de celle-ci. </p> <?php foreach ($theses as $these): ?> <?php echo $this->partial('application/these/partial/panel', ['these' => $these]) ?> <?php endforeach ?> <?php else : ?> <p class="lead"> Pour accéder au dépôt d'une thèse, rechercher celle-ci dans la partie "Thèses" puis cliquer sur celle-ci. </p> <a href="<?php echo $this->url('these'); ?>" class="btn btn-primary"> <span class="glyphicon glyphicon-arrow-right"></span> Accéder au thèses </a> <?php endif; ?> </div> </div> Loading
module/Application/config/others/these.config.php +31 −11 Changes for module/Application/config/others/these.config.php: 31 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ return [ 'these', 'detail-identite', 'rechercher', 'depot-accueil' ], 'roles' => 'user', ], Loading Loading @@ -302,6 +303,18 @@ return [ 'router' => [ 'routes' => [ 'depot' => [ 'type' => 'Literal', 'options' => [ 'route' => '/depot', 'defaults' => [ '__NAMESPACE__' => 'Application\Controller', 'controller' => 'These', 'action' => 'depot-accueil', ], ], 'may_terminate' => true, ], 'these' => [ 'type' => 'Literal', 'options' => [ Loading Loading @@ -800,6 +813,13 @@ return [ 'label' => 'Thèses', 'route' => 'these', 'resource' => PrivilegeController::getResourceId('Application\Controller\These', 'index'), 'pages' => [], ], 'depot' => [ 'order' => -99, 'label' => 'Dépôt', 'route' => 'depot', 'resource' => PrivilegeController::getResourceId('Application\Controller\These', 'index'), 'pages' => [ 'roadmap' => [ 'label' => 'Feuille de route', Loading @@ -814,17 +834,6 @@ return [ 'etape' => null, 'visible' => 'Assertion\\These', ], 'divider-roadmap' => [ 'label' => null, 'uri' => '', 'withtarget' => true, 'paramsInject' => [ 'these', ], 'class' => 'divider', ], 'identite' => [ 'label' => 'Thèse', 'route' => 'these/identite', Loading @@ -837,6 +846,17 @@ return [ 'etape' => null, 'visible' => 'Assertion\\These', ], 'divider-roadmap' => [ 'label' => null, 'uri' => '', 'withtarget' => true, 'paramsInject' => [ 'these', ], 'class' => 'divider', ], 'points-de-vigilance' => [ 'label' => 'Points de vigilance', 'route' => 'these/points-de-vigilance', Loading
module/Application/src/Application/Controller/TheseController.php +30 −0 Changes for module/Application/src/Application/Controller/TheseController.php: 30 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -172,6 +172,36 @@ class TheseController extends AbstractController return $this->redirect()->toRoute('these', [], ['query' => $queryParams]); } /** * Action servant l'accueil du menu Dépôt : * - pour un doctorant / directeur affiche la liste des thèses en cours * - pour un bu et mdd la liste des thèses en cours dans son établissement * - sinon un message disant de sélectionner une thèse via l'annuaire **/ public function depotAccueilAction() { $role = $this->userContextService->getSelectedIdentityRole(); $user = $this->userContextService->getIdentityDb(); $theses = []; switch ($role->getCode()) { case Role::CODE_DOCTORANT : $theses = $this->getTheseService()->getRepository()->findTheseByDoctorant($user->getIndividu()); break; case Role::CODE_DIRECTEUR_THESE : case Role::CODE_CODIRECTEUR_THESE : $theses = $this->getTheseService()->getRepository()->findTheseByActeur($user->getIndividu()); break; default : break; } return new ViewModel([ 'role' => $role, 'theses' => $theses, ]); } public function roadmapAction() { $these = $this->requestedThese(); Loading
module/Application/src/Application/Entity/Db/Repository/TheseRepository.php +35 −0 Changes for module/Application/src/Application/Entity/Db/Repository/TheseRepository.php: 35 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Application\Entity\Db\Repository; use Application\Entity\Db\Etablissement; use Application\Entity\Db\Individu; use Application\Entity\Db\These; use Application\ORM\Query\Functions\Year; use Application\QueryBuilder\TheseQueryBuilder; Loading Loading @@ -113,5 +114,39 @@ class TheseRepository extends DefaultEntityRepository return $results; } /** * @param Individu $individu * @return These[] */ public function findTheseByDoctorant(Individu $individu) { $qb = $this->createQueryBuilder('t') ->andWhere('th.individu = :individu') ->setParameter('individu', $individu) ->andWhere('t.etatThese = :encours') ->setParameter('encours', These::ETAT_EN_COURS) ->orderBy('t.id') ; return $qb->getQuery()->getResult(); } /** * @param Individu $individu * @return These[] */ public function findTheseByActeur(Individu $individu) { $qb = $this->createQueryBuilder('t') ->leftJoinActeur() ->andWhere('a.individu = :individu') ->setParameter('individu', $individu) ->andWhere('t.etatThese = :encours') ->setParameter('encours', These::ETAT_EN_COURS) ->orderBy('t.id') ; return $qb->getQuery()->getResult(); } } No newline at end of file
module/Application/view/application/these/depot-accueil.phtml 0 → 100644 +40 −0 Changes for module/Application/view/application/these/depot-accueil.phtml: 40 added lines, 0 removed lines. Original line number Diff line number Diff line <?php /** * @var Role $role * @var These[] $theses */ use Application\Entity\Db\Role; use Application\Entity\Db\These; ?> <h1 class="page-header"> Accueil de la partie dépôt </h1> <div class="main"> <div id="content" class="jumbotron col-xs-12 col-md-10"> <?php if ($theses !== []) : ?> <p class="lead"> Pour accéder au dépôt d'une thèse cliquez sur le bouton détail de celle-ci. </p> <?php foreach ($theses as $these): ?> <?php echo $this->partial('application/these/partial/panel', ['these' => $these]) ?> <?php endforeach ?> <?php else : ?> <p class="lead"> Pour accéder au dépôt d'une thèse, rechercher celle-ci dans la partie "Thèses" puis cliquer sur celle-ci. </p> <a href="<?php echo $this->url('these'); ?>" class="btn btn-primary"> <span class="glyphicon glyphicon-arrow-right"></span> Accéder au thèses </a> <?php endif; ?> </div> </div>