Loading CHANGELOG.md +1 −0 Changes for CHANGELOG.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ Journal des modifications - Ajout de redirection de mail lorsque certains mails n'ont pas de destinataire "ATTENTION MAIL NON DÉLIVRÉ". - Compléments d'individu : mise en place des éléments de base - Modification du texte de mail de réussite au doctorat - [FIX] verification des assertions au niveau des actions de PropositionController 4.0.3 ----- Loading module/Application/src/Application/Service/EcoleDoctorale/EcoleDoctoraleService.php +3 −3 Changes for module/Application/src/Application/Service/EcoleDoctorale/EcoleDoctoraleService.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ namespace Application\Service\EcoleDoctorale; use Application\Entity\Db\EcoleDoctorale; use Application\Entity\Db\Etablissement; use Application\Entity\Db\Individu; use Application\Entity\Db\Repository\EcoleDoctoraleRepository; use Application\Entity\Db\Structure; Loading @@ -13,8 +12,8 @@ use Application\Service\BaseService; use Application\Service\Role\RoleServiceAwareTrait; use Application\SourceCodeStringHelperAwareTrait; use Doctrine\ORM\OptimisticLockException; use Laminas\Mvc\Controller\AbstractActionController; use UnicaenApp\Exception\RuntimeException; use Zend\Mvc\Controller\AbstractActionController; /** * @method EcoleDoctorale|null findOneBy(array $criteria, array $orderBy = null) Loading Loading @@ -144,7 +143,8 @@ class EcoleDoctoraleService extends BaseService /** * Instancie une pseudo-école doctorale "Toute école doctorale confondue" utile dans les vues. * *use Application\Entity\Db\Etablissement; * @return EcoleDoctorale */ public function createTouteEcoleDoctoraleConfondue() Loading module/Soutenance/src/Soutenance/Assertion/PropositionAssertion.php +25 −6 Changes for module/Soutenance/src/Soutenance/Assertion/PropositionAssertion.php: 25 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ class PropositionAssertion implements AssertionInterface { public function assert(Acl $acl, RoleInterface $role = null, ResourceInterface $resource = null, $privilege = null) { /** Recuperation de la proposition **/ /** @var These $these */ $these = $resource; $proposition = null; Loading @@ -48,14 +49,38 @@ class PropositionAssertion implements AssertionInterface { break; } } $role = $this->userContextService->getSelectedIdentityRole(); return $this->computeValeur($role, $proposition, $privilege); } /** * @param RoleInterface|null $role * @param Proposition|null $resource * @param $privilege * @return bool * */ public function computeValeur(RoleInterface $role = null, ?Proposition $proposition = null, $privilege = null) : bool { $these = $proposition->getThese(); $sursis = ($proposition)?$proposition->hasSursis():false; $dateValidationMax = ($proposition->getDate())?DateTime::createFromFormat('d/m/Y',$proposition->getDate()->format('d/m/Y'))->sub(new DateInterval('P2M')):null; $dateCurrent = new DateTime(); /** @var Role $identityRole */ if ($role === null) { $identityRole = $this->userContextService->getSelectedIdentityRole(); $role = $identityRole->getCode(); $structure = $identityRole->getStructure(); } else { $structure = $role->getStructure(); $role = $role->getCode(); } $individu = $this->userContextService->getIdentityDb()->getIndividu(); $doctorant = $these->getDoctorant()->getIndividu(); Loading Loading @@ -113,12 +138,6 @@ class PropositionAssertion implements AssertionInterface { return true; case Role::CODE_BDD : return ($these->getEtablissement()->getStructure() === $identityRole->getStructure()); // $validations_ACTEUR = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_PROPOSITION_SOUTENANCE, $these); // $validations_UNITE = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_VALIDATION_PROPOSITION_UR, $these); // $nbDirs = count($these->getActeursByRoleCode(Role::CODE_DIRECTEUR_THESE)); // $nbCoDirs = count($these->getActeursByRoleCode(Role::CODE_CODIRECTEUR_THESE)); // $nbActeur = 1 + $nbDirs + $nbCoDirs; // return !$validations_UNITE && count($validations_ACTEUR) === $nbActeur && $structure === $theseEtablissementStructure; default: return false; } Loading module/Soutenance/src/Soutenance/Assertion/PropositionAssertionAwareTrait.php 0 → 100644 +27 −0 Changes for module/Soutenance/src/Soutenance/Assertion/PropositionAssertionAwareTrait.php: 27 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Soutenance\Assertion; trait PropositionAssertionAwareTrait { /** @var PropositionAssertion */ private $propositionAssertion; /** * @return PropositionAssertion */ public function getPropositionAssertion(): PropositionAssertion { return $this->propositionAssertion; } /** * @param PropositionAssertion $propositionAssertion */ public function setPropositionAssertion(PropositionAssertion $propositionAssertion): void { $this->propositionAssertion = $propositionAssertion; } } No newline at end of file module/Soutenance/src/Soutenance/Controller/PropositionController.php +173 −74 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
CHANGELOG.md +1 −0 Changes for CHANGELOG.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ Journal des modifications - Ajout de redirection de mail lorsque certains mails n'ont pas de destinataire "ATTENTION MAIL NON DÉLIVRÉ". - Compléments d'individu : mise en place des éléments de base - Modification du texte de mail de réussite au doctorat - [FIX] verification des assertions au niveau des actions de PropositionController 4.0.3 ----- Loading
module/Application/src/Application/Service/EcoleDoctorale/EcoleDoctoraleService.php +3 −3 Changes for module/Application/src/Application/Service/EcoleDoctorale/EcoleDoctoraleService.php: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ namespace Application\Service\EcoleDoctorale; use Application\Entity\Db\EcoleDoctorale; use Application\Entity\Db\Etablissement; use Application\Entity\Db\Individu; use Application\Entity\Db\Repository\EcoleDoctoraleRepository; use Application\Entity\Db\Structure; Loading @@ -13,8 +12,8 @@ use Application\Service\BaseService; use Application\Service\Role\RoleServiceAwareTrait; use Application\SourceCodeStringHelperAwareTrait; use Doctrine\ORM\OptimisticLockException; use Laminas\Mvc\Controller\AbstractActionController; use UnicaenApp\Exception\RuntimeException; use Zend\Mvc\Controller\AbstractActionController; /** * @method EcoleDoctorale|null findOneBy(array $criteria, array $orderBy = null) Loading Loading @@ -144,7 +143,8 @@ class EcoleDoctoraleService extends BaseService /** * Instancie une pseudo-école doctorale "Toute école doctorale confondue" utile dans les vues. * *use Application\Entity\Db\Etablissement; * @return EcoleDoctorale */ public function createTouteEcoleDoctoraleConfondue() Loading
module/Soutenance/src/Soutenance/Assertion/PropositionAssertion.php +25 −6 Changes for module/Soutenance/src/Soutenance/Assertion/PropositionAssertion.php: 25 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ class PropositionAssertion implements AssertionInterface { public function assert(Acl $acl, RoleInterface $role = null, ResourceInterface $resource = null, $privilege = null) { /** Recuperation de la proposition **/ /** @var These $these */ $these = $resource; $proposition = null; Loading @@ -48,14 +49,38 @@ class PropositionAssertion implements AssertionInterface { break; } } $role = $this->userContextService->getSelectedIdentityRole(); return $this->computeValeur($role, $proposition, $privilege); } /** * @param RoleInterface|null $role * @param Proposition|null $resource * @param $privilege * @return bool * */ public function computeValeur(RoleInterface $role = null, ?Proposition $proposition = null, $privilege = null) : bool { $these = $proposition->getThese(); $sursis = ($proposition)?$proposition->hasSursis():false; $dateValidationMax = ($proposition->getDate())?DateTime::createFromFormat('d/m/Y',$proposition->getDate()->format('d/m/Y'))->sub(new DateInterval('P2M')):null; $dateCurrent = new DateTime(); /** @var Role $identityRole */ if ($role === null) { $identityRole = $this->userContextService->getSelectedIdentityRole(); $role = $identityRole->getCode(); $structure = $identityRole->getStructure(); } else { $structure = $role->getStructure(); $role = $role->getCode(); } $individu = $this->userContextService->getIdentityDb()->getIndividu(); $doctorant = $these->getDoctorant()->getIndividu(); Loading Loading @@ -113,12 +138,6 @@ class PropositionAssertion implements AssertionInterface { return true; case Role::CODE_BDD : return ($these->getEtablissement()->getStructure() === $identityRole->getStructure()); // $validations_ACTEUR = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_PROPOSITION_SOUTENANCE, $these); // $validations_UNITE = $this->getValidationService()->getRepository()->findValidationByCodeAndThese(TypeValidation::CODE_VALIDATION_PROPOSITION_UR, $these); // $nbDirs = count($these->getActeursByRoleCode(Role::CODE_DIRECTEUR_THESE)); // $nbCoDirs = count($these->getActeursByRoleCode(Role::CODE_CODIRECTEUR_THESE)); // $nbActeur = 1 + $nbDirs + $nbCoDirs; // return !$validations_UNITE && count($validations_ACTEUR) === $nbActeur && $structure === $theseEtablissementStructure; default: return false; } Loading
module/Soutenance/src/Soutenance/Assertion/PropositionAssertionAwareTrait.php 0 → 100644 +27 −0 Changes for module/Soutenance/src/Soutenance/Assertion/PropositionAssertionAwareTrait.php: 27 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Soutenance\Assertion; trait PropositionAssertionAwareTrait { /** @var PropositionAssertion */ private $propositionAssertion; /** * @return PropositionAssertion */ public function getPropositionAssertion(): PropositionAssertion { return $this->propositionAssertion; } /** * @param PropositionAssertion $propositionAssertion */ public function setPropositionAssertion(PropositionAssertion $propositionAssertion): void { $this->propositionAssertion = $propositionAssertion; } } No newline at end of file
module/Soutenance/src/Soutenance/Controller/PropositionController.php +173 −74 File changed.Preview size limit exceeded, changes collapsed. Show changes