Loading module/Application/src/Application/Entity/Db/NatureFichier.php +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ class NatureFichier const CODE_PROLONG_CONFIDENT = 'PROLONG_CONFIDENT'; const CODE_CONV_MISE_EN_LIGNE = 'CONV_MISE_EN_LIGNE'; const CODE_AVENANT_CONV_MISE_EN_LIGNE = 'AVENANT_CONV_MISE_EN_LIGNE'; const CODE_INFORMATION = 'INFORMATION'; /** * @var string Loading module/Application/src/Application/Entity/Db/Repository/FichierRepository.php +17 −0 Original line number Diff line number Diff line Loading @@ -124,4 +124,21 @@ class FichierRepository extends DefaultEntityRepository $fichiers = $this->fetchFichiers($these, NatureFichier::CODE_THESE_PDF , $version); return !empty($fichiers); } /** * @param NatureFichier|string $nature * @return Fichier[] */ public function fetchFichiersByNature($nature) { $qb = $this->createQueryBuilder("fichier") ->andWhere('fichier.nature = :nature') ->andWhere('fichier.histoDestruction IS NULL') ->setParameter("nature", $nature) ->orderBy('fichier.histoCreation') ; $result = $qb->getQuery()->getResult(); return $result; } } No newline at end of file module/Application/src/Application/Service/Fichier/FichierService.php +14 −0 Original line number Diff line number Diff line Loading @@ -698,4 +698,18 @@ class FichierService extends BaseService } } /** * @param Fichier $fichier * @return Fichier */ public function update($fichier) { try { $this->getEntityManager()->flush($fichier); } catch (OptimisticLockException $e) { throw new RuntimeException("Problème lors de la mise à jour du Fichier", $e); } return $fichier; } } No newline at end of file module/Application/src/Application/Service/File/FileService.php +5 −0 Original line number Diff line number Diff line Loading @@ -184,4 +184,9 @@ class FileService return $content; } public function computeDirectoryPathForInformation() { $path = $this->rootDirectoryPathForUploadedFiles . '/' . 'information'; return $path; } } No newline at end of file module/Information/config/module.config.php +55 −0 Original line number Diff line number Diff line <?php use Application\Entity\Db\Repository\DefaultEntityRepository; use Information\Controller\FichierController; use Information\Controller\InformationController; use Information\Controller\InformationControllerFactory; use Information\Form\FichierForm; use Information\Form\InformationForm; use Information\Form\InformationFormFactory; use Information\Form\InformationHydrator; use Information\Provider\Privilege\InformationPrivileges; use Information\Service\InformationFichierService; use Information\Service\InformationFichierServiceFactory; use Information\Service\InformationService; use Information\Service\InformationServiceFactory; use Zend\Mvc\Router\Http\Literal; Loading Loading @@ -102,6 +106,17 @@ return [ ], 'roles' => [], ], [ 'controller' => FichierController::class, 'action' => [ 'index', 'supprimer', 'telecharger', ], 'privileges' => [ InformationPrivileges::INFORMATION_MODIFIER, ] ], ], ], ], Loading @@ -118,6 +133,41 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'fichiers' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ 'route' => '/fichiers', 'defaults' => [ 'controller' => FichierController::class, 'action' => 'index', ], ], 'child_routes' => [ 'supprimer' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/supprimer/:id', 'defaults' => [ 'controller' => FichierController::class, 'action' => 'supprimer', ], ], ], 'telecharger' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/telecharger/:id', 'defaults' => [ 'controller' => FichierController::class, 'action' => 'telecharger', ], ], ], ], ], 'afficher' => [ 'type' => Segment::class, 'options' => [ Loading Loading @@ -192,15 +242,20 @@ return [ ], 'factories' => [ InformationService::class => InformationServiceFactory::class, InformationFichierService::class => InformationFichierServiceFactory::class, ], ], 'controllers' => [ 'factories' => [ InformationController::class => InformationControllerFactory::class, FichierController::class => \Information\Controller\FichierControllerFactory::class, ], ], 'form_elements' => [ 'invokables' => [ FichierForm::class => FichierForm::class, ], 'factories' => [ InformationForm::class => InformationFormFactory::class, ], Loading Loading
module/Application/src/Application/Entity/Db/NatureFichier.php +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ class NatureFichier const CODE_PROLONG_CONFIDENT = 'PROLONG_CONFIDENT'; const CODE_CONV_MISE_EN_LIGNE = 'CONV_MISE_EN_LIGNE'; const CODE_AVENANT_CONV_MISE_EN_LIGNE = 'AVENANT_CONV_MISE_EN_LIGNE'; const CODE_INFORMATION = 'INFORMATION'; /** * @var string Loading
module/Application/src/Application/Entity/Db/Repository/FichierRepository.php +17 −0 Original line number Diff line number Diff line Loading @@ -124,4 +124,21 @@ class FichierRepository extends DefaultEntityRepository $fichiers = $this->fetchFichiers($these, NatureFichier::CODE_THESE_PDF , $version); return !empty($fichiers); } /** * @param NatureFichier|string $nature * @return Fichier[] */ public function fetchFichiersByNature($nature) { $qb = $this->createQueryBuilder("fichier") ->andWhere('fichier.nature = :nature') ->andWhere('fichier.histoDestruction IS NULL') ->setParameter("nature", $nature) ->orderBy('fichier.histoCreation') ; $result = $qb->getQuery()->getResult(); return $result; } } No newline at end of file
module/Application/src/Application/Service/Fichier/FichierService.php +14 −0 Original line number Diff line number Diff line Loading @@ -698,4 +698,18 @@ class FichierService extends BaseService } } /** * @param Fichier $fichier * @return Fichier */ public function update($fichier) { try { $this->getEntityManager()->flush($fichier); } catch (OptimisticLockException $e) { throw new RuntimeException("Problème lors de la mise à jour du Fichier", $e); } return $fichier; } } No newline at end of file
module/Application/src/Application/Service/File/FileService.php +5 −0 Original line number Diff line number Diff line Loading @@ -184,4 +184,9 @@ class FileService return $content; } public function computeDirectoryPathForInformation() { $path = $this->rootDirectoryPathForUploadedFiles . '/' . 'information'; return $path; } } No newline at end of file
module/Information/config/module.config.php +55 −0 Original line number Diff line number Diff line <?php use Application\Entity\Db\Repository\DefaultEntityRepository; use Information\Controller\FichierController; use Information\Controller\InformationController; use Information\Controller\InformationControllerFactory; use Information\Form\FichierForm; use Information\Form\InformationForm; use Information\Form\InformationFormFactory; use Information\Form\InformationHydrator; use Information\Provider\Privilege\InformationPrivileges; use Information\Service\InformationFichierService; use Information\Service\InformationFichierServiceFactory; use Information\Service\InformationService; use Information\Service\InformationServiceFactory; use Zend\Mvc\Router\Http\Literal; Loading Loading @@ -102,6 +106,17 @@ return [ ], 'roles' => [], ], [ 'controller' => FichierController::class, 'action' => [ 'index', 'supprimer', 'telecharger', ], 'privileges' => [ InformationPrivileges::INFORMATION_MODIFIER, ] ], ], ], ], Loading @@ -118,6 +133,41 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ 'fichiers' => [ 'type' => Literal::class, 'may_terminate' => true, 'options' => [ 'route' => '/fichiers', 'defaults' => [ 'controller' => FichierController::class, 'action' => 'index', ], ], 'child_routes' => [ 'supprimer' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/supprimer/:id', 'defaults' => [ 'controller' => FichierController::class, 'action' => 'supprimer', ], ], ], 'telecharger' => [ 'type' => Segment::class, 'may_terminate' => true, 'options' => [ 'route' => '/telecharger/:id', 'defaults' => [ 'controller' => FichierController::class, 'action' => 'telecharger', ], ], ], ], ], 'afficher' => [ 'type' => Segment::class, 'options' => [ Loading Loading @@ -192,15 +242,20 @@ return [ ], 'factories' => [ InformationService::class => InformationServiceFactory::class, InformationFichierService::class => InformationFichierServiceFactory::class, ], ], 'controllers' => [ 'factories' => [ InformationController::class => InformationControllerFactory::class, FichierController::class => \Information\Controller\FichierControllerFactory::class, ], ], 'form_elements' => [ 'invokables' => [ FichierForm::class => FichierForm::class, ], 'factories' => [ InformationForm::class => InformationFormFactory::class, ], Loading