Commit 06a2df2c authored by Florian Joriot's avatar Florian Joriot
Browse files

Ajout d'un choix par statut pour Modifications de service dû pour laisser la...

Ajout d'un choix par statut pour Modifications de service dû pour laisser la possibilité à l'intervenant de modifier son service dû
parent 34497f72
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -10,8 +10,9 @@
* Les modèles de contrats de travail sont maintenant gérés comme n'importe quel autre état de sortie
* Reconduction de l'offre de formation pour les éléments de OSE porté par un élément synchroniser
* Possibilité de rentrer un taux de charge par statut d'intervenant
* Ajout d'un paramétre par statut pour la possibilité de télécharger le contrat par l'intervenant
* Migration technnique vers le frmework Bootstrap 5 et modernisation de l'identité visuelle
* Ajout d'un choix par statut pour contrat de travail et avenants pour laisser la possibilité à l'intervenant de télécharger sont contrat en pdf
* Ajout d'un choix par statut pour Modifications de service dû pour laisser la possibilité à l'intervenant de modifier son service dû
* Migration technnique vers le framework Bootstrap 5 et modernisation de l'identité visuelle

## Corrections de bugs

+12 −0
Original line number Diff line number Diff line
@@ -693,6 +693,18 @@ return [
            'position'    => 63,
            'commentaire' => NULL,
        ],
        'MODIF_SERVICE_DU_EDITION' => [
            'name'        => 'MODIF_SERVICE_DU_EDITION',
            'type'        => 'bool',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => '0',
            'precision'   => 1,
            'nullable'    => FALSE,
            'default'     => '0',
            'position'    => 63,
            'commentaire' => NULL,
        ],
        'MOTIF_NON_PAIEMENT'             => [
            'name'        => 'MOTIF_NON_PAIEMENT',
            'type'        => 'bool',
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@

        <field name="modificationServiceDu" type="boolean" column="MODIF_SERVICE_DU" nullable="false"/>
        <field name="modificationServiceDuVisualisation" type="boolean" column="MODIF_SERVICE_DU_VISUALISATION" nullable="false"/>
        <field name="modificationServiceDuEdition" type="boolean" column="MODIF_SERVICE_DU_EDITION" nullable="false"/>

        <field name="paiementVisualisation" type="boolean" column="PAIEMENT_VISUALISATION" nullable="false"/>
        <field name="motifNonPaiement" type="boolean" column="MOTIF_NON_PAIEMENT" nullable="false"/>
+21 −2
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ class Statut implements ParametreEntityInterface, RoleInterface, ResourceInterfa

    private bool        $contratDepot                       = true;

    private bool        $contratGeneration                  = true;
    private bool        $contratGeneration                  = false;

    private bool        $servicePrevu                       = true;

@@ -156,6 +156,8 @@ class Statut implements ParametreEntityInterface, RoleInterface, ResourceInterfa

    private bool        $modificationServiceDuVisualisation = true;

    private bool        $modificationServiceDuEdition       = false;

    private bool        $paiementVisualisation              = true;

    private bool        $motifNonPaiement                   = true;
@@ -1245,6 +1247,22 @@ class Statut implements ParametreEntityInterface, RoleInterface, ResourceInterfa



    public function getModificationServiceDuEdition(): bool
    {
        return $this->modificationServiceDuEdition;
    }



    public function setModificationServiceDuEdition(bool $modificationServiceDuEdition): Statut
    {
        $this->modificationServiceDuEdition = $modificationServiceDuEdition;

        return $this;
    }



    public function getPaiementVisualisation(): bool
    {
        return $this->paiementVisualisation;
@@ -1373,6 +1391,7 @@ class Statut implements ParametreEntityInterface, RoleInterface, ResourceInterfa
            Privileges::INTERVENANT_CALCUL_HETD                    => $this->formuleVisualisation,
            Privileges::MODIF_SERVICE_DU_ASSOCIATION               => $this->modificationServiceDu,
            Privileges::MODIF_SERVICE_DU_VISUALISATION             => $this->modificationServiceDu && $this->modificationServiceDuVisualisation,
            Privileges::MODIF_SERVICE_DU_EDITION                   => $this->modificationServiceDu && $this->modificationServiceDuEdition,
            Privileges::DOSSIER_VISUALISATION                      => $this->dossier && $this->dossierVisualisation,
            Privileges::DOSSIER_EDITION                            => $this->dossier && $this->dossierEdition,
            Privileges::DOSSIER_ADRESSE_VISUALISATION              => $this->dossier && $this->dossierVisualisation && $this->dossierAdresse,
+15 −6
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ class StatutSaisieForm extends AbstractForm
            'contratDepot',
            'contratGeneration',
            'modificationServiceDuVisualisation',
            'modificationServiceDuEdition',
        ];

        for ($i = 1; $i <= 5; $i++) {
@@ -373,14 +374,18 @@ class StatutSaisieForm extends AbstractForm
                        'desactive'     => 'Désactivé',
                        'active'        => 'Activé mais non visible par l\'intervenant',
                        'visualisation' => 'Activé et visible par l\'intervenant',
                        'edition'       => 'Activé et modifiable par l\'intervenant',
                    ],
                ],
                'hydrator' => [
                    'getter' => function (Statut $statut, string $name) {
                        $access  = $statut->getModificationServiceDu();
                        $visu    = $statut->getModificationServiceDuVisualisation();
                        $edition = $statut->getModificationServiceDuEdition();

                        if ($visu && $access) {
                        if ($edition && $visu && $access) {
                            return 'edition';
                        } elseif ($visu && $access) {
                            return 'visualisation';
                        } elseif ($access) {
                            return 'active';
@@ -391,16 +396,20 @@ class StatutSaisieForm extends AbstractForm
                    'setter' => function (Statut $statut, $value, string $name) {
                        $access  = false;
                        $visu    = false;
                        $edition = false;
                        switch ($value) {

                            case 'edition':
                                $edition = true;
                            case 'visualisation':
                                $visu = true;

                            case 'active':
                                $access = true;
                        }
                        $statut->setModificationServiceDu($access);
                        $statut->setModificationServiceDuVisualisation($visu);
                        $statut->setModificationServiceDuEdition($edition);

                    },
                ],
            ],