Loading module/Depot/config/others/depot.config.php +34 −68 Changes for module/Depot/config/others/depot.config.php: 34 added lines, 68 removed lines. Original line number Diff line number Diff line Loading @@ -35,10 +35,13 @@ use Depot\Service\These\Factory\DepotServiceFactory; use Depot\Service\Url\UrlDepotService; use Depot\Service\Url\UrlDepotServiceFactory; use Depot\View\Helper\Url\UrlDepotHelperFactory; use Fichier\Entity\Db\NatureFichier; use These\Provider\Privilege\ThesePrivileges; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; $depotFichierDiversRoutesConfig = generateDepotFichierDiversRoutesConfig(); return [ 'bjyauthorize' => [ 'rule_providers' => [ Loading Loading @@ -133,15 +136,10 @@ return [ ], [ 'controller' => DepotController::class, 'action' => [ 'depot-pv-soutenance', 'depot-rapport-soutenance', 'depot-pre-rapport-soutenance', 'depot-demande-confident', 'depot-prolong-confident', 'depot-conv-mise-en-ligne', 'depot-avenant-conv-mise-en-ligne', ], 'action' => array_map( fn(array $item) => $item['options']['defaults']['action'], $depotFichierDiversRoutesConfig ), 'privileges' => DepotPrivileges::THESE_FICHIER_DIVERS_CONSULTER, 'assertion' => TheseAssertion::class, ], Loading Loading @@ -429,68 +427,16 @@ return [ ], ], 'pv-soutenance' => [ 'type' => 'Literal', 'options' => [ 'route' => '/pv-soutenance', 'defaults' => [ 'action' => 'depot-pv-soutenance', ], ], ], 'rapport-soutenance' => [ 'type' => 'Literal', 'options' => [ 'route' => '/rapport-soutenance', 'defaults' => [ 'action' => 'depot-rapport-soutenance', ], ], ], 'pre-rapport-soutenance' => [ 'type' => 'Literal', 'options' => [ 'route' => '/pre-rapport-soutenance', 'defaults' => [ 'action' => 'depot-pre-rapport-soutenance', ], ], ], 'demande-confident' => [ 'type' => 'Literal', 'options' => [ 'route' => '/demande-confident', 'defaults' => [ 'action' => 'depot-demande-confident', ], ], ], 'prolong-confident' => [ 'divers' => [ 'type' => 'Literal', 'options' => [ 'route' => '/prolong-confident', 'defaults' => [ 'action' => 'depot-prolong-confident', ], ], ], 'conv-mise-en-ligne' => [ 'type' => 'Literal', 'options' => [ 'route' => '/conv-mise-en-ligne', 'defaults' => [ 'action' => 'depot-conv-mise-en-ligne', ], ], ], 'avenant-conv-mise-en-ligne' => [ 'type' => 'Literal', 'options' => [ 'route' => '/avenant-conv-mise-en-ligne', 'defaults' => [ 'action' => 'depot-avenant-conv-mise-en-ligne', ], 'route' => '/divers', ], 'may_terminate' => false, 'child_routes' => array_combine( array_keys($depotFichierDiversRoutesConfig), $depotFichierDiversRoutesConfig ), ], ], ], Loading Loading @@ -1339,3 +1285,23 @@ return [ ], ], ]; function generateDepotFichierDiversRoutesConfig(): array { $config = []; foreach (NatureFichier::CODES_FICHIERS_DIVERS as $code) { $key = (new NatureFichier())->setCode($code)->getCodeToLowerAndDash(); $config[$key] = [ 'type' => 'Literal', 'options' => [ 'route' => '/' . $key, 'defaults' => [ 'action' => 'depot-' . $key, ], ], ]; } return $config; } No newline at end of file module/Depot/src/Depot/Controller/DepotController.php +68 −11 Changes for module/Depot/src/Depot/Controller/DepotController.php: 68 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function detailDepotDiversAction() public function detailDepotDiversAction(): ViewModel { $these = $this->requestedThese(); Loading @@ -389,7 +389,11 @@ class DepotController extends AbstractController 'demandeConfidentUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_DEMANDE_CONFIDENT), 'prolongConfidentUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_PROLONG_CONFIDENT), 'convMiseEnLigneUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_MISE_EN_LIGNE), 'avenantConvMiseEnLigneUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_AVENANT_CONV_MISE_EN_LIGNE), 'convMiseEnLigneAvenantUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_MISE_EN_LIGNE_AVENANT), 'charteDoctoratUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CHARTE_DOCTORAT), 'charteDoctoratAvenantUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CHARTE_DOCTORAT_AVENANT), 'convFormationDoctoraleUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_FORMATION_DOCTORALE), 'convFormationDoctoraleAvenantUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_FORMATION_DOCTORALE_AVENANT), ]); $view->setTemplate('depot/depot/depot-divers'); Loading Loading @@ -891,13 +895,16 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotPvSoutenanceAction() public function depotPvSoutenanceAction(): ViewModel { $these = $this->requestedThese(); $dateSoutenanceDepassee = $these->getDateSoutenance() && $these->getDateSoutenance() < new \DateTime(); $view = $this->createViewForFichierAction(NatureFichier::CODE_PV_SOUTENANCE); $view->setVariable('isVisible', $dateSoutenanceDepassee); if (!$dateSoutenanceDepassee) { $view->setVariable('message', "Téléversement impossible avant la soutenance."); } $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; Loading @@ -906,13 +913,16 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotRapportSoutenanceAction() public function depotRapportSoutenanceAction(): ViewModel { $these = $this->requestedThese(); $dateSoutenanceDepassee = $these->getDateSoutenance() && $these->getDateSoutenance() < new \DateTime(); $view = $this->createViewForFichierAction(NatureFichier::CODE_RAPPORT_SOUTENANCE); $view->setVariable('isVisible', $dateSoutenanceDepassee); if (!$dateSoutenanceDepassee) { $view->setVariable('message', "Téléversement impossible avant la soutenance."); } $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; Loading @@ -921,13 +931,16 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotPreRapportSoutenanceAction() public function depotPreRapportSoutenanceAction(): ViewModel { $these = $this->requestedThese(); $dateSoutenanceDepassee = $these->getDateSoutenance() && $these->getDateSoutenance() < new \DateTime(); $view = $this->createViewForFichierAction(NatureFichier::CODE_PRE_RAPPORT_SOUTENANCE); $view->setVariable('isVisible', $dateSoutenanceDepassee); if (!$dateSoutenanceDepassee) { $view->setVariable('message', "Téléversement impossible avant la soutenance."); } $view->setVariable('maxUploadableFilesCount', 3); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -937,7 +950,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotDemandeConfidentAction() public function depotDemandeConfidentAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_DEMANDE_CONFIDENT); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -948,7 +961,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotProlongConfidentAction() public function depotProlongConfidentAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_PROLONG_CONFIDENT); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -959,7 +972,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotConvMiseEnLigneAction() public function depotConvMiseEnLigneAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_MISE_EN_LIGNE); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -970,9 +983,53 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotAvenantConvMiseEnLigneAction() public function depotConvMiseEnLigneAvenantAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_MISE_EN_LIGNE_AVENANT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotCharteDoctoratAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CHARTE_DOCTORAT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotCharteDoctoratAvenantAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CHARTE_DOCTORAT_AVENANT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotConvFormationDoctoraleAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_FORMATION_DOCTORALE); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotConvFormationDoctoraleAvenantAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_AVENANT_CONV_MISE_EN_LIGNE); $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_FORMATION_DOCTORALE_AVENANT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; Loading @@ -982,7 +1039,7 @@ class DepotController extends AbstractController * @param string $codeNatureFichier * @return ViewModel */ private function createViewForFichierAction($codeNatureFichier) private function createViewForFichierAction(string $codeNatureFichier): ViewModel { $these = $this->requestedThese(); $nature = $this->fichierTheseService->fetchNatureFichier($codeNatureFichier); Loading module/Depot/src/Depot/Service/Url/UrlDepotService.php +12 −14 Changes for module/Depot/src/Depot/Service/Url/UrlDepotService.php: 12 added lines, 14 removed lines. Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class UrlDepotService extends UrlService * @param array $queryParams * @return string */ public function depotFichiers(These $these, $nature, $version = null, $retraite = false, array $queryParams = []) public function depotFichiers(These $these, $nature, $version = null, bool $retraite = false, array $queryParams = []): string { $nature = $this->idify($nature); Loading @@ -42,29 +42,22 @@ class UrlDepotService extends UrlService $queryParams['retraite'] = $retraite; } switch ($nature) { case NatureFichier::CODE_THESE_PDF: switch (true) { case $nature === NatureFichier::CODE_THESE_PDF: if ($retraite === true) { $route = 'these/depot/these-retraitee'; } else { $route = 'these/depot/these'; } break; case NatureFichier::CODE_FICHIER_NON_PDF: case $nature === NatureFichier::CODE_FICHIER_NON_PDF: $route = 'these/depot/annexes'; break; case NatureFichier::CODE_PV_SOUTENANCE: case NatureFichier::CODE_RAPPORT_SOUTENANCE: case NatureFichier::CODE_PRE_RAPPORT_SOUTENANCE: case NatureFichier::CODE_DEMANDE_CONFIDENT: case NatureFichier::CODE_PROLONG_CONFIDENT: case NatureFichier::CODE_CONV_MISE_EN_LIGNE: case NatureFichier::CODE_AVENANT_CONV_MISE_EN_LIGNE: $route = 'these/depot/' . (new NatureFichier)->setCode($nature)->getCodeToLowerAndDash(); case in_array($nature, NatureFichier::CODES_FICHIERS_DIVERS): $route = 'these/depot/divers/' . $this->getRouteNameFromNatureFichier($nature); break; default: throw new LogicException("Nature spécifiée inattendue"); break; throw new LogicException("Nature de fichier spécifiée inattendue"); } return $this->fromRoute($route, Loading @@ -73,6 +66,11 @@ class UrlDepotService extends UrlService ); } private function getRouteNameFromNatureFichier(string $code): string { return (new NatureFichier)->setCode($code)->getCodeToLowerAndDash(); } public function identiteThese(These $these) { return $this->fromRoute('these/identite', Loading module/Depot/view/depot/depot/depot-divers.phtml +74 −17 Changes for module/Depot/view/depot/depot/depot-divers.phtml: 74 added lines, 17 removed lines. Original line number Diff line number Diff line <?php use These\Controller\TheseController; use These\Entity\Db\These; use Depot\Provider\Privilege\DepotPrivileges; use Application\View\Renderer\PhpRenderer; use Depot\Provider\Privilege\DepotPrivileges; use These\Entity\Db\These; /** * Dépot de fichiers divers liés à une thèse. Loading @@ -16,18 +15,22 @@ use Application\View\Renderer\PhpRenderer; * @var string $demandeConfidentUrl * @var string $prolongConfidentUrl * @var string $convMiseEnLigneUrl * @var string $avenantConvMiseEnLigneUrl * @var string $convMiseEnLigneAvenantUrl * @var string $charteDoctoratUrl * @var string $charteDoctoratAvenantUrl * @var string $convFormationDoctoraleUrl * @var string $convFormationDoctoraleAvenantUrl * * @see TheseController::detailDepotDiversAction() * @see \Depot\Controller\DepotController::detailDepotDiversAction() */ ?> <?php $this->headTitle($this->translate($title = "Dépôt de fichiers divers")) <?php $this->headTitle($this->translate("Fichiers divers")) ->prepend($these->getDoctorant()->getIndividu()->getNomUsuel()) ?> <h1 class="page-header"> <?php echo $this->translate($title); ?> <?php echo $this->translate("Dépôt de fichiers divers"); ?> <small><?php echo $this->partial('these/these/partial/titre') ?></small> </h1> Loading @@ -37,40 +40,79 @@ use Application\View\Renderer\PhpRenderer; </p> <?php if ($this->isAllowed($these, DepotPrivileges::THESE_FICHIER_DIVERS_CONSULTER)): ?> <h2>Charte</h2> <div class="row"> <div class="col-md-4"> <div id="pvSoutenanceDiv" class="" data-url="<?php echo $pvSoutenanceUrl ?>"> <div id="charteDoctoratDiv" class="" data-url="<?php echo $charteDoctoratUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="preRapportSoutenanceDiv" class="" data-url="<?php echo $preRapportSoutenanceUrl ?>"> <div id="charteDoctoratAvenantDiv" class="" data-url="<?php echo $charteDoctoratAvenantUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Confidentialité</h2> <div class="row"> <div class="col-md-4"> <div id="rapportSoutenanceDiv" class="" data-url="<?php echo $rapportSoutenanceUrl ?>"> <div id="demandeConfidentDiv" class="" data-url="<?php echo $demandeConfidentUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="prolongConfidentDiv" class="" data-url="<?php echo $prolongConfidentUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Formation doctorale</h2> <div class="row"> <div class="col-md-4"> <div id="demandeConfidentDiv" class="" data-url="<?php echo $demandeConfidentUrl ?>"> <div id="convFormationDoctoraleDiv" class="" data-url="<?php echo $convFormationDoctoraleUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="prolongConfidentDiv" class="" data-url="<?php echo $prolongConfidentUrl ?>"> <div id="convFormationDoctoraleAvenantDiv" class="" data-url="<?php echo $convFormationDoctoraleAvenantUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Soutenance</h2> <div class="row"> <div class="col-md-4"> <div id="pvSoutenanceDiv" class="" data-url="<?php echo $pvSoutenanceUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="preRapportSoutenanceDiv" class="" data-url="<?php echo $preRapportSoutenanceUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="rapportSoutenanceDiv" class="" data-url="<?php echo $rapportSoutenanceUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Mise en ligne</h2> <div class="row"> <div class="col-md-4"> <div id="convMiseEnLigneDiv" class="" data-url="<?php echo $convMiseEnLigneUrl ?>"> Loading @@ -79,7 +121,7 @@ use Application\View\Renderer\PhpRenderer; </div> <div class="col-md-4"> <div id="avenantConvMiseEnLigneDiv" class="" data-url="<?php echo $avenantConvMiseEnLigneUrl ?>"> <div id="convMiseEnLigneAvenantDiv" class="" data-url="<?php echo $convMiseEnLigneAvenantUrl ?>"> <!-- màj via ajax --> </div> </div> Loading Loading @@ -108,18 +150,33 @@ use Application\View\Renderer\PhpRenderer; var demandeConfidentLoader = loaderFactory("demandeConfidentDiv"); var prolongConfidentLoader = loaderFactory("prolongConfidentDiv"); var convMiseEnLigneLoader = loaderFactory("convMiseEnLigneDiv"); var avenantConvMiseEnLigneLoader = loaderFactory("avenantConvMiseEnLigneDiv"); var convMiseEnLigneAvenantLoader = loaderFactory("convMiseEnLigneAvenantDiv"); var charteDoctoratLoader = loaderFactory("charteDoctoratDiv"); var charteDoctoratAvenantLoader = loaderFactory("charteDoctoratAvenantDiv"); var convFormationDoctoraleLoader = loaderFactory("convFormationDoctoraleDiv"); var convFormationDoctoraleAvenantLoader = loaderFactory("convFormationDoctoraleAvenantDiv"); // Au chargement de la page, on actualise les div runInCascade([ charteDoctoratLoader, charteDoctoratAvenantLoader, demandeConfidentLoader, prolongConfidentLoader, convFormationDoctoraleLoader, convFormationDoctoraleAvenantLoader, pvSoutenanceLoader, preRapportSoutenanceLoader, rapportSoutenanceLoader, demandeConfidentLoader, prolongConfidentLoader, convMiseEnLigneLoader, avenantConvMiseEnLigneLoader convMiseEnLigneAvenantLoader, ], self); }); </script> No newline at end of file module/Depot/view/depot/depot/depot/fichier-divers.phtml +11 −8 Changes for module/Depot/view/depot/depot/depot/fichier-divers.phtml: 11 added lines, 8 removed lines. Original line number Diff line number Diff line <?php use Application\View\Renderer\PhpRenderer; use Fichier\Entity\Db\NatureFichier; use These\Entity\Db\These; use Fichier\Entity\Db\VersionFichier; use Fichier\Provider\Privilege\FichierPrivileges; use Application\View\Renderer\PhpRenderer; use These\Entity\Db\These; /** * @var PhpRenderer $this Loading @@ -14,21 +14,25 @@ use Application\View\Renderer\PhpRenderer; * @var NatureFichier $nature * @var VersionFichier $version * @var bool $isVisible * @var string $message * @var int $maxUploadableFilesCount */ $canEdit = $this->isAllowed($these, $p = FichierPrivileges::privilegeTeleverserFor($nature, $version)); $maxUploadableFilesCount = isset($maxUploadableFilesCount) ? $maxUploadableFilesCount : 1; $isVisible = isset($isVisible) ? $isVisible : true; $maxUploadableFilesCount = $maxUploadableFilesCount ?? 1; $isVisible = $isVisible ?? true; $message = $message ?? null; ?> <?php if ($isVisible): ?> <div class="box card"> <div class="card-header bg-dark text-white"> <h2 class="first"><?php echo $nature ?></h2> </div> <div class="card-body"> <?php if ($message !== null): ?> <span class="fas fa-info-circle"></span> <?php echo $message ?> <?php endif ?> <?php if ($isVisible): ?> <?php echo $this->partial('depot/depot/depot/partial/fichier', [ 'canUpload' => $canEdit, 'class' => (new NatureFichier)->setCode($nature->getCode())->getCodeToLowerAndDash(), Loading @@ -36,7 +40,6 @@ $isVisible = isset($isVisible) ? $isVisible : true; 'uploadedFilesListUrl' => $fichiersListUrl, 'maxUploadableFilesCount' => $maxUploadableFilesCount, ]) ?> <?php endif ?> </div> </div> <?php endif ?> Loading
module/Depot/config/others/depot.config.php +34 −68 Changes for module/Depot/config/others/depot.config.php: 34 added lines, 68 removed lines. Original line number Diff line number Diff line Loading @@ -35,10 +35,13 @@ use Depot\Service\These\Factory\DepotServiceFactory; use Depot\Service\Url\UrlDepotService; use Depot\Service\Url\UrlDepotServiceFactory; use Depot\View\Helper\Url\UrlDepotHelperFactory; use Fichier\Entity\Db\NatureFichier; use These\Provider\Privilege\ThesePrivileges; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; $depotFichierDiversRoutesConfig = generateDepotFichierDiversRoutesConfig(); return [ 'bjyauthorize' => [ 'rule_providers' => [ Loading Loading @@ -133,15 +136,10 @@ return [ ], [ 'controller' => DepotController::class, 'action' => [ 'depot-pv-soutenance', 'depot-rapport-soutenance', 'depot-pre-rapport-soutenance', 'depot-demande-confident', 'depot-prolong-confident', 'depot-conv-mise-en-ligne', 'depot-avenant-conv-mise-en-ligne', ], 'action' => array_map( fn(array $item) => $item['options']['defaults']['action'], $depotFichierDiversRoutesConfig ), 'privileges' => DepotPrivileges::THESE_FICHIER_DIVERS_CONSULTER, 'assertion' => TheseAssertion::class, ], Loading Loading @@ -429,68 +427,16 @@ return [ ], ], 'pv-soutenance' => [ 'type' => 'Literal', 'options' => [ 'route' => '/pv-soutenance', 'defaults' => [ 'action' => 'depot-pv-soutenance', ], ], ], 'rapport-soutenance' => [ 'type' => 'Literal', 'options' => [ 'route' => '/rapport-soutenance', 'defaults' => [ 'action' => 'depot-rapport-soutenance', ], ], ], 'pre-rapport-soutenance' => [ 'type' => 'Literal', 'options' => [ 'route' => '/pre-rapport-soutenance', 'defaults' => [ 'action' => 'depot-pre-rapport-soutenance', ], ], ], 'demande-confident' => [ 'type' => 'Literal', 'options' => [ 'route' => '/demande-confident', 'defaults' => [ 'action' => 'depot-demande-confident', ], ], ], 'prolong-confident' => [ 'divers' => [ 'type' => 'Literal', 'options' => [ 'route' => '/prolong-confident', 'defaults' => [ 'action' => 'depot-prolong-confident', ], ], ], 'conv-mise-en-ligne' => [ 'type' => 'Literal', 'options' => [ 'route' => '/conv-mise-en-ligne', 'defaults' => [ 'action' => 'depot-conv-mise-en-ligne', ], ], ], 'avenant-conv-mise-en-ligne' => [ 'type' => 'Literal', 'options' => [ 'route' => '/avenant-conv-mise-en-ligne', 'defaults' => [ 'action' => 'depot-avenant-conv-mise-en-ligne', ], 'route' => '/divers', ], 'may_terminate' => false, 'child_routes' => array_combine( array_keys($depotFichierDiversRoutesConfig), $depotFichierDiversRoutesConfig ), ], ], ], Loading Loading @@ -1339,3 +1285,23 @@ return [ ], ], ]; function generateDepotFichierDiversRoutesConfig(): array { $config = []; foreach (NatureFichier::CODES_FICHIERS_DIVERS as $code) { $key = (new NatureFichier())->setCode($code)->getCodeToLowerAndDash(); $config[$key] = [ 'type' => 'Literal', 'options' => [ 'route' => '/' . $key, 'defaults' => [ 'action' => 'depot-' . $key, ], ], ]; } return $config; } No newline at end of file
module/Depot/src/Depot/Controller/DepotController.php +68 −11 Changes for module/Depot/src/Depot/Controller/DepotController.php: 68 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -377,7 +377,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function detailDepotDiversAction() public function detailDepotDiversAction(): ViewModel { $these = $this->requestedThese(); Loading @@ -389,7 +389,11 @@ class DepotController extends AbstractController 'demandeConfidentUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_DEMANDE_CONFIDENT), 'prolongConfidentUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_PROLONG_CONFIDENT), 'convMiseEnLigneUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_MISE_EN_LIGNE), 'avenantConvMiseEnLigneUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_AVENANT_CONV_MISE_EN_LIGNE), 'convMiseEnLigneAvenantUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_MISE_EN_LIGNE_AVENANT), 'charteDoctoratUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CHARTE_DOCTORAT), 'charteDoctoratAvenantUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CHARTE_DOCTORAT_AVENANT), 'convFormationDoctoraleUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_FORMATION_DOCTORALE), 'convFormationDoctoraleAvenantUrl' => $this->urlDepot()->depotFichiers($these, NatureFichier::CODE_CONV_FORMATION_DOCTORALE_AVENANT), ]); $view->setTemplate('depot/depot/depot-divers'); Loading Loading @@ -891,13 +895,16 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotPvSoutenanceAction() public function depotPvSoutenanceAction(): ViewModel { $these = $this->requestedThese(); $dateSoutenanceDepassee = $these->getDateSoutenance() && $these->getDateSoutenance() < new \DateTime(); $view = $this->createViewForFichierAction(NatureFichier::CODE_PV_SOUTENANCE); $view->setVariable('isVisible', $dateSoutenanceDepassee); if (!$dateSoutenanceDepassee) { $view->setVariable('message', "Téléversement impossible avant la soutenance."); } $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; Loading @@ -906,13 +913,16 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotRapportSoutenanceAction() public function depotRapportSoutenanceAction(): ViewModel { $these = $this->requestedThese(); $dateSoutenanceDepassee = $these->getDateSoutenance() && $these->getDateSoutenance() < new \DateTime(); $view = $this->createViewForFichierAction(NatureFichier::CODE_RAPPORT_SOUTENANCE); $view->setVariable('isVisible', $dateSoutenanceDepassee); if (!$dateSoutenanceDepassee) { $view->setVariable('message', "Téléversement impossible avant la soutenance."); } $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; Loading @@ -921,13 +931,16 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotPreRapportSoutenanceAction() public function depotPreRapportSoutenanceAction(): ViewModel { $these = $this->requestedThese(); $dateSoutenanceDepassee = $these->getDateSoutenance() && $these->getDateSoutenance() < new \DateTime(); $view = $this->createViewForFichierAction(NatureFichier::CODE_PRE_RAPPORT_SOUTENANCE); $view->setVariable('isVisible', $dateSoutenanceDepassee); if (!$dateSoutenanceDepassee) { $view->setVariable('message', "Téléversement impossible avant la soutenance."); } $view->setVariable('maxUploadableFilesCount', 3); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -937,7 +950,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotDemandeConfidentAction() public function depotDemandeConfidentAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_DEMANDE_CONFIDENT); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -948,7 +961,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotProlongConfidentAction() public function depotProlongConfidentAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_PROLONG_CONFIDENT); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -959,7 +972,7 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotConvMiseEnLigneAction() public function depotConvMiseEnLigneAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_MISE_EN_LIGNE); $view->setTemplate('depot/depot/depot/fichier-divers'); Loading @@ -970,9 +983,53 @@ class DepotController extends AbstractController /** * @return ViewModel */ public function depotAvenantConvMiseEnLigneAction() public function depotConvMiseEnLigneAvenantAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_MISE_EN_LIGNE_AVENANT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotCharteDoctoratAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CHARTE_DOCTORAT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotCharteDoctoratAvenantAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CHARTE_DOCTORAT_AVENANT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotConvFormationDoctoraleAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_FORMATION_DOCTORALE); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; } /** * @return ViewModel */ public function depotConvFormationDoctoraleAvenantAction(): ViewModel { $view = $this->createViewForFichierAction(NatureFichier::CODE_AVENANT_CONV_MISE_EN_LIGNE); $view = $this->createViewForFichierAction(NatureFichier::CODE_CONV_FORMATION_DOCTORALE_AVENANT); $view->setTemplate('depot/depot/depot/fichier-divers'); return $view; Loading @@ -982,7 +1039,7 @@ class DepotController extends AbstractController * @param string $codeNatureFichier * @return ViewModel */ private function createViewForFichierAction($codeNatureFichier) private function createViewForFichierAction(string $codeNatureFichier): ViewModel { $these = $this->requestedThese(); $nature = $this->fichierTheseService->fetchNatureFichier($codeNatureFichier); Loading
module/Depot/src/Depot/Service/Url/UrlDepotService.php +12 −14 Changes for module/Depot/src/Depot/Service/Url/UrlDepotService.php: 12 added lines, 14 removed lines. Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ class UrlDepotService extends UrlService * @param array $queryParams * @return string */ public function depotFichiers(These $these, $nature, $version = null, $retraite = false, array $queryParams = []) public function depotFichiers(These $these, $nature, $version = null, bool $retraite = false, array $queryParams = []): string { $nature = $this->idify($nature); Loading @@ -42,29 +42,22 @@ class UrlDepotService extends UrlService $queryParams['retraite'] = $retraite; } switch ($nature) { case NatureFichier::CODE_THESE_PDF: switch (true) { case $nature === NatureFichier::CODE_THESE_PDF: if ($retraite === true) { $route = 'these/depot/these-retraitee'; } else { $route = 'these/depot/these'; } break; case NatureFichier::CODE_FICHIER_NON_PDF: case $nature === NatureFichier::CODE_FICHIER_NON_PDF: $route = 'these/depot/annexes'; break; case NatureFichier::CODE_PV_SOUTENANCE: case NatureFichier::CODE_RAPPORT_SOUTENANCE: case NatureFichier::CODE_PRE_RAPPORT_SOUTENANCE: case NatureFichier::CODE_DEMANDE_CONFIDENT: case NatureFichier::CODE_PROLONG_CONFIDENT: case NatureFichier::CODE_CONV_MISE_EN_LIGNE: case NatureFichier::CODE_AVENANT_CONV_MISE_EN_LIGNE: $route = 'these/depot/' . (new NatureFichier)->setCode($nature)->getCodeToLowerAndDash(); case in_array($nature, NatureFichier::CODES_FICHIERS_DIVERS): $route = 'these/depot/divers/' . $this->getRouteNameFromNatureFichier($nature); break; default: throw new LogicException("Nature spécifiée inattendue"); break; throw new LogicException("Nature de fichier spécifiée inattendue"); } return $this->fromRoute($route, Loading @@ -73,6 +66,11 @@ class UrlDepotService extends UrlService ); } private function getRouteNameFromNatureFichier(string $code): string { return (new NatureFichier)->setCode($code)->getCodeToLowerAndDash(); } public function identiteThese(These $these) { return $this->fromRoute('these/identite', Loading
module/Depot/view/depot/depot/depot-divers.phtml +74 −17 Changes for module/Depot/view/depot/depot/depot-divers.phtml: 74 added lines, 17 removed lines. Original line number Diff line number Diff line <?php use These\Controller\TheseController; use These\Entity\Db\These; use Depot\Provider\Privilege\DepotPrivileges; use Application\View\Renderer\PhpRenderer; use Depot\Provider\Privilege\DepotPrivileges; use These\Entity\Db\These; /** * Dépot de fichiers divers liés à une thèse. Loading @@ -16,18 +15,22 @@ use Application\View\Renderer\PhpRenderer; * @var string $demandeConfidentUrl * @var string $prolongConfidentUrl * @var string $convMiseEnLigneUrl * @var string $avenantConvMiseEnLigneUrl * @var string $convMiseEnLigneAvenantUrl * @var string $charteDoctoratUrl * @var string $charteDoctoratAvenantUrl * @var string $convFormationDoctoraleUrl * @var string $convFormationDoctoraleAvenantUrl * * @see TheseController::detailDepotDiversAction() * @see \Depot\Controller\DepotController::detailDepotDiversAction() */ ?> <?php $this->headTitle($this->translate($title = "Dépôt de fichiers divers")) <?php $this->headTitle($this->translate("Fichiers divers")) ->prepend($these->getDoctorant()->getIndividu()->getNomUsuel()) ?> <h1 class="page-header"> <?php echo $this->translate($title); ?> <?php echo $this->translate("Dépôt de fichiers divers"); ?> <small><?php echo $this->partial('these/these/partial/titre') ?></small> </h1> Loading @@ -37,40 +40,79 @@ use Application\View\Renderer\PhpRenderer; </p> <?php if ($this->isAllowed($these, DepotPrivileges::THESE_FICHIER_DIVERS_CONSULTER)): ?> <h2>Charte</h2> <div class="row"> <div class="col-md-4"> <div id="pvSoutenanceDiv" class="" data-url="<?php echo $pvSoutenanceUrl ?>"> <div id="charteDoctoratDiv" class="" data-url="<?php echo $charteDoctoratUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="preRapportSoutenanceDiv" class="" data-url="<?php echo $preRapportSoutenanceUrl ?>"> <div id="charteDoctoratAvenantDiv" class="" data-url="<?php echo $charteDoctoratAvenantUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Confidentialité</h2> <div class="row"> <div class="col-md-4"> <div id="rapportSoutenanceDiv" class="" data-url="<?php echo $rapportSoutenanceUrl ?>"> <div id="demandeConfidentDiv" class="" data-url="<?php echo $demandeConfidentUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="prolongConfidentDiv" class="" data-url="<?php echo $prolongConfidentUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Formation doctorale</h2> <div class="row"> <div class="col-md-4"> <div id="demandeConfidentDiv" class="" data-url="<?php echo $demandeConfidentUrl ?>"> <div id="convFormationDoctoraleDiv" class="" data-url="<?php echo $convFormationDoctoraleUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="prolongConfidentDiv" class="" data-url="<?php echo $prolongConfidentUrl ?>"> <div id="convFormationDoctoraleAvenantDiv" class="" data-url="<?php echo $convFormationDoctoraleAvenantUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Soutenance</h2> <div class="row"> <div class="col-md-4"> <div id="pvSoutenanceDiv" class="" data-url="<?php echo $pvSoutenanceUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="preRapportSoutenanceDiv" class="" data-url="<?php echo $preRapportSoutenanceUrl ?>"> <!-- màj via ajax --> </div> </div> <div class="col-md-4"> <div id="rapportSoutenanceDiv" class="" data-url="<?php echo $rapportSoutenanceUrl ?>"> <!-- màj via ajax --> </div> </div> </div> <h2>Mise en ligne</h2> <div class="row"> <div class="col-md-4"> <div id="convMiseEnLigneDiv" class="" data-url="<?php echo $convMiseEnLigneUrl ?>"> Loading @@ -79,7 +121,7 @@ use Application\View\Renderer\PhpRenderer; </div> <div class="col-md-4"> <div id="avenantConvMiseEnLigneDiv" class="" data-url="<?php echo $avenantConvMiseEnLigneUrl ?>"> <div id="convMiseEnLigneAvenantDiv" class="" data-url="<?php echo $convMiseEnLigneAvenantUrl ?>"> <!-- màj via ajax --> </div> </div> Loading Loading @@ -108,18 +150,33 @@ use Application\View\Renderer\PhpRenderer; var demandeConfidentLoader = loaderFactory("demandeConfidentDiv"); var prolongConfidentLoader = loaderFactory("prolongConfidentDiv"); var convMiseEnLigneLoader = loaderFactory("convMiseEnLigneDiv"); var avenantConvMiseEnLigneLoader = loaderFactory("avenantConvMiseEnLigneDiv"); var convMiseEnLigneAvenantLoader = loaderFactory("convMiseEnLigneAvenantDiv"); var charteDoctoratLoader = loaderFactory("charteDoctoratDiv"); var charteDoctoratAvenantLoader = loaderFactory("charteDoctoratAvenantDiv"); var convFormationDoctoraleLoader = loaderFactory("convFormationDoctoraleDiv"); var convFormationDoctoraleAvenantLoader = loaderFactory("convFormationDoctoraleAvenantDiv"); // Au chargement de la page, on actualise les div runInCascade([ charteDoctoratLoader, charteDoctoratAvenantLoader, demandeConfidentLoader, prolongConfidentLoader, convFormationDoctoraleLoader, convFormationDoctoraleAvenantLoader, pvSoutenanceLoader, preRapportSoutenanceLoader, rapportSoutenanceLoader, demandeConfidentLoader, prolongConfidentLoader, convMiseEnLigneLoader, avenantConvMiseEnLigneLoader convMiseEnLigneAvenantLoader, ], self); }); </script> No newline at end of file
module/Depot/view/depot/depot/depot/fichier-divers.phtml +11 −8 Changes for module/Depot/view/depot/depot/depot/fichier-divers.phtml: 11 added lines, 8 removed lines. Original line number Diff line number Diff line <?php use Application\View\Renderer\PhpRenderer; use Fichier\Entity\Db\NatureFichier; use These\Entity\Db\These; use Fichier\Entity\Db\VersionFichier; use Fichier\Provider\Privilege\FichierPrivileges; use Application\View\Renderer\PhpRenderer; use These\Entity\Db\These; /** * @var PhpRenderer $this Loading @@ -14,21 +14,25 @@ use Application\View\Renderer\PhpRenderer; * @var NatureFichier $nature * @var VersionFichier $version * @var bool $isVisible * @var string $message * @var int $maxUploadableFilesCount */ $canEdit = $this->isAllowed($these, $p = FichierPrivileges::privilegeTeleverserFor($nature, $version)); $maxUploadableFilesCount = isset($maxUploadableFilesCount) ? $maxUploadableFilesCount : 1; $isVisible = isset($isVisible) ? $isVisible : true; $maxUploadableFilesCount = $maxUploadableFilesCount ?? 1; $isVisible = $isVisible ?? true; $message = $message ?? null; ?> <?php if ($isVisible): ?> <div class="box card"> <div class="card-header bg-dark text-white"> <h2 class="first"><?php echo $nature ?></h2> </div> <div class="card-body"> <?php if ($message !== null): ?> <span class="fas fa-info-circle"></span> <?php echo $message ?> <?php endif ?> <?php if ($isVisible): ?> <?php echo $this->partial('depot/depot/depot/partial/fichier', [ 'canUpload' => $canEdit, 'class' => (new NatureFichier)->setCode($nature->getCode())->getCodeToLowerAndDash(), Loading @@ -36,7 +40,6 @@ $isVisible = isset($isVisible) ? $isVisible : true; 'uploadedFilesListUrl' => $fichiersListUrl, 'maxUploadableFilesCount' => $maxUploadableFilesCount, ]) ?> <?php endif ?> </div> </div> <?php endif ?>