Loading module/Application/src/Application/Controller/FichierTheseController.php +1 −39 Changes for module/Application/src/Application/Controller/FichierTheseController.php: 1 added line, 39 removed lines. Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class FichierTheseController extends AbstractController } if ($sort === null) { // null <=> paramètre absent // tri par défaut : datePremiereInscription // tri par défaut : nom $queryParams = array_merge($queryParams, ['sort' => 'f.nom', 'direction' => Sortable::ASC]); $needsRedirect = true; } Loading Loading @@ -114,44 +114,6 @@ class FichierTheseController extends AbstractController return $vm; } /** * Listage des fichiers (thèse ou annexes) déposés. * * @return ViewModel */ public function listerAction() { $these = $this->requestedThese(); $estAnnexe = $this->params()->fromQuery('annexe', false); // $estExpurge = $this->params()->fromQuery('expurge', false); $estRetraite = $this->params()->fromQuery('retraite', false); $inclureValidite = (bool)$this->params()->fromQuery('inclureValidite', false); $inclureRetraitement = (bool)$this->params()->fromQuery('inclureRetraitement', false); $version = $this->params()->fromQuery('version'); // $fichiers = $these->getFichiersBy($estAnnexe, $estExpurge, $estRetraite, $version); $nature = $estAnnexe ? NatureFichier::CODE_FICHIER_NON_PDF : NatureFichier::CODE_THESE_PDF; $fichiers = $this->fichierTheseService->getRepository()->fetchFichierTheses($these, $nature , $version , $estRetraite); $items = array_map(function (FichierThese $fichier) use ($these) { return [ 'file' => $fichier, 'downloadUrl' => $this->urlFichierThese()->telechargerFichierThese($these, $fichier), 'deleteUrl' => $this->urlFichierThese()->supprimerFichierThese($these, $fichier), ]; }, $fichiers); $viewModel = new ViewModel([ 'items' => $items, 'inclureValidite' => $inclureValidite, 'inclureRetraitement' => $inclureRetraitement, ]); $viewModel->setTemplate('application/fichier-these/lister-fichiers'); return $viewModel; } /** * Action de listage des fichiers déposés répondant aux critères de nature (et version) spécifiés. * Loading module/Application/src/Application/Controller/Plugin/UrlFichierThese.php +0 −33 Changes for module/Application/src/Application/Controller/Plugin/UrlFichierThese.php: 0 added lines, 33 removed lines. Original line number Diff line number Diff line Loading @@ -75,37 +75,4 @@ class UrlFichierThese extends UrlPlugin true ); } /** * @param These $these * @param NatureFichier|string $nature * @param VersionFichier|string $version * @param bool $annexe * @param bool|string $retraite * @param array $queryParams * @return string */ public function listerFichiersThese(These $these, $nature, $version, $annexe = false, $retraite = false, array $queryParams = []) { $queryParams['nature'] = $this->idify($nature); $queryParams['version'] = $this->idify($version); if ($annexe !== null) { // todo: vérif provisoire if ($annexe && $this->idify($nature) !== NatureFichier::CODE_FICHIER_NON_PDF || !$annexe && $this->idify($nature) !== NatureFichier::CODE_THESE_PDF) { throw new \LogicException("Incohérence annexe et nature!"); } $queryParams['annexe'] = $annexe; } if ($retraite !== null) { $queryParams['retraite'] = $retraite; } return $this->fromRoute('fichier/these/lister', ['these' => $this->idify($these)], ['query' => $queryParams], true ); } } No newline at end of file Loading
module/Application/src/Application/Controller/FichierTheseController.php +1 −39 Changes for module/Application/src/Application/Controller/FichierTheseController.php: 1 added line, 39 removed lines. Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ class FichierTheseController extends AbstractController } if ($sort === null) { // null <=> paramètre absent // tri par défaut : datePremiereInscription // tri par défaut : nom $queryParams = array_merge($queryParams, ['sort' => 'f.nom', 'direction' => Sortable::ASC]); $needsRedirect = true; } Loading Loading @@ -114,44 +114,6 @@ class FichierTheseController extends AbstractController return $vm; } /** * Listage des fichiers (thèse ou annexes) déposés. * * @return ViewModel */ public function listerAction() { $these = $this->requestedThese(); $estAnnexe = $this->params()->fromQuery('annexe', false); // $estExpurge = $this->params()->fromQuery('expurge', false); $estRetraite = $this->params()->fromQuery('retraite', false); $inclureValidite = (bool)$this->params()->fromQuery('inclureValidite', false); $inclureRetraitement = (bool)$this->params()->fromQuery('inclureRetraitement', false); $version = $this->params()->fromQuery('version'); // $fichiers = $these->getFichiersBy($estAnnexe, $estExpurge, $estRetraite, $version); $nature = $estAnnexe ? NatureFichier::CODE_FICHIER_NON_PDF : NatureFichier::CODE_THESE_PDF; $fichiers = $this->fichierTheseService->getRepository()->fetchFichierTheses($these, $nature , $version , $estRetraite); $items = array_map(function (FichierThese $fichier) use ($these) { return [ 'file' => $fichier, 'downloadUrl' => $this->urlFichierThese()->telechargerFichierThese($these, $fichier), 'deleteUrl' => $this->urlFichierThese()->supprimerFichierThese($these, $fichier), ]; }, $fichiers); $viewModel = new ViewModel([ 'items' => $items, 'inclureValidite' => $inclureValidite, 'inclureRetraitement' => $inclureRetraitement, ]); $viewModel->setTemplate('application/fichier-these/lister-fichiers'); return $viewModel; } /** * Action de listage des fichiers déposés répondant aux critères de nature (et version) spécifiés. * Loading
module/Application/src/Application/Controller/Plugin/UrlFichierThese.php +0 −33 Changes for module/Application/src/Application/Controller/Plugin/UrlFichierThese.php: 0 added lines, 33 removed lines. Original line number Diff line number Diff line Loading @@ -75,37 +75,4 @@ class UrlFichierThese extends UrlPlugin true ); } /** * @param These $these * @param NatureFichier|string $nature * @param VersionFichier|string $version * @param bool $annexe * @param bool|string $retraite * @param array $queryParams * @return string */ public function listerFichiersThese(These $these, $nature, $version, $annexe = false, $retraite = false, array $queryParams = []) { $queryParams['nature'] = $this->idify($nature); $queryParams['version'] = $this->idify($version); if ($annexe !== null) { // todo: vérif provisoire if ($annexe && $this->idify($nature) !== NatureFichier::CODE_FICHIER_NON_PDF || !$annexe && $this->idify($nature) !== NatureFichier::CODE_THESE_PDF) { throw new \LogicException("Incohérence annexe et nature!"); } $queryParams['annexe'] = $annexe; } if ($retraite !== null) { $queryParams['retraite'] = $retraite; } return $this->fromRoute('fichier/these/lister', ['these' => $this->idify($these)], ['query' => $queryParams], true ); } } No newline at end of file