Loading module/TheseCotutelle/config/others/presence.config.php +3 −0 Changes for module/TheseCotutelle/config/others/presence.config.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ use TheseCotutelle\Form\TheseCotutellePresenceFormFactory; use TheseCotutelle\Hydrator\TheseCotutellePresenceHydrator; use TheseCotutelle\Hydrator\TheseCotutellePresenceHydratorFactory; use TheseCotutelle\Provider\TheseCotutellePrivileges; use TheseCotutelle\Rule\PresencePeriodeDisponibleRule; use TheseCotutelle\Rule\PresencePeriodeDisponibleRuleFactory; use UnicaenPrivilege\Guard\PrivilegeController; use UnicaenPrivilege\Provider\Rule\PrivilegeRuleProvider; Loading Loading @@ -172,6 +174,7 @@ return [ 'factories' => [ TheseCotutellePresenceAssertion::class => TheseCotutellePresenceAssertionFactory::class, TheseCotutellePresenceService::class => TheseCotutellePresenceServiceFactory::class, PresencePeriodeDisponibleRule::class => PresencePeriodeDisponibleRuleFactory::class, ], ], ]; No newline at end of file module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertion.php +10 −4 Changes for module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertion.php: 10 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,13 @@ class TheseCotutellePresenceAssertion extends AbstractAssertion use TheseCotutellePresenceServiceAwareTrait; use AssertAppartenanceTheseTrait; protected PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule; public function setPresencePeriodeDisponibleRule(PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule): void { $this->presencePeriodeDisponibleRule = $presencePeriodeDisponibleRule; } protected function assertEntity(ResourceInterface $entity, $privilege = null): bool { if (!parent::assertEntity($entity, $privilege)) { Loading Loading @@ -182,12 +189,11 @@ class TheseCotutellePresenceAssertion extends AbstractAssertion */ private function assertPeriodeDisponible(TheseCotutelle $theseCotutelle): void { $rule = new PresencePeriodeDisponibleRule(); $rule->setTheseCotutelle($theseCotutelle); $rule->execute(); $this->presencePeriodeDisponibleRule->setTheseCotutelle($theseCotutelle); $this->presencePeriodeDisponibleRule->execute(); $this->assertTrue( $rule->existsPeriodeDisponible(), $this->presencePeriodeDisponibleRule->existsPeriodeDisponible(), "Les périodes de présences déclarées couvrent l'intégralité de la période de cotutelle." ); } Loading module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertionFactory.php +5 −0 Changes for module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertionFactory.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Application\Assertion\AbstractAssertion; use Psr\Container\ContainerInterface; use TheseCotutelle\Entity\Db\Service\TheseCotutellePresenceService; use TheseCotutelle\Entity\Db\Service\TheseCotutelleService; use TheseCotutelle\Rule\PresencePeriodeDisponibleRule; use UnicaenAuthentification\Service\UserContext; class TheseCotutellePresenceAssertionFactory Loading @@ -26,6 +27,10 @@ class TheseCotutellePresenceAssertionFactory $theseCotutellePresenceService = $container->get(TheseCotutellePresenceService::class); $assertion->setTheseCotutellePresenceService($theseCotutellePresenceService); /** @var PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule */ $presencePeriodeDisponibleRule = $container->get(PresencePeriodeDisponibleRule::class); $assertion->setPresencePeriodeDisponibleRule($presencePeriodeDisponibleRule); $this->injectCommons($assertion, $container); return $assertion; Loading module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleController.php +9 −4 Changes for module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleController.php: 9 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -25,12 +25,18 @@ class TheseCotutelleController extends AbstractController private These $these; protected ?TheseCotutelle $theseCotutelle; protected TheseCotutelleForm $theseCotutelleForm; protected PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule; public function setTheseCotutelleForm(TheseCotutelleForm $theseCotutelleForm): void { $this->theseCotutelleForm = $theseCotutelleForm; } public function setPresencePeriodeDisponibleRule(PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule): void { $this->presencePeriodeDisponibleRule = $presencePeriodeDisponibleRule; } public function consulterAction(): ViewModel { $vm = new ViewModel(); Loading @@ -48,14 +54,13 @@ class TheseCotutelleController extends AbstractController $this->theseCotutelle = $this->theseCotutelleService->getRepository()->findOneByThese($this->these); $presencePeriodeDisponibleRule = new PresencePeriodeDisponibleRule(); $presencePeriodeDisponibleRule->setTheseCotutelle($this->theseCotutelle); $presencePeriodeDisponibleRule->execute(); $this->presencePeriodeDisponibleRule->setTheseCotutelle($this->theseCotutelle); $this->presencePeriodeDisponibleRule->execute(); $vm->setVariables([ 'these' => $this->these, 'theseCotutelle' => $this->theseCotutelle, 'presencePeriodeDisponibleRule' => $presencePeriodeDisponibleRule, 'presencePeriodeDisponibleRule' => $this->presencePeriodeDisponibleRule, ]); return $vm; Loading module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleControllerFactory.php +5 −0 Changes for module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleControllerFactory.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Structure\Service\Etablissement\EtablissementService; use These\Service\These\TheseService; use TheseCotutelle\Entity\Db\Service\TheseCotutelleService; use TheseCotutelle\Form\TheseCotutelleForm; use TheseCotutelle\Rule\PresencePeriodeDisponibleRule; class TheseCotutelleControllerFactory implements FactoryInterface { Loading @@ -31,6 +32,10 @@ class TheseCotutelleControllerFactory implements FactoryInterface $etablissementService = $container->get(EtablissementService::class); $controller->setEtablissementService($etablissementService); /** @var PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule */ $presencePeriodeDisponibleRule = $container->get(PresencePeriodeDisponibleRule::class); $controller->setPresencePeriodeDisponibleRule($presencePeriodeDisponibleRule); return $controller; } } No newline at end of file Loading
module/TheseCotutelle/config/others/presence.config.php +3 −0 Changes for module/TheseCotutelle/config/others/presence.config.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ use TheseCotutelle\Form\TheseCotutellePresenceFormFactory; use TheseCotutelle\Hydrator\TheseCotutellePresenceHydrator; use TheseCotutelle\Hydrator\TheseCotutellePresenceHydratorFactory; use TheseCotutelle\Provider\TheseCotutellePrivileges; use TheseCotutelle\Rule\PresencePeriodeDisponibleRule; use TheseCotutelle\Rule\PresencePeriodeDisponibleRuleFactory; use UnicaenPrivilege\Guard\PrivilegeController; use UnicaenPrivilege\Provider\Rule\PrivilegeRuleProvider; Loading Loading @@ -172,6 +174,7 @@ return [ 'factories' => [ TheseCotutellePresenceAssertion::class => TheseCotutellePresenceAssertionFactory::class, TheseCotutellePresenceService::class => TheseCotutellePresenceServiceFactory::class, PresencePeriodeDisponibleRule::class => PresencePeriodeDisponibleRuleFactory::class, ], ], ]; No newline at end of file
module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertion.php +10 −4 Changes for module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertion.php: 10 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,13 @@ class TheseCotutellePresenceAssertion extends AbstractAssertion use TheseCotutellePresenceServiceAwareTrait; use AssertAppartenanceTheseTrait; protected PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule; public function setPresencePeriodeDisponibleRule(PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule): void { $this->presencePeriodeDisponibleRule = $presencePeriodeDisponibleRule; } protected function assertEntity(ResourceInterface $entity, $privilege = null): bool { if (!parent::assertEntity($entity, $privilege)) { Loading Loading @@ -182,12 +189,11 @@ class TheseCotutellePresenceAssertion extends AbstractAssertion */ private function assertPeriodeDisponible(TheseCotutelle $theseCotutelle): void { $rule = new PresencePeriodeDisponibleRule(); $rule->setTheseCotutelle($theseCotutelle); $rule->execute(); $this->presencePeriodeDisponibleRule->setTheseCotutelle($theseCotutelle); $this->presencePeriodeDisponibleRule->execute(); $this->assertTrue( $rule->existsPeriodeDisponible(), $this->presencePeriodeDisponibleRule->existsPeriodeDisponible(), "Les périodes de présences déclarées couvrent l'intégralité de la période de cotutelle." ); } Loading
module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertionFactory.php +5 −0 Changes for module/TheseCotutelle/src/TheseCotutelle/Assertion/TheseCotutellePresenceAssertionFactory.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Application\Assertion\AbstractAssertion; use Psr\Container\ContainerInterface; use TheseCotutelle\Entity\Db\Service\TheseCotutellePresenceService; use TheseCotutelle\Entity\Db\Service\TheseCotutelleService; use TheseCotutelle\Rule\PresencePeriodeDisponibleRule; use UnicaenAuthentification\Service\UserContext; class TheseCotutellePresenceAssertionFactory Loading @@ -26,6 +27,10 @@ class TheseCotutellePresenceAssertionFactory $theseCotutellePresenceService = $container->get(TheseCotutellePresenceService::class); $assertion->setTheseCotutellePresenceService($theseCotutellePresenceService); /** @var PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule */ $presencePeriodeDisponibleRule = $container->get(PresencePeriodeDisponibleRule::class); $assertion->setPresencePeriodeDisponibleRule($presencePeriodeDisponibleRule); $this->injectCommons($assertion, $container); return $assertion; Loading
module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleController.php +9 −4 Changes for module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleController.php: 9 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -25,12 +25,18 @@ class TheseCotutelleController extends AbstractController private These $these; protected ?TheseCotutelle $theseCotutelle; protected TheseCotutelleForm $theseCotutelleForm; protected PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule; public function setTheseCotutelleForm(TheseCotutelleForm $theseCotutelleForm): void { $this->theseCotutelleForm = $theseCotutelleForm; } public function setPresencePeriodeDisponibleRule(PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule): void { $this->presencePeriodeDisponibleRule = $presencePeriodeDisponibleRule; } public function consulterAction(): ViewModel { $vm = new ViewModel(); Loading @@ -48,14 +54,13 @@ class TheseCotutelleController extends AbstractController $this->theseCotutelle = $this->theseCotutelleService->getRepository()->findOneByThese($this->these); $presencePeriodeDisponibleRule = new PresencePeriodeDisponibleRule(); $presencePeriodeDisponibleRule->setTheseCotutelle($this->theseCotutelle); $presencePeriodeDisponibleRule->execute(); $this->presencePeriodeDisponibleRule->setTheseCotutelle($this->theseCotutelle); $this->presencePeriodeDisponibleRule->execute(); $vm->setVariables([ 'these' => $this->these, 'theseCotutelle' => $this->theseCotutelle, 'presencePeriodeDisponibleRule' => $presencePeriodeDisponibleRule, 'presencePeriodeDisponibleRule' => $this->presencePeriodeDisponibleRule, ]); return $vm; Loading
module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleControllerFactory.php +5 −0 Changes for module/TheseCotutelle/src/TheseCotutelle/Controller/TheseCotutelleControllerFactory.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Structure\Service\Etablissement\EtablissementService; use These\Service\These\TheseService; use TheseCotutelle\Entity\Db\Service\TheseCotutelleService; use TheseCotutelle\Form\TheseCotutelleForm; use TheseCotutelle\Rule\PresencePeriodeDisponibleRule; class TheseCotutelleControllerFactory implements FactoryInterface { Loading @@ -31,6 +32,10 @@ class TheseCotutelleControllerFactory implements FactoryInterface $etablissementService = $container->get(EtablissementService::class); $controller->setEtablissementService($etablissementService); /** @var PresencePeriodeDisponibleRule $presencePeriodeDisponibleRule */ $presencePeriodeDisponibleRule = $container->get(PresencePeriodeDisponibleRule::class); $controller->setPresencePeriodeDisponibleRule($presencePeriodeDisponibleRule); return $controller; } } No newline at end of file