Commit 65a1986e authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

wip fin finale

parent 6ded8dee
Loading
Loading
Loading
Loading
+7 −0
Changes for doc/release-notes/v14/14.0.0/01_these_cotutelle.sql: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ create table these_cotutelle_fichier
        constraint these_cotutelle_fichier_fichier_fk
            references fichier,

    commentaire           text,

    histo_createur_id     bigint                                                       not null
        constraint these_cotutelle_fichier_hc_fk
            references utilisateur,
@@ -108,6 +110,7 @@ create table these_cotutelle_avenant

    modifie_date_fin_cotutelle  boolean   default false                                      not null,
    nouvelle_date_fin_cotutelle date,
    commentaire                 text,

    -- document correspondant à l'avenant
    -- (si le dépôt de plusieurs fichiers devient nécessaire pour un même avenant, cf. table commentée ci-dessous)
@@ -176,6 +179,8 @@ create table these_cotutelle_inscription
        constraint these_cotutelle_frais_inscr_fichier_fk
            references fichier,

    commentaire                         text,

    histo_createur_id                   bigint                                                       not null
        constraint these_cotutelle_frais_inscr_hc_fk
            references utilisateur,
@@ -207,6 +212,8 @@ create table these_cotutelle_presence
    date_debut                 date                                                         not null,
    date_fin                   date                                                         not null,

    commentaire                text,

    justif_presence_fichier_id bigint
        constraint these_cotutelle_presence_justif_presence_fichier_fk
            references fichier,
+1 −0
Changes for module/Fichier/src/Fichier/Form/ViewHelper/Fichier/form-fichier-remplacable.phtml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ $hash = uniqid();
            <strong><?= $form->get($fichierElementName)->getLabel() ?></strong>
            <?php
            echo $this->fichier($fichier)
                ->setIsTargetBlank(true)
                ->setUrlTelechargementFichier($canConsulterFichier ? $this->urlFichier($fichier)->telechargerFichier($fichier) : null)
                ->setShowHistoInfo();
            ?>
+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
@@ -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;

@@ -172,6 +174,7 @@ return [
        'factories' => [
            TheseCotutellePresenceAssertion::class => TheseCotutellePresenceAssertionFactory::class,
            TheseCotutellePresenceService::class => TheseCotutellePresenceServiceFactory::class,
            PresencePeriodeDisponibleRule::class => PresencePeriodeDisponibleRuleFactory::class,
        ],
    ],
];
 No newline at end of file
+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
@@ -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)) {
@@ -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."
        );
    }
+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
@@ -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
@@ -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