Loading module/Application/src/Controller/PieceJointeController.php +26 −3 Changes for module/Application/src/Controller/PieceJointeController.php: 26 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Application\Entity\Db\Fichier; use Application\Entity\Db\Intervenant; use Application\Entity\Db\PieceJointe; use Application\Entity\Db\TblPieceJointe; use Application\Entity\Db\TblPieceJointeDemande; use Application\Entity\Db\TypePieceJointe; use Application\Entity\Db\TypePieceJointeStatut; use Application\Entity\Db\Validation; Loading Loading @@ -57,6 +58,7 @@ class PieceJointeController extends AbstractController } /** * * @return ViewModel Loading Loading @@ -98,6 +100,7 @@ class PieceJointeController extends AbstractController } /** * * @return ViewModel Loading @@ -118,10 +121,14 @@ class PieceJointeController extends AbstractController } /** * @param TblPieceJointe[] $synthesePiecesJointes * @param TblPieceJointeDemande[] $demandees * @param TblPieceJointeFournie[] $fournies * * @return array */ protected function makeMessages($demandees, $fournies) protected function makeMessages(array $demandees, array $fournies) { $role = $this->getServiceContext()->getSelectedIdentityRole(); $isIntervenant = (boolean)$role->getIntervenant(); Loading @@ -131,7 +138,7 @@ class PieceJointeController extends AbstractController $nbObligatoiresNonFournis = 0; foreach ($demandees as $demandee) { if ($demandee->getObligatoire()) { if ($demandee->isObligatoire()) { $nbDemandees++; if (isset($fournies[$demandee->getTypePieceJointe()->getId()])) { $pj = $fournies[$demandee->getTypePieceJointe()->getId()]; Loading Loading @@ -162,6 +169,7 @@ class PieceJointeController extends AbstractController } public function validationAction() { $this->initFilters(); Loading @@ -174,6 +182,7 @@ class PieceJointeController extends AbstractController } public function validerAction() { $this->initFilters(); Loading @@ -191,6 +200,7 @@ class PieceJointeController extends AbstractController } public function archiverAction() { $this->initFilters(); Loading @@ -212,6 +222,7 @@ class PieceJointeController extends AbstractController } public function devaliderAction() { $this->initFilters(); Loading @@ -229,6 +240,7 @@ class PieceJointeController extends AbstractController } public function listerAction() { $this->initFilters(); Loading @@ -249,6 +261,7 @@ class PieceJointeController extends AbstractController } public function televerserAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading @@ -272,6 +285,7 @@ class PieceJointeController extends AbstractController } public function telechargerAction() { /** @var Fichier $fichier */ Loading @@ -292,6 +306,7 @@ class PieceJointeController extends AbstractController } public function supprimerAction() { if (!$this->getRequest()->isPost()) { Loading @@ -318,6 +333,7 @@ class PieceJointeController extends AbstractController } /* Actions liées à la configuration des PJ */ public function configurationAction() Loading @@ -326,6 +342,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeStatutAction() { $this->em()->getFilters()->enable('historique')->init(entity: [ Loading Loading @@ -375,6 +392,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeDeleteAction() { $typePieceJointe = $this->getEvent()->getParam('typePieceJointe'); Loading @@ -390,6 +408,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeSaisieAction() { /* @var $typePieceJointe TypePieceJointe */ Loading @@ -409,6 +428,7 @@ class PieceJointeController extends AbstractController } public function modifierTypePieceJointeStatutAction() { /* @var $tpjs TypePieceJointeStatut */ Loading @@ -434,6 +454,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeTrierAction() { /* @var $tpj TypePieceJointe */ Loading @@ -459,6 +480,7 @@ class PieceJointeController extends AbstractController } public function deleteTypePieceJointeStatutAction() { $typePieceJointeStatut = $this->getEvent()->getParam('typePieceJointeStatut'); Loading @@ -474,6 +496,7 @@ class PieceJointeController extends AbstractController } private function updateTableauxBord(Intervenant $intervenant, $validation = false) { $this->getServiceWorkflow()->calculerTableauxBord([ Loading module/Application/src/Service/PieceJointeService.php +6 −4 Changes for module/Application/src/Service/PieceJointeService.php: 6 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -2,7 +2,9 @@ namespace Application\Service; use Application\Entity\Db\TblPieceJointe; use Application\Entity\Db\TblPieceJointeDemande; use Application\Entity\Db\TblPieceJointeFournie; use Application\Service\Traits\FichierServiceAwareTrait; use Application\Service\Traits\TypeValidationServiceAwareTrait; use Application\Service\Traits\ValidationServiceAwareTrait; Loading Loading @@ -79,7 +81,7 @@ class PieceJointeService extends AbstractEntityService * * @param Intervenant $intervenant * * @return TypePieceJointe[] * @return TblPieceJointeDemande[] */ public function getTypesPiecesDemandees(Intervenant $intervenant) { Loading Loading @@ -133,9 +135,9 @@ class PieceJointeService extends AbstractEntityService /** * @param Intervenant $intervenant * * @return mixed $result * @return TblPieceJointe[] $result */ public function getPiecesSynthese(Intervenant $intervenant) public function getPiecesSynthese(Intervenant $intervenant): array { $dql = " SELECT Loading Loading @@ -163,7 +165,7 @@ class PieceJointeService extends AbstractEntityService /** * @param Intervenant $intervenant * * @return \Application\Entity\Db\PieceJointe[] * @return TblPieceJointeFournie[] */ public function getPiecesFournies(Intervenant $intervenant) { Loading module/Application/src/Service/ServiceReferentielService.php +1 −1 Changes for module/Application/src/Service/ServiceReferentielService.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class ServiceReferentielService extends AbstractEntityService if (!$entity->getIntervenant() && $intervenant = $role->getIntervenant()) { $entity->setIntervenant($intervenant); } if (!$this->getAuthorize()->isAllowed($entity, Privileges::REFERENTIEL_PREVU_EDITION) || !$this->getAuthorize()->isAllowed($entity, Privileges::REFERENTIEL_REALISE_EDITION)) { if (!$this->getAuthorize()->isAllowed($entity, $entity->getTypeVolumeHoraire()->getPrivilegeReferentielEdition())) { throw new \BjyAuthorize\Exception\UnAuthorizedException('Saisie interdite'); } Loading module/Application/view/application/piece-jointe/index.phtml +4 −3 Changes for module/Application/view/application/piece-jointe/index.phtml: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -6,8 +6,9 @@ use Application\Provider\Privilege\Privileges; * @var $this \Application\View\Renderer\PhpRenderer * @var $intervenant \Application\Entity\Db\Intervenant * @var $title string * @var $demandees \Application\Entity\Db\TypePieceJointe[] * @var $fournies \Application\Entity\Db\PieceJointe[] * @var $demandees \Application\Entity\Db\TblPieceJointeDemande[] * @var $fournies \Application\Entity\Db\TblPieceJointeFournie[] * @var $synthese \Application\Entity\Db\TblPieceJointe[] * @var $messages array * @var $alertContrat boolean */ Loading Loading @@ -39,7 +40,7 @@ $menuUrl = $this->url('piece-jointe/intervenant', ['intervenant' => $intervenant $obligatoire = true; foreach ($demandees as $pj) { // on liste les pièces demandées //Check si piece obligatoire $obligatoire = $pj->getObligatoire(); $obligatoire = $pj->isObligatoire(); $tpj = $pj->getTypePieceJointe(); if (isset($fournies[$tpj->getId()]) && $synthese[$tpj->getId()]->getFournie() == 1) { // qu'elles soient fournies ou non $pj = $fournies[$tpj->getId()]; Loading Loading
module/Application/src/Controller/PieceJointeController.php +26 −3 Changes for module/Application/src/Controller/PieceJointeController.php: 26 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Application\Entity\Db\Fichier; use Application\Entity\Db\Intervenant; use Application\Entity\Db\PieceJointe; use Application\Entity\Db\TblPieceJointe; use Application\Entity\Db\TblPieceJointeDemande; use Application\Entity\Db\TypePieceJointe; use Application\Entity\Db\TypePieceJointeStatut; use Application\Entity\Db\Validation; Loading Loading @@ -57,6 +58,7 @@ class PieceJointeController extends AbstractController } /** * * @return ViewModel Loading Loading @@ -98,6 +100,7 @@ class PieceJointeController extends AbstractController } /** * * @return ViewModel Loading @@ -118,10 +121,14 @@ class PieceJointeController extends AbstractController } /** * @param TblPieceJointe[] $synthesePiecesJointes * @param TblPieceJointeDemande[] $demandees * @param TblPieceJointeFournie[] $fournies * * @return array */ protected function makeMessages($demandees, $fournies) protected function makeMessages(array $demandees, array $fournies) { $role = $this->getServiceContext()->getSelectedIdentityRole(); $isIntervenant = (boolean)$role->getIntervenant(); Loading @@ -131,7 +138,7 @@ class PieceJointeController extends AbstractController $nbObligatoiresNonFournis = 0; foreach ($demandees as $demandee) { if ($demandee->getObligatoire()) { if ($demandee->isObligatoire()) { $nbDemandees++; if (isset($fournies[$demandee->getTypePieceJointe()->getId()])) { $pj = $fournies[$demandee->getTypePieceJointe()->getId()]; Loading Loading @@ -162,6 +169,7 @@ class PieceJointeController extends AbstractController } public function validationAction() { $this->initFilters(); Loading @@ -174,6 +182,7 @@ class PieceJointeController extends AbstractController } public function validerAction() { $this->initFilters(); Loading @@ -191,6 +200,7 @@ class PieceJointeController extends AbstractController } public function archiverAction() { $this->initFilters(); Loading @@ -212,6 +222,7 @@ class PieceJointeController extends AbstractController } public function devaliderAction() { $this->initFilters(); Loading @@ -229,6 +240,7 @@ class PieceJointeController extends AbstractController } public function listerAction() { $this->initFilters(); Loading @@ -249,6 +261,7 @@ class PieceJointeController extends AbstractController } public function televerserAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading @@ -272,6 +285,7 @@ class PieceJointeController extends AbstractController } public function telechargerAction() { /** @var Fichier $fichier */ Loading @@ -292,6 +306,7 @@ class PieceJointeController extends AbstractController } public function supprimerAction() { if (!$this->getRequest()->isPost()) { Loading @@ -318,6 +333,7 @@ class PieceJointeController extends AbstractController } /* Actions liées à la configuration des PJ */ public function configurationAction() Loading @@ -326,6 +342,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeStatutAction() { $this->em()->getFilters()->enable('historique')->init(entity: [ Loading Loading @@ -375,6 +392,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeDeleteAction() { $typePieceJointe = $this->getEvent()->getParam('typePieceJointe'); Loading @@ -390,6 +408,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeSaisieAction() { /* @var $typePieceJointe TypePieceJointe */ Loading @@ -409,6 +428,7 @@ class PieceJointeController extends AbstractController } public function modifierTypePieceJointeStatutAction() { /* @var $tpjs TypePieceJointeStatut */ Loading @@ -434,6 +454,7 @@ class PieceJointeController extends AbstractController } public function typePieceJointeTrierAction() { /* @var $tpj TypePieceJointe */ Loading @@ -459,6 +480,7 @@ class PieceJointeController extends AbstractController } public function deleteTypePieceJointeStatutAction() { $typePieceJointeStatut = $this->getEvent()->getParam('typePieceJointeStatut'); Loading @@ -474,6 +496,7 @@ class PieceJointeController extends AbstractController } private function updateTableauxBord(Intervenant $intervenant, $validation = false) { $this->getServiceWorkflow()->calculerTableauxBord([ Loading
module/Application/src/Service/PieceJointeService.php +6 −4 Changes for module/Application/src/Service/PieceJointeService.php: 6 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -2,7 +2,9 @@ namespace Application\Service; use Application\Entity\Db\TblPieceJointe; use Application\Entity\Db\TblPieceJointeDemande; use Application\Entity\Db\TblPieceJointeFournie; use Application\Service\Traits\FichierServiceAwareTrait; use Application\Service\Traits\TypeValidationServiceAwareTrait; use Application\Service\Traits\ValidationServiceAwareTrait; Loading Loading @@ -79,7 +81,7 @@ class PieceJointeService extends AbstractEntityService * * @param Intervenant $intervenant * * @return TypePieceJointe[] * @return TblPieceJointeDemande[] */ public function getTypesPiecesDemandees(Intervenant $intervenant) { Loading Loading @@ -133,9 +135,9 @@ class PieceJointeService extends AbstractEntityService /** * @param Intervenant $intervenant * * @return mixed $result * @return TblPieceJointe[] $result */ public function getPiecesSynthese(Intervenant $intervenant) public function getPiecesSynthese(Intervenant $intervenant): array { $dql = " SELECT Loading Loading @@ -163,7 +165,7 @@ class PieceJointeService extends AbstractEntityService /** * @param Intervenant $intervenant * * @return \Application\Entity\Db\PieceJointe[] * @return TblPieceJointeFournie[] */ public function getPiecesFournies(Intervenant $intervenant) { Loading
module/Application/src/Service/ServiceReferentielService.php +1 −1 Changes for module/Application/src/Service/ServiceReferentielService.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class ServiceReferentielService extends AbstractEntityService if (!$entity->getIntervenant() && $intervenant = $role->getIntervenant()) { $entity->setIntervenant($intervenant); } if (!$this->getAuthorize()->isAllowed($entity, Privileges::REFERENTIEL_PREVU_EDITION) || !$this->getAuthorize()->isAllowed($entity, Privileges::REFERENTIEL_REALISE_EDITION)) { if (!$this->getAuthorize()->isAllowed($entity, $entity->getTypeVolumeHoraire()->getPrivilegeReferentielEdition())) { throw new \BjyAuthorize\Exception\UnAuthorizedException('Saisie interdite'); } Loading
module/Application/view/application/piece-jointe/index.phtml +4 −3 Changes for module/Application/view/application/piece-jointe/index.phtml: 4 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -6,8 +6,9 @@ use Application\Provider\Privilege\Privileges; * @var $this \Application\View\Renderer\PhpRenderer * @var $intervenant \Application\Entity\Db\Intervenant * @var $title string * @var $demandees \Application\Entity\Db\TypePieceJointe[] * @var $fournies \Application\Entity\Db\PieceJointe[] * @var $demandees \Application\Entity\Db\TblPieceJointeDemande[] * @var $fournies \Application\Entity\Db\TblPieceJointeFournie[] * @var $synthese \Application\Entity\Db\TblPieceJointe[] * @var $messages array * @var $alertContrat boolean */ Loading Loading @@ -39,7 +40,7 @@ $menuUrl = $this->url('piece-jointe/intervenant', ['intervenant' => $intervenant $obligatoire = true; foreach ($demandees as $pj) { // on liste les pièces demandées //Check si piece obligatoire $obligatoire = $pj->getObligatoire(); $obligatoire = $pj->isObligatoire(); $tpj = $pj->getTypePieceJointe(); if (isset($fournies[$tpj->getId()]) && $synthese[$tpj->getId()]->getFournie() == 1) { // qu'elles soient fournies ou non $pj = $fournies[$tpj->getId()]; Loading