Commit 6424da9a authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

WIP tag referentiel

parent 6aab183f
Loading
Loading
Loading
Loading
+24 −0
Changes for data/ddl/table/SERVICE_REFERENTIEL.php: 24 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -177,6 +177,30 @@ return [
            'position'    => 4,
            'commentaire' => NULL,
        ],
        'MOTIF_NON_PAIEMENT_ID' => [
            'name'        => 'MOTIF_NON_PAIEMENT_ID',
            'type'        => 'int',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => '0',
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 14,
            'commentaire' => NULL,
        ],
        'TAG_ID'                => [
            'name'        => 'TAG_ID',
            'type'        => 'int',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => '0',
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 15,
            'commentaire' => NULL,
        ],
    ],
];

+0 −13
Changes for module/Referentiel/src/Assertion/ReferentielAssertion.php: 0 added lines, 13 removed lines.
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertPage(array $page)
    {
        $role = $this->getRole();
@@ -95,7 +94,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    /**
     * @param ResourceInterface $entity
     * @param string $privilege
@@ -163,7 +161,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    /**
     * @param string $controller
     * @param string $action
@@ -199,7 +196,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertPageReferentiel(Role $role, Intervenant $intervenant = null, string $typeVolumeHoraireCode)
    {
        if (!$intervenant) return true;
@@ -223,7 +219,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertServiceReferentielVisualisation(Role $role, ServiceReferentiel $serviceReferentiel)
    {
        $typeVolumeHoraire = $serviceReferentiel->getTypeVolumeHoraire();
@@ -245,7 +240,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertServiceReferentielEdition(Role $role, ServiceReferentiel $serviceReferentiel)
    {
        $asserts = [];
@@ -276,7 +270,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertHasReferentiel(Intervenant $intervenant, Structure $structure, string $etape, Role $role)
    {
        $services = $intervenant->getServiceReferentiel();
@@ -322,7 +315,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertVolumeHoraireReferentielValidation(Role $role, VolumeHoraireReferentiel $volumeHoraireReferentiel)
    {
        $serviceReferentiel = $volumeHoraireReferentiel->getServiceReferentiel();
@@ -331,14 +323,12 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertServiceReferentielValidation(Role $role, ServiceReferentiel $serviceReferentiel)
    {
        return $this->assert($role, $serviceReferentiel->getIntervenant(), $serviceReferentiel->getStructure());
    }



    protected function assertValidationValidation(Role $role, Validation $validation)
    {
        return $this->asserts([
@@ -348,7 +338,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertValidation(Role $role, Intervenant $intervenant, ?Structure $structure)
    {
        return $this->asserts([
@@ -358,7 +347,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertValidationDevalidation(Role $role, Validation $validation)
    {
        return $this->asserts([
@@ -369,7 +357,6 @@ class ReferentielAssertion extends AbstractAssertion
    }



    protected function assertIntervenantReferentiel(
        Role        $role,
        Intervenant $intervenant,
+1 −14
Changes for module/Referentiel/src/Controller/ServiceReferentielController.php: 1 added line, 14 removed lines.
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function prevuAction()
    {
        $prevu = $this->getServiceTypeVolumeHoraire()->getPrevu();
@@ -61,7 +60,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function realiseAction()
    {
        $realise = $this->getServiceTypeVolumeHoraire()->getRealise();
@@ -70,7 +68,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function indexAction(?TypeVolumeHoraire $typeVolumeHoraire = null)
    {
        $this->initFilters();
@@ -92,7 +89,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function saisieAction()
    {
        $this->initFilters();
@@ -100,6 +96,7 @@ class ServiceReferentielController extends AbstractController
            \Application\Entity\Db\Structure::class,
        ]);
        $id = (int)$this->params()->fromRoute('id');

        $typeVolumeHoraire = $this->params()->fromQuery('type-volume-horaire', $this->params()->fromPost('type-volume-horaire'));
        if (empty($typeVolumeHoraire)) {
            $typeVolumeHoraire = $this->getServiceTypeVolumehoraire()->getPrevu();
@@ -169,7 +166,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function rafraichirLigneAction()
    {
        $this->initFilters();
@@ -193,7 +189,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function initialisationAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -207,7 +202,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function constatationAction()
    {
        $this->initFilters();
@@ -232,7 +226,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function suppressionAction()
    {
        $typeVolumeHoraire = $this->params()->fromQuery('type-volume-horaire', $this->params()->fromPost('type-volume-horaire'));
@@ -268,7 +261,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function validationPrevuAction()
    {
        $typeVolumeHoraire = $this->getServiceTypeVolumeHoraire()->getPrevu();
@@ -277,7 +269,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function validationRealiseAction()
    {
        $typeVolumeHoraire = $this->getServiceTypeVolumeHoraire()->getRealise();
@@ -286,7 +277,6 @@ class ServiceReferentielController extends AbstractController
    }



    private function validationAction(TypeVolumeHoraire $typeVolumeHoraire)
    {
        $this->initFilters();
@@ -347,7 +337,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -384,7 +373,6 @@ class ServiceReferentielController extends AbstractController
    }



    public function devaliderAction()
    {
        $this->initFilters();
@@ -412,7 +400,6 @@ class ServiceReferentielController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant, $validation = false)
    {
        $this->getServiceWorkflow()->calculerTableauxBord(['formule', 'validation_referentiel', 'referentiel'], $intervenant);
+7 −2
Changes for module/Referentiel/src/Entity/Db/Mapping/Referentiel.Entity.Db.ServiceReferentiel.dcm.xml: 7 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -12,12 +12,16 @@
        <field name="histoModification" type="datetime" column="HISTO_MODIFICATION" nullable="false"/>
        <field name="commentaires" type="string" column="COMMENTAIRES" length="256" nullable="true"/>
        <field name="formation" type="string" column="FORMATION" length="256" nullable="true"/>
        <many-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant" inversed-by="serviceReferentiel">
        <many-to-one field="intervenant" target-entity="Application\Entity\Db\Intervenant"
                     inversed-by="serviceReferentiel">
            <join-column name="INTERVENANT_ID" referenced-column-name="ID"/>
        </many-to-one>
        <many-to-one field="structure" target-entity="Application\Entity\Db\Structure">
            <join-column name="STRUCTURE_ID" referenced-column-name="ID"/>
        </many-to-one>
        <many-to-one field="tag" target-entity="Application\Entity\Db\Tag">
            <join-column name="TAG_ID" referenced-column-name="ID"/>
        </many-to-one>
        <many-to-one field="fonctionReferentiel" target-entity="Referentiel\Entity\Db\FonctionReferentiel">
            <join-column name="FONCTION_ID" referenced-column-name="ID"/>
        </many-to-one>
@@ -37,7 +41,8 @@
            </cascade>
        </one-to-many>
        <one-to-many field="formuleResultatServiceReferentiel"
                     target-entity="Application\Entity\Db\FormuleResultatServiceReferentiel" mapped-by="serviceReferentiel"/>
                     target-entity="Application\Entity\Db\FormuleResultatServiceReferentiel"
                     mapped-by="serviceReferentiel"/>

        <many-to-one field="source" target-entity="UnicaenImport\Entity\Db\Source">
            <join-column name="SOURCE_ID" referenced-column-name="ID"/>
+2 −15
Changes for module/Referentiel/src/Entity/Db/ServiceReferentiel.php: 2 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Referentiel\Entity\Db;
use Application\Entity\Db\FormuleResultatServiceReferentiel;
use Application\Entity\Db\Traits\IntervenantAwareTrait;
use Application\Entity\Db\Traits\StructureAwareTrait;
use Application\Entity\Db\Traits\TagAwareTrait;
use Service\Entity\Db\EtatVolumeHoraire;
use Service\Entity\Db\TypeVolumeHoraire;
use Service\Entity\Db\TypeVolumeHoraireAwareTrait;
@@ -29,6 +30,7 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    use StructureAwareTrait;
    use TypeVolumeHoraireAwareTrait;
    use ImportAwareTrait;
    use TagAwareTrait;

    protected ?int $id = null;

@@ -41,21 +43,18 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    private Collection $formuleResultatServiceReferentiel;



    public function getId(): ?int
    {
        return $this->id;
    }



    public function getCommentaires(): ?string
    {
        return $this->commentaires;
    }



    public function setCommentaires(?string $commentaires): ServiceReferentiel
    {
        $this->commentaires = $commentaires;
@@ -64,14 +63,12 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function getFormation(): ?string
    {
        return $this->formation;
    }



    public function setFormation(?string $formation): ServiceReferentiel
    {
        $this->formation = $formation;
@@ -80,7 +77,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function __toString(): string
    {
        $heures = Util::formattedFloat($this->getHeures(), \NumberFormatter::DECIMAL, -1);
@@ -92,7 +88,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function __construct()
    {
        $this->volumeHoraireReferentiel = new ArrayCollection();
@@ -100,7 +95,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function addVolumeHoraireReferentiel(VolumeHoraireReferentiel $volumeHoraireReferentiel): ServiceReferentiel
    {
        $this->volumeHoraireReferentiel[] = $volumeHoraireReferentiel;
@@ -109,7 +103,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function removeVolumeHoraireReferentiel(VolumeHoraireReferentiel $volumeHoraireReferentiel): ServiceReferentiel
    {
        $this->volumeHoraireReferentiel->removeElement($volumeHoraireReferentiel);
@@ -118,7 +111,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    /**
     * Get volumeHoraireReferentiel
     *
@@ -130,7 +122,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    /**
     * Détermine si le VHR a une validation ou non
     *
@@ -150,7 +141,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function getVolumeHoraireReferentielListe(): VolumeHoraireReferentielListe
    {
        $volumeHoraireListe = new VolumeHoraireReferentielListe($this);
@@ -163,7 +153,6 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function getFormuleResultatServiceReferentiel(TypeVolumeHoraire $typeVolumeHoraire = null, EtatVolumeHoraire $etatVolumeHoraire = null): Collection
    {
        $filter = function (FormuleResultatServiceReferentiel $formuleResultatServiceReferentiel) use ($typeVolumeHoraire, $etatVolumeHoraire) {
@@ -181,14 +170,12 @@ class ServiceReferentiel implements HistoriqueAwareInterface, ResourceInterface,
    }



    public function getUniqueFormuleResultatServiceReferentiel(TypeVolumeHoraire $typeVolumeHoraire, EtatVolumeHoraire $etatVolumeHoraire): FormuleResultatServiceReferentiel
    {
        return $this->getFormuleResultatServiceReferentiel($typeVolumeHoraire, $etatVolumeHoraire)->first();
    }



    public function getResourceId(): string
    {
        return 'ServiceReferentiel';
Loading