From dd28000512d389c2ace274ceaf83d433b2239edc Mon Sep 17 00:00:00 2001 From: lecluse <lecluse@d57fa8bc-6af1-4de9-8b7d-78e900e231e7> Date: Thu, 29 Oct 2015 14:30:33 +0000 Subject: [PATCH] =?UTF-8?q?Gros=20refactoring=20(plus=20d'intervenants=20p?= =?UTF-8?q?ermanents=20et=20d'intervenants=20ext=C3=A9rieurs)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mise en place des disciplines et des grades. Seules restent les disciplines des éléments pédagogiques à mettre en place --- "data/Sql/Param\303\250tres.sql" | 56 +++++++- .../Controller/DisciplineController.php | 12 +- .../Controller/DossierController.php | 1 - .../Controller/OffreFormationController.php | 2 - .../Controller/ServiceController.php | 52 ++++--- .../ServiceReferentielController.php | 4 +- .../Entity/Db/AdresseIntervenant.php | 33 ----- .../Entity/Db/AdresseIntervenantPrinc.php | 23 ---- .../src/Application/Entity/Db/Discipline.php | 118 +++++++++++++++- .../AdresseIntervenantPrincAwareInterface.php | 26 ---- .../IntervenantExterieurAwareInterface.php | 26 ---- .../IntervenantPermanentAwareInterface.php | 26 ---- .../src/Application/Entity/Db/Intervenant.php | 24 +--- .../Entity/Db/IntervenantExterieur.php | 48 ------- .../Entity/Db/IntervenantPermanent.php | 11 -- ...ation.Entity.Db.AdresseIntervenant.dcm.xml | 1 - ....Entity.Db.AdresseIntervenantPrinc.dcm.xml | 6 - .../Application.Entity.Db.Discipline.dcm.xml | 4 + .../Application.Entity.Db.Intervenant.dcm.xml | 51 +++---- ...ion.Entity.Db.IntervenantExterieur.dcm.xml | 18 --- ...ion.Entity.Db.IntervenantPermanent.dcm.xml | 12 -- ...ation.Entity.Db.SituationFamiliale.dcm.xml | 36 ----- .../Entity/Db/SituationFamiliale.php | 110 --------------- .../AdresseIntervenantPrincAwareTrait.php | 42 ------ .../Traits/IntervenantExterieurAwareTrait.php | 42 ------ .../Traits/IntervenantPermanentAwareTrait.php | 42 ------ .../src/Application/Form/DisciplineForm.php | 44 +++++- .../src/Application/Service/Etape.php | 129 +----------------- .../src/Application/Service/Parametres.php | 3 - .../Application/Service/ServiceService.php | 10 +- .../Application/Service/TypeIntervenant.php | 4 +- .../Intervenant/IntervenantViewHelper.php | 5 - .../view/application/discipline/index.phtml | 16 +++ .../view/application/discipline/saisir.phtml | 3 + .../view/application/service/index.phtml | 4 +- module/Import/src/Import/Processus/Import.php | 20 +-- 36 files changed, 316 insertions(+), 748 deletions(-) delete mode 100644 module/Application/src/Application/Entity/Db/AdresseIntervenantPrinc.php delete mode 100755 module/Application/src/Application/Entity/Db/Interfaces/AdresseIntervenantPrincAwareInterface.php delete mode 100755 module/Application/src/Application/Entity/Db/Interfaces/IntervenantExterieurAwareInterface.php delete mode 100755 module/Application/src/Application/Entity/Db/Interfaces/IntervenantPermanentAwareInterface.php delete mode 100644 module/Application/src/Application/Entity/Db/IntervenantExterieur.php delete mode 100644 module/Application/src/Application/Entity/Db/IntervenantPermanent.php delete mode 100644 module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenantPrinc.dcm.xml delete mode 100644 module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantExterieur.dcm.xml delete mode 100644 module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantPermanent.dcm.xml delete mode 100644 module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.SituationFamiliale.dcm.xml delete mode 100644 module/Application/src/Application/Entity/Db/SituationFamiliale.php delete mode 100755 module/Application/src/Application/Entity/Db/Traits/AdresseIntervenantPrincAwareTrait.php delete mode 100755 module/Application/src/Application/Entity/Db/Traits/IntervenantExterieurAwareTrait.php delete mode 100755 module/Application/src/Application/Entity/Db/Traits/IntervenantPermanentAwareTrait.php diff --git "a/data/Sql/Param\303\250tres.sql" "b/data/Sql/Param\303\250tres.sql" index 56107f8455..1c5f9fe8f9 100755 --- "a/data/Sql/Param\303\250tres.sql" +++ "b/data/Sql/Param\303\250tres.sql" @@ -1,4 +1,4 @@ -select * from parametre; +--select * from parametre; INSERT INTO PARAMETRE ( @@ -9,10 +9,58 @@ INSERT INTO PARAMETRE ( HISTO_CREATEUR_ID, HISTO_MODIFICATEUR_ID )VALUES( - 'domaine_fonctionnel_ens_ext', - (select id from domaine_fonctionnel where source_code = '102'), - 'ID du domaine fonctionnel à privilégier pour les enseignements pris à l''extérieur', + 'discipline_codes_corresp_1_libelle', + 'Section(s) CNU Apogée', + 'Libellé de la liste 1 des correspondances de codes des disciplines', PARAMETRE_ID_SEQ.NEXTVAL, (select id from utilisateur where username = 'lecluse'), (select id from utilisateur where username = 'lecluse') ); + +INSERT INTO PARAMETRE ( + NOM, + VALEUR, + DESCRIPTION, + ID, + HISTO_CREATEUR_ID, + HISTO_MODIFICATEUR_ID +)VALUES( + 'discipline_codes_corresp_2_libelle', + 'Section(s) CNU Harpège', + 'Libellé de la liste 2 des correspondances de codes des disciplines', + PARAMETRE_ID_SEQ.NEXTVAL, + (select id from utilisateur where username = 'lecluse'), + (select id from utilisateur where username = 'lecluse') +); + +INSERT INTO PARAMETRE ( + NOM, + VALEUR, + DESCRIPTION, + ID, + HISTO_CREATEUR_ID, + HISTO_MODIFICATEUR_ID +)VALUES( + 'discipline_codes_corresp_3_libelle', + 'Discipline Harpège', + 'Libellé de la liste 3 des correspondances de codes des disciplines', + PARAMETRE_ID_SEQ.NEXTVAL, + (select id from utilisateur where username = 'lecluse'), + (select id from utilisateur where username = 'lecluse') +); + +INSERT INTO PARAMETRE ( + NOM, + VALEUR, + DESCRIPTION, + ID, + HISTO_CREATEUR_ID, + HISTO_MODIFICATEUR_ID +)VALUES( + 'discipline_codes_corresp_4_libelle', + '', + 'Libellé de la liste 4 des correspondances de codes des disciplines', + PARAMETRE_ID_SEQ.NEXTVAL, + (select id from utilisateur where username = 'lecluse'), + (select id from utilisateur where username = 'lecluse') +); \ No newline at end of file diff --git a/module/Application/src/Application/Controller/DisciplineController.php b/module/Application/src/Application/Controller/DisciplineController.php index 484d79c8a0..d748473608 100644 --- a/module/Application/src/Application/Controller/DisciplineController.php +++ b/module/Application/src/Application/Controller/DisciplineController.php @@ -5,6 +5,7 @@ namespace Application\Controller; use Application\Entity\Db\Discipline; use Application\Form\Traits\DisciplineFormAwareTrait; use Application\Service\Traits\DisciplineServiceAwareTrait; +use Application\Service\Traits\ParametresAwareTrait; use Application\Service\Traits\SourceAwareTrait; use Zend\Mvc\Controller\AbstractActionController; use Doctrine\ORM\EntityManager; @@ -22,6 +23,7 @@ class DisciplineController extends AbstractActionController use DisciplineServiceAwareTrait; use SourceAwareTrait; use DisciplineFormAwareTrait; + use ParametresAwareTrait; @@ -35,7 +37,15 @@ class DisciplineController extends AbstractActionController $disciplines = $this->getServiceDiscipline()->getList($qb); - return compact('disciplines'); + $libellesCodesCorresp = []; + for( $i=1;$i<=4;$i++){ + $lcc = $this->getServiceParametres()->get('discipline_codes_corresp_'.$i.'_libelle'); + if ($lcc){ + $libellesCodesCorresp[$i] = $lcc; + } + } + + return compact('disciplines','libellesCodesCorresp'); } diff --git a/module/Application/src/Application/Controller/DossierController.php b/module/Application/src/Application/Controller/DossierController.php index 97a7fff5fa..7e20d22027 100644 --- a/module/Application/src/Application/Controller/DossierController.php +++ b/module/Application/src/Application/Controller/DossierController.php @@ -5,7 +5,6 @@ namespace Application\Controller; use Application\Acl\IntervenantRole; use Application\Controller\Plugin\Context; use Application\Entity\Db\Intervenant; -use Application\Entity\Db\Intervenant; use Application\Entity\Db\StatutIntervenant; use Application\Entity\Db\Listener\DossierListener; use Application\Entity\Db\TypeValidation; diff --git a/module/Application/src/Application/Controller/OffreFormationController.php b/module/Application/src/Application/Controller/OffreFormationController.php index 1f95c8a495..98dc523409 100644 --- a/module/Application/src/Application/Controller/OffreFormationController.php +++ b/module/Application/src/Application/Controller/OffreFormationController.php @@ -44,12 +44,10 @@ class OffreFormationController extends AbstractActionController 'Application\Entity\Db\ElementPedagogique', 'Application\Entity\Db\TypeFormation', 'Application\Entity\Db\GroupeTypeFormation', - //'Application\Entity\Db\Structure', 'Application\Entity\Db\TypeModulateur', ]); $this->em()->getFilters()->enable('annee')->init([ 'Application\Entity\Db\ElementPedagogique', - 'Application\Entity\Db\Etape', ]); } diff --git a/module/Application/src/Application/Controller/ServiceController.php b/module/Application/src/Application/Controller/ServiceController.php index 3bc1a5314a..89c5181872 100644 --- a/module/Application/src/Application/Controller/ServiceController.php +++ b/module/Application/src/Application/Controller/ServiceController.php @@ -2,16 +2,29 @@ namespace Application\Controller; -use Debug\Util; +use Application\Entity\Db\Service; +use Application\Entity\Db\VolumeHoraire; +use Application\Entity\Db\ElementPedagogique; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; -use Common\Exception\RuntimeException; -use Common\Exception\LogicException; use Common\Exception\MessageException; use Application\Exception\DbException; use Application\Entity\Db\Intervenant; use Application\Entity\Db\TypeVolumeHoraire; use Application\Entity\Service\Recherche; +use Application\Service\Traits\ContextAwareTrait; +use Application\Service\Traits\ServiceAwareTrait; +use Application\Service\Traits\VolumeHoraireAwareTrait; +use Application\Service\Traits\ElementPedagogiqueAwareTrait; +use Application\Service\Traits\TypeVolumeHoraireAwareTrait; +use Application\Service\Traits\TypeInterventionAwareTrait; +use Application\Service\Traits\IntervenantAwareTrait; +use Application\Service\Traits\ServiceReferentielAwareTrait; +use Application\Service\Traits\EtatVolumeHoraireAwareTrait; +use Application\Service\Traits\ValidationAwareTrait; +use Application\Service\Traits\StructureAwareTrait; +use Application\Service\Traits\EtapeAwareTrait; +use Application\Service\Traits\PeriodeAwareTrait; /** * Description of ServiceController @@ -22,19 +35,19 @@ use Application\Entity\Service\Recherche; */ class ServiceController extends AbstractActionController { - use \Application\Service\Traits\ContextAwareTrait, - \Application\Service\Traits\ServiceAwareTrait, - \Application\Service\Traits\VolumeHoraireAwareTrait, - \Application\Service\Traits\ElementPedagogiqueAwareTrait, - \Application\Service\Traits\TypeVolumeHoraireAwareTrait, - \Application\Service\Traits\TypeInterventionAwareTrait, - \Application\Service\Traits\IntervenantAwareTrait, - \Application\Service\Traits\ServiceReferentielAwareTrait, - \Application\Service\Traits\EtatVolumeHoraireAwareTrait, - \Application\Service\Traits\ValidationAwareTrait, - \Application\Service\Traits\StructureAwareTrait, - \Application\Service\Traits\EtapeAwareTrait, - \Application\Service\Traits\PeriodeAwareTrait; + use ContextAwareTrait; + use ServiceAwareTrait; + use VolumeHoraireAwareTrait; + use ElementPedagogiqueAwareTrait; + use TypeVolumeHoraireAwareTrait; + use TypeInterventionAwareTrait; + use IntervenantAwareTrait; + use ServiceReferentielAwareTrait; + use EtatVolumeHoraireAwareTrait; + use ValidationAwareTrait; + use StructureAwareTrait; + use EtapeAwareTrait; + use PeriodeAwareTrait; @@ -46,8 +59,11 @@ class ServiceController extends AbstractActionController protected function initFilters() { $this->em()->getFilters()->enable('historique')->init([ - 'Application\Entity\Db\Service', - 'Application\Entity\Db\VolumeHoraire', + Service::class, + VolumeHoraire::class, + ]); + $this->em()->getFilters()->enable('annee')->init([ + ElementPedagogique::class ]); } diff --git a/module/Application/src/Application/Controller/ServiceReferentielController.php b/module/Application/src/Application/Controller/ServiceReferentielController.php index 23f6121607..72953d22dc 100644 --- a/module/Application/src/Application/Controller/ServiceReferentielController.php +++ b/module/Application/src/Application/Controller/ServiceReferentielController.php @@ -94,7 +94,7 @@ class ServiceReferentielController extends AbstractActionController $intervenant = $this->context()->intervenantFromRoute(); $viewModel = new \Zend\View\Model\ViewModel(); - if ($intervenant->estPermanent()) { + if ($intervenant && $intervenant->estPermanent()) { $serviceRefProto = $this->getServiceServiceReferentiel()->newEntity() ->setIntervenant($intervenant) ->setTypeVolumeHoraire($this->getTypeVolumeHoraire()); @@ -136,7 +136,7 @@ class ServiceReferentielController extends AbstractActionController $services = []; } - $renderReferentiel = $intervenant->estPermanent(); + $renderReferentiel = $intervenant && $intervenant->estPermanent(); $typeVolumeHoraire = $recherche->getTypeVolumeHoraire(); $params = $viewHelperParams; diff --git a/module/Application/src/Application/Entity/Db/AdresseIntervenant.php b/module/Application/src/Application/Entity/Db/AdresseIntervenant.php index 49677e9c01..95ff1e0400 100644 --- a/module/Application/src/Application/Entity/Db/AdresseIntervenant.php +++ b/module/Application/src/Application/Entity/Db/AdresseIntervenant.php @@ -51,11 +51,6 @@ class AdresseIntervenant implements HistoriqueAwareInterface */ protected $paysLibelle; - /** - * @var boolean - */ - protected $principale; - /** * @var string */ @@ -312,34 +307,6 @@ class AdresseIntervenant implements HistoriqueAwareInterface - /** - * Set principale - * - * @param boolean $principale - * - * @return AdresseIntervenant - */ - public function setPrincipale($principale) - { - $this->principale = $principale; - - return $this; - } - - - - /** - * Get principale - * - * @return boolean - */ - public function getPrincipale() - { - return $this->principale; - } - - - /** * Set sourceCode * diff --git a/module/Application/src/Application/Entity/Db/AdresseIntervenantPrinc.php b/module/Application/src/Application/Entity/Db/AdresseIntervenantPrinc.php deleted file mode 100644 index fb9a3a59cd..0000000000 --- a/module/Application/src/Application/Entity/Db/AdresseIntervenantPrinc.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Application\Entity\Db; - -/** - * AdresseIntervenant - */ -class AdresseIntervenantPrinc extends AdresseIntervenant -{ - /** - * @var string - */ - protected $toString; - - /** - * - * @return string - */ - public function getToString() - { - return $this->toString; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Discipline.php b/module/Application/src/Application/Entity/Db/Discipline.php index 58c0835847..216e298a1f 100644 --- a/module/Application/src/Application/Entity/Db/Discipline.php +++ b/module/Application/src/Application/Entity/Db/Discipline.php @@ -28,6 +28,26 @@ class Discipline implements HistoriqueAwareInterface */ protected $sourceCode; + /** + * @var string + */ + protected $codesCorresp1; + + /** + * @var string + */ + protected $codesCorresp2; + + /** + * @var string + */ + protected $codesCorresp3; + + /** + * @var string + */ + protected $codesCorresp4; + /** * @var integer */ @@ -124,6 +144,102 @@ class Discipline implements HistoriqueAwareInterface + /** + * @return string + */ + public function getCodesCorresp1() + { + return $this->codesCorresp1; + } + + + + /** + * @param string $codesCorresp1 + * + * @return Discipline + */ + public function setCodesCorresp1($codesCorresp1) + { + $this->codesCorresp1 = $codesCorresp1; + + return $this; + } + + + + /** + * @return string + */ + public function getCodesCorresp2() + { + return $this->codesCorresp2; + } + + + + /** + * @param string $codesCorresp2 + * + * @return Discipline + */ + public function setCodesCorresp2($codesCorresp2) + { + $this->codesCorresp2 = $codesCorresp2; + + return $this; + } + + + + /** + * @return string + */ + public function getCodesCorresp3() + { + return $this->codesCorresp3; + } + + + + /** + * @param string $codesCorresp3 + * + * @return Discipline + */ + public function setCodesCorresp3($codesCorresp3) + { + $this->codesCorresp3 = $codesCorresp3; + + return $this; + } + + + + /** + * @return string + */ + public function getCodesCorresp4() + { + return $this->codesCorresp4; + } + + + + /** + * @param string $codesCorresp4 + * + * @return Discipline + */ + public function setCodesCorresp4($codesCorresp4) + { + $this->codesCorresp4 = $codesCorresp4; + + return $this; + } + + + /** * Get id * @@ -166,7 +282,7 @@ class Discipline implements HistoriqueAwareInterface public function __toString() { - return $this->getLibelleCourt(); + return $this->getLibelleLong(); } } diff --git a/module/Application/src/Application/Entity/Db/Interfaces/AdresseIntervenantPrincAwareInterface.php b/module/Application/src/Application/Entity/Db/Interfaces/AdresseIntervenantPrincAwareInterface.php deleted file mode 100755 index 8bbdfb4a57..0000000000 --- a/module/Application/src/Application/Entity/Db/Interfaces/AdresseIntervenantPrincAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Application\Entity\Db\Interfaces; - -use Application\Entity\Db\AdresseIntervenantPrinc; - -/** - * Description of AdresseIntervenantPrincAwareInterface - * - * @author UnicaenCode - */ -interface AdresseIntervenantPrincAwareInterface -{ - /** - * @param AdresseIntervenantPrinc $adresseIntervenantPrinc - * @return self - */ - public function setAdresseIntervenantPrinc( AdresseIntervenantPrinc $adresseIntervenantPrinc = null ); - - - - /** - * @return AdresseIntervenantPrinc - */ - public function getAdresseIntervenantPrinc(); -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Interfaces/IntervenantExterieurAwareInterface.php b/module/Application/src/Application/Entity/Db/Interfaces/IntervenantExterieurAwareInterface.php deleted file mode 100755 index c8446d656f..0000000000 --- a/module/Application/src/Application/Entity/Db/Interfaces/IntervenantExterieurAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Application\Entity\Db\Interfaces; - -use Application\Entity\Db\IntervenantExterieur; - -/** - * Description of IntervenantExterieurAwareInterface - * - * @author UnicaenCode - */ -interface IntervenantExterieurAwareInterface -{ - /** - * @param IntervenantExterieur $intervenantExterieur - * @return self - */ - public function setIntervenantExterieur( IntervenantExterieur $intervenantExterieur = null ); - - - - /** - * @return IntervenantExterieur - */ - public function getIntervenantExterieur(); -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Interfaces/IntervenantPermanentAwareInterface.php b/module/Application/src/Application/Entity/Db/Interfaces/IntervenantPermanentAwareInterface.php deleted file mode 100755 index 98050b2d36..0000000000 --- a/module/Application/src/Application/Entity/Db/Interfaces/IntervenantPermanentAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Application\Entity\Db\Interfaces; - -use Application\Entity\Db\IntervenantPermanent; - -/** - * Description of IntervenantPermanentAwareInterface - * - * @author UnicaenCode - */ -interface IntervenantPermanentAwareInterface -{ - /** - * @param IntervenantPermanent $intervenantPermanent - * @return self - */ - public function setIntervenantPermanent( IntervenantPermanent $intervenantPermanent = null ); - - - - /** - * @return IntervenantPermanent - */ - public function getIntervenantPermanent(); -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Intervenant.php b/module/Application/src/Application/Entity/Db/Intervenant.php index 2b81faabee..35dfb72039 100644 --- a/module/Application/src/Application/Entity/Db/Intervenant.php +++ b/module/Application/src/Application/Entity/Db/Intervenant.php @@ -19,7 +19,7 @@ use Application\Entity\Db\Interfaces\AnneeAwareInterface; * @Annotation\Type("Application\Form\Intervenant\AjouterModifier") * @Annotation\Hydrator("Application\Entity\Db\Hydrator\Intervenant") */ -abstract class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, ResourceInterface, AnneeAwareInterface +class Intervenant implements IntervenantInterface, HistoriqueAwareInterface, ResourceInterface, AnneeAwareInterface { use HistoriqueAwareTrait; use GradeAwareTrait; @@ -994,18 +994,6 @@ abstract class Intervenant implements IntervenantInterface, HistoriqueAwareInter - /** - * Get adresse princ - * - * @return \Application\Entity\Db\AdresseIntervenant - */ - public function getAdressePrinc() - { - return $this->adressePrinc; - } - - - /** * Set source * @@ -1579,7 +1567,7 @@ abstract class Intervenant implements IntervenantInterface, HistoriqueAwareInter /** - * Retourne l'adresse principale éventuelle. + * Retourne l'adresse principale. * * NB: si aucune adresse principale n'est trouvée, la 1ère adresse non principale trouvée est retournée. * @@ -1592,14 +1580,6 @@ abstract class Intervenant implements IntervenantInterface, HistoriqueAwareInter if (!count($adresses)) { return null; } - - foreach ($adresses as $a) { - /* @var $a AdresseIntervenant */ - if ($a->getPrincipale()) { - return $a; - } - } - $adresse = $adresses->first(); return $adresse ?: null; diff --git a/module/Application/src/Application/Entity/Db/IntervenantExterieur.php b/module/Application/src/Application/Entity/Db/IntervenantExterieur.php deleted file mode 100644 index e552856506..0000000000 --- a/module/Application/src/Application/Entity/Db/IntervenantExterieur.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -namespace Application\Entity\Db; - - -/** - * IntervenantExterieur - */ -class IntervenantExterieur extends Intervenant -{ - - /** - * @var \Application\Entity\Db\SituationFamiliale - */ - protected $situationFamiliale; - - - - /** - * Set situationFamiliale - * - * @param \Application\Entity\Db\SituationFamiliale $situationFamiliale - * - * @return IntervenantExterieur - */ - public function setSituationFamiliale(\Application\Entity\Db\SituationFamiliale $situationFamiliale = null) - { - $this->situationFamiliale = $situationFamiliale; - - return $this; - } - - - - /** - * Get situationFamiliale - * - * @return \Application\Entity\Db\SituationFamiliale - */ - public function getSituationFamiliale() - { - return $this->situationFamiliale; - } - - - - -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/IntervenantPermanent.php b/module/Application/src/Application/Entity/Db/IntervenantPermanent.php deleted file mode 100644 index e3a4dda732..0000000000 --- a/module/Application/src/Application/Entity/Db/IntervenantPermanent.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace Application\Entity\Db; - -/** - * IntervenantPermanent - */ -class IntervenantPermanent extends Intervenant -{ - -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenant.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenant.dcm.xml index 9bbfe9dce0..148488f230 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenant.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenant.dcm.xml @@ -25,7 +25,6 @@ <field name="noVoie" type="string" column="NO_VOIE" length="10" nullable="true"/> <field name="paysCodeInsee" type="string" column="PAYS_CODE_INSEE" length="3" nullable="false"/> <field name="paysLibelle" type="string" column="PAYS_LIBELLE" length="50" nullable="false"/> - <field name="principale" type="boolean" column="PRINCIPALE" nullable="false"/> <field name="sourceCode" type="string" column="SOURCE_CODE" length="100" nullable="true"/> <field name="telDomicile" type="string" column="TEL_DOMICILE" length="25" nullable="true"/> <field name="ville" type="string" column="VILLE" length="60" nullable="true"/> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenantPrinc.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenantPrinc.dcm.xml deleted file mode 100644 index 37c623c4c2..0000000000 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.AdresseIntervenantPrinc.dcm.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Application\Entity\Db\AdresseIntervenantPrinc" table="ADRESSE_INTERVENANT_PRINC"> - <field name="toString" type="text" column="TO_STRING" nullable="true"/> - </entity> -</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Discipline.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Discipline.dcm.xml index 6e668ec516..ff67a97652 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Discipline.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Discipline.dcm.xml @@ -19,6 +19,10 @@ <field name="libelleCourt" type="string" column="LIBELLE_COURT" length="20" nullable="true"/> <field name="libelleLong" type="string" column="LIBELLE_LONG" length="200" nullable="false"/> <field name="sourceCode" type="string" column="SOURCE_CODE" length="100" nullable="false"/> + <field name="codesCorresp1" type="string" column="CODES_CORRESP_1" length="255" nullable="true"/> + <field name="codesCorresp2" type="string" column="CODES_CORRESP_2" length="255" nullable="true"/> + <field name="codesCorresp3" type="string" column="CODES_CORRESP_3" length="255" nullable="true"/> + <field name="codesCorresp4" type="string" column="CODES_CORRESP_4" length="255" nullable="true"/> <many-to-one field="source" target-entity="Application\Entity\Db\Source"> <join-columns> <join-column name="SOURCE_ID" referenced-column-name="ID"/> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml index cf3ed2c8f5..3f6ba42d60 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Intervenant.dcm.xml @@ -2,14 +2,7 @@ <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <!-- NB: héritage ajouté à la main sur l'entité --> - <entity name="Application\Entity\Db\Intervenant" table="INTERVENANT" inheritance-type="JOINED" - repository-class="Application\Entity\Db\Repository\IntervenantRepository"> - <discriminator-column name="TYPE_ID" type="integer"/> - <discriminator-map> - <discriminator-mapping value="1" class="Application\Entity\Db\IntervenantPermanent"/> - <discriminator-mapping value="2" class="Application\Entity\Db\IntervenantExterieur"/> - </discriminator-map> + <entity name="Application\Entity\Db\Intervenant" table="INTERVENANT" repository-class="Application\Entity\Db\Repository\IntervenantRepository"> <indexes> <index name="IDX_FED386B4C2443469" columns="TYPE_ID"/> <index name="IDX_FED386B48C579EB7" columns="CIVILITE_ID"/> @@ -41,8 +34,7 @@ <field name="numeroInseeProvisoire" type="boolean" column="NUMERO_INSEE_PROVISOIRE" nullable="true"/> <field name="paysNaissanceCodeInsee" type="string" column="PAYS_NAISSANCE_CODE_INSEE" length="3" nullable="false"/> <field name="paysNaissanceLibelle" type="string" column="PAYS_NAISSANCE_LIBELLE" length="30" nullable="false"/> - <field name="paysNationaliteCodeInsee" type="string" column="PAYS_NATIONALITE_CODE_INSEE" length="3" - nullable="false"/> + <field name="paysNationaliteCodeInsee" type="string" column="PAYS_NATIONALITE_CODE_INSEE" length="3" nullable="false"/> <field name="paysNationaliteLibelle" type="string" column="PAYS_NATIONALITE_LIBELLE" length="30" nullable="false"/> <field name="prenom" type="string" column="PRENOM" length="60" nullable="false"/> <field name="sourceCode" type="string" column="SOURCE_CODE" length="100" nullable="true"/> @@ -108,13 +100,15 @@ <join-column name="TYPE_ID" referenced-column-name="ID"/> </join-columns> </many-to-one> + <many-to-one field="dossier" target-entity="Application\Entity\Db\Dossier"> + <join-columns> + <join-column name="DOSSIER_ID" referenced-column-name="ID"/> + </join-columns> + </many-to-one> <one-to-many field="affectation" target-entity="Application\Entity\Db\AffectationRecherche" mapped-by="intervenant"/> <one-to-many field="adresse" target-entity="Application\Entity\Db\AdresseIntervenant" mapped-by="intervenant"/> - <one-to-one field="adressePrinc" target-entity="Application\Entity\Db\AdresseIntervenantPrinc" - mapped-by="intervenant"/> <one-to-many field="service" target-entity="Application\Entity\Db\Service" mapped-by="intervenant"/> - <one-to-many field="histoService" target-entity="Application\Entity\Db\HistoIntervenantService" - mapped-by="intervenant"/> + <one-to-many field="histoService" target-entity="Application\Entity\Db\HistoIntervenantService" mapped-by="intervenant"/> <one-to-many field="serviceReferentiel" target-entity="Application\Entity\Db\ServiceReferentiel" mapped-by="intervenant"> <cascade> @@ -124,34 +118,21 @@ <one-to-many field="validation" target-entity="Application\Entity\Db\Validation" mapped-by="intervenant"/> <one-to-many field="agrement" target-entity="Application\Entity\Db\Agrement" mapped-by="intervenant"/> <one-to-one field="utilisateur" target-entity="Application\Entity\Db\Utilisateur" mapped-by="intervenant"/> - <one-to-one field="formuleIntervenant" target-entity="Application\Entity\Db\FormuleIntervenant" - mapped-by="intervenant"/> + <one-to-one field="formuleIntervenant" target-entity="Application\Entity\Db\FormuleIntervenant" mapped-by="intervenant"/> <one-to-many field="formuleResultat" target-entity="Application\Entity\Db\FormuleResultat" mapped-by="intervenant"/> - <one-to-many field="wfIntervenantEtape" target-entity="Application\Entity\Db\WfIntervenantEtape" - mapped-by="intervenant"/> - <one-to-one field="vIndicDiffDossier" target-entity="Application\Entity\Db\VIndicDiffDossier" - mapped-by="intervenant"/> - <one-to-many field="indicModifDossier" target-entity="Application\Entity\Db\IndicModifDossier" - mapped-by="intervenant"/> - <one-to-many field="miseEnPaiementIntervenantStructure" - target-entity="Application\Entity\Db\MiseEnPaiementIntervenantStructure" mapped-by="intervenant"/> - <one-to-many field="vIndicAttenteDemandeMep" target-entity="Application\Entity\Db\VIndicAttenteDemandeMep" - mapped-by="intervenant"/> + <one-to-many field="wfIntervenantEtape" target-entity="Application\Entity\Db\WfIntervenantEtape" mapped-by="intervenant"/> + <one-to-one field="vIndicDiffDossier" target-entity="Application\Entity\Db\VIndicDiffDossier" mapped-by="intervenant"/> + <one-to-many field="indicModifDossier" target-entity="Application\Entity\Db\IndicModifDossier" mapped-by="intervenant"/> + <one-to-many field="miseEnPaiementIntervenantStructure" target-entity="Application\Entity\Db\MiseEnPaiementIntervenantStructure" mapped-by="intervenant"/> + <one-to-many field="vIndicAttenteDemandeMep" target-entity="Application\Entity\Db\VIndicAttenteDemandeMep" mapped-by="intervenant"/> <one-to-many field="vIndicAttenteMep" target-entity="Application\Entity\Db\VIndicAttenteMep" mapped-by="intervenant"/> - <one-to-many field="vIndicDepassHcHorsRemuFc" target-entity="Application\Entity\Db\VIndicDepassHcHorsRemuFc" - mapped-by="intervenant"/> + <one-to-many field="vIndicDepassHcHorsRemuFc" target-entity="Application\Entity\Db\VIndicDepassHcHorsRemuFc" mapped-by="intervenant"/> <one-to-many field="vIndicDepassRef" target-entity="Application\Entity\Db\VIndicDepassRef" mapped-by="intervenant"/> - <one-to-many field="modificationServiceDu" target-entity="Application\Entity\Db\ModificationServiceDu" - mapped-by="intervenant"> + <one-to-many field="modificationServiceDu" target-entity="Application\Entity\Db\ModificationServiceDu" mapped-by="intervenant"> <cascade> <cascade-persist/> </cascade> </one-to-many> - <many-to-one field="dossier" target-entity="Application\Entity\Db\Dossier"> - <join-columns> - <join-column name="DOSSIER_ID" referenced-column-name="ID"/> - </join-columns> - </many-to-one> <one-to-many field="contrat" target-entity="Application\Entity\Db\Contrat" mapped-by="intervenant"/> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantExterieur.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantExterieur.dcm.xml deleted file mode 100644 index 28379a75ed..0000000000 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantExterieur.dcm.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Application\Entity\Db\IntervenantExterieur" table="INTERVENANT_EXTERIEUR"> - <indexes> - <index name="IDX_8FEA72F05E37C346" columns="SITUATION_FAMILIALE_ID"/> - <index name="IDX_8FEA72F0E9B3446E" columns="SOURCE_ID"/> - <index name="IDX_8FEA72F059860CDC" columns="HISTO_CREATEUR_ID"/> - <index name="IDX_8FEA72F07E9E2204" columns="HISTO_DESTRUCTEUR_ID"/> - <index name="IDX_8FEA72F063F06898" columns="HISTO_MODIFICATEUR_ID"/> - </indexes> - <id name="id" association-key="true"/> - <many-to-one field="situationFamiliale" target-entity="Application\Entity\Db\SituationFamiliale"> - <join-columns> - <join-column name="SITUATION_FAMILIALE_ID" referenced-column-name="ID"/> - </join-columns> - </many-to-one> - </entity> -</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantPermanent.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantPermanent.dcm.xml deleted file mode 100644 index 5e8efd74be..0000000000 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.IntervenantPermanent.dcm.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Application\Entity\Db\IntervenantPermanent" table="INTERVENANT_PERMANENT"> - <indexes> - <index name="IDX_FB425D2759860CDC" columns="HISTO_CREATEUR_ID"/> - <index name="IDX_FB425D277E9E2204" columns="HISTO_DESTRUCTEUR_ID"/> - <index name="IDX_FB425D2763F06898" columns="HISTO_MODIFICATEUR_ID"/> - <index name="IDX_FB425D27E9B3446E" columns="SOURCE_ID"/> - </indexes> - <id name="id" association-key="true"/> - </entity> -</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.SituationFamiliale.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.SituationFamiliale.dcm.xml deleted file mode 100644 index 9381210d74..0000000000 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.SituationFamiliale.dcm.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> - <entity name="Application\Entity\Db\SituationFamiliale" table="SITUATION_FAMILIALE"> - <indexes> - <index name="IDX_2E5815D59860CDC" columns="HISTO_CREATEUR_ID"/> - <index name="IDX_2E5815D7E9E2204" columns="HISTO_DESTRUCTEUR_ID"/> - <index name="IDX_2E5815D63F06898" columns="HISTO_MODIFICATEUR_ID"/> - </indexes> - <unique-constraints> - <unique-constraint name="situation_familiale_code_un" columns="CODE"/> - </unique-constraints> - <id name="id" type="integer" column="ID"> - <generator strategy="SEQUENCE"/> - </id> - <field name="code" type="string" column="CODE" length="1" nullable="false"/> - <field name="histoCreation" type="datetime" column="HISTO_CREATION" nullable="false"/> - <field name="histoDestruction" type="datetime" column="HISTO_DESTRUCTION" nullable="true"/> - <field name="histoModification" type="datetime" column="HISTO_MODIFICATION" nullable="false"/> - <field name="libelle" type="string" column="LIBELLE" length="15" nullable="false"/> - <many-to-one field="histoModificateur" target-entity="Application\Entity\Db\Utilisateur"> - <join-columns> - <join-column name="HISTO_MODIFICATEUR_ID" referenced-column-name="ID"/> - </join-columns> - </many-to-one> - <many-to-one field="histoDestructeur" target-entity="Application\Entity\Db\Utilisateur"> - <join-columns> - <join-column name="HISTO_DESTRUCTEUR_ID" referenced-column-name="ID"/> - </join-columns> - </many-to-one> - <many-to-one field="histoCreateur" target-entity="Application\Entity\Db\Utilisateur"> - <join-columns> - <join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/> - </join-columns> - </many-to-one> - </entity> -</doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/SituationFamiliale.php b/module/Application/src/Application/Entity/Db/SituationFamiliale.php deleted file mode 100644 index e03a647539..0000000000 --- a/module/Application/src/Application/Entity/Db/SituationFamiliale.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace Application\Entity\Db; - -use Doctrine\ORM\Mapping as ORM; -use UnicaenApp\Entity\HistoriqueAwareInterface; -use UnicaenApp\Entity\HistoriqueAwareTrait; - -/** - * SituationFamiliale - */ -class SituationFamiliale implements HistoriqueAwareInterface -{ - use HistoriqueAwareTrait; - - /** - * @var string - */ - protected $code; - - /** - * @var string - */ - protected $libelle; - - /** - * @var integer - */ - protected $id; - - - - /** - * Set code - * - * @param string $code - * - * @return SituationFamiliale - */ - public function setCode($code) - { - $this->code = $code; - - return $this; - } - - - - /** - * Get code - * - * @return string - */ - public function getCode() - { - return $this->code; - } - - - - /** - * Set libelle - * - * @param string $libelle - * - * @return SituationFamiliale - */ - public function setLibelle($libelle) - { - $this->libelle = $libelle; - - return $this; - } - - - - /** - * Get libelle - * - * @return string - */ - public function getLibelle() - { - return $this->libelle; - } - - - - /** - * Get id - * - * @return integer - */ - public function getId() - { - return $this->id; - } - - - - /** - * Retourne la représentation littérale de cet objet. - * - * @return string - */ - public function __toString() - { - return $this->getLibelle(); - } -} diff --git a/module/Application/src/Application/Entity/Db/Traits/AdresseIntervenantPrincAwareTrait.php b/module/Application/src/Application/Entity/Db/Traits/AdresseIntervenantPrincAwareTrait.php deleted file mode 100755 index c979634def..0000000000 --- a/module/Application/src/Application/Entity/Db/Traits/AdresseIntervenantPrincAwareTrait.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Application\Entity\Db\Traits; - -use Application\Entity\Db\AdresseIntervenantPrinc; - -/** - * Description of AdresseIntervenantPrincAwareTrait - * - * @author UnicaenCode - */ -trait AdresseIntervenantPrincAwareTrait -{ - /** - * @var AdresseIntervenantPrinc - */ - private $adresseIntervenantPrinc; - - - - - - /** - * @param AdresseIntervenantPrinc $adresseIntervenantPrinc - * @return self - */ - public function setAdresseIntervenantPrinc( AdresseIntervenantPrinc $adresseIntervenantPrinc = null ) - { - $this->adresseIntervenantPrinc = $adresseIntervenantPrinc; - return $this; - } - - - - /** - * @return AdresseIntervenantPrinc - */ - public function getAdresseIntervenantPrinc() - { - return $this->adresseIntervenantPrinc; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Traits/IntervenantExterieurAwareTrait.php b/module/Application/src/Application/Entity/Db/Traits/IntervenantExterieurAwareTrait.php deleted file mode 100755 index 240f26f126..0000000000 --- a/module/Application/src/Application/Entity/Db/Traits/IntervenantExterieurAwareTrait.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Application\Entity\Db\Traits; - -use Application\Entity\Db\IntervenantExterieur; - -/** - * Description of IntervenantExterieurAwareTrait - * - * @author UnicaenCode - */ -trait IntervenantExterieurAwareTrait -{ - /** - * @var IntervenantExterieur - */ - private $intervenantExterieur; - - - - - - /** - * @param IntervenantExterieur $intervenantExterieur - * @return self - */ - public function setIntervenantExterieur( IntervenantExterieur $intervenantExterieur = null ) - { - $this->intervenantExterieur = $intervenantExterieur; - return $this; - } - - - - /** - * @return IntervenantExterieur - */ - public function getIntervenantExterieur() - { - return $this->intervenantExterieur; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Entity/Db/Traits/IntervenantPermanentAwareTrait.php b/module/Application/src/Application/Entity/Db/Traits/IntervenantPermanentAwareTrait.php deleted file mode 100755 index a4ae7e667a..0000000000 --- a/module/Application/src/Application/Entity/Db/Traits/IntervenantPermanentAwareTrait.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Application\Entity\Db\Traits; - -use Application\Entity\Db\IntervenantPermanent; - -/** - * Description of IntervenantPermanentAwareTrait - * - * @author UnicaenCode - */ -trait IntervenantPermanentAwareTrait -{ - /** - * @var IntervenantPermanent - */ - private $intervenantPermanent; - - - - - - /** - * @param IntervenantPermanent $intervenantPermanent - * @return self - */ - public function setIntervenantPermanent( IntervenantPermanent $intervenantPermanent = null ) - { - $this->intervenantPermanent = $intervenantPermanent; - return $this; - } - - - - /** - * @return IntervenantPermanent - */ - public function getIntervenantPermanent() - { - return $this->intervenantPermanent; - } -} \ No newline at end of file diff --git a/module/Application/src/Application/Form/DisciplineForm.php b/module/Application/src/Application/Form/DisciplineForm.php index 1dec1ea39c..2380cd459d 100644 --- a/module/Application/src/Application/Form/DisciplineForm.php +++ b/module/Application/src/Application/Form/DisciplineForm.php @@ -2,6 +2,7 @@ namespace Application\Form; +use Application\Service\Traits\ParametresAwareTrait; use Zend\Form\Form; use Zend\ServiceManager\ServiceLocatorAwareInterface; use Zend\ServiceManager\ServiceLocatorAwareTrait; @@ -15,6 +16,7 @@ use Zend\Stdlib\Hydrator\HydratorInterface; class DisciplineForm extends Form implements ServiceLocatorAwareInterface { use ServiceLocatorAwareTrait; + use ParametresAwareTrait; @@ -47,6 +49,19 @@ class DisciplineForm extends Form implements ServiceLocatorAwareInterface ], ]); + for( $i = 1; $i <= 4; $i++ ){ + $lcc = $this->getServiceParametres()->get('discipline_codes_corresp_'.$i.'_libelle'); + if ($lcc){ + $this->add([ + 'type' => 'Text', + 'name' => 'codes-corresp-'.$i, + 'options' => [ + 'label' => $lcc, + ], + ]); + } + } + $this->add([ 'name' => 'id', 'type' => 'Hidden', @@ -82,6 +97,18 @@ class DisciplineForm extends Form implements ServiceLocatorAwareInterface 'libelle-court' => [ 'required' => true, ], + 'codes-corresp-1' => [ + 'required' => false, + ], + 'codes-corresp-2' => [ + 'required' => false, + ], + 'codes-corresp-3' => [ + 'required' => false, + ], + 'codes-corresp-4' => [ + 'required' => false, + ], ]; } } @@ -104,7 +131,10 @@ class DisciplineFormHydrator implements HydratorInterface $object->setSourceCode($data['source-code']); $object->setLibelleLong($data['libelle-long']); $object->setLibelleCourt($data['libelle-court']); - + if (isset($data['codes-corresp-1'])) $object->setCodesCorresp1($data['codes-corresp-1']); + if (isset($data['codes-corresp-2'])) $object->setCodesCorresp2($data['codes-corresp-2']); + if (isset($data['codes-corresp-3'])) $object->setCodesCorresp3($data['codes-corresp-3']); + if (isset($data['codes-corresp-4'])) $object->setCodesCorresp4($data['codes-corresp-4']); return $object; } @@ -118,10 +148,14 @@ class DisciplineFormHydrator implements HydratorInterface public function extract($object) { $data = [ - 'id' => $object->getId(), - 'source-code' => $object->getSourceCode(), - 'libelle-long' => $object->getLibelleLong(), - 'libelle-court' => $object->getLibelleCourt(), + 'id' => $object->getId(), + 'source-code' => $object->getSourceCode(), + 'libelle-long' => $object->getLibelleLong(), + 'libelle-court' => $object->getLibelleCourt(), + 'codes-corresp-1' => $object->getCodesCorresp1(), + 'codes-corresp-2' => $object->getCodesCorresp2(), + 'codes-corresp-3' => $object->getCodesCorresp3(), + 'codes-corresp-4' => $object->getCodesCorresp4(), ]; return $data; diff --git a/module/Application/src/Application/Service/Etape.php b/module/Application/src/Application/Service/Etape.php index 3d8ed90c26..ae71ba2960 100644 --- a/module/Application/src/Application/Service/Etape.php +++ b/module/Application/src/Application/Service/Etape.php @@ -108,9 +108,10 @@ class Etape extends AbstractEntityService { list($qb, $alias) = $this->initQuery($qb, $alias); $or = $qb->expr()->orX(); - $or->add($qb->expr()->exists("SELECT eptmp FROM Application\Entity\Db\ElementPedagogique eptmp WHERE eptmp.etape = $alias")); - $or->add($qb->expr()->exists("SELECT cptmp FROM Application\Entity\Db\CheminPedagogique cptmp WHERE cptmp.etape = $alias")); + $or->add($qb->expr()->exists("SELECT eptmp FROM Application\Entity\Db\ElementPedagogique eptmp WHERE eptmp.etape = $alias AND eptmp.annee = :eptmpAnnee")); + $or->add($qb->expr()->exists("SELECT cptmp FROM Application\Entity\Db\CheminPedagogique cptmp JOIN cptmp.elementPedagogique eptmp2 WHERE cptmp.etape = $alias AND eptmp2.annee = :eptmpAnnee")); $qb->andWhere($or); + $qb->setParameter('eptmpAnnee', $this->getServiceContext()->getAnnee()); return $qb; } @@ -184,130 +185,6 @@ class Etape extends AbstractEntityService - /** - * Détermine si on peut ajouter une étape ou non - * - * @return boolean - * - * public function canAdd($runEx = false) - * { - * $localContext = $this->getServiceLocalContext(); - * - * $role = $this->getServiceContext()->getSelectedIdentityRole(); - * /* @var $role \Application\Acl\DbRole * - * - * //if ($role instanceof \Application\Acl\AdministrateurRole) return true; - * - * if (!$localContext->getStructure()) { - * throw new \Common\Exception\LogicException("Le filtre structure est requis dans la méthode " . __METHOD__); - * } - * if ($localContext->getStructure()->getId() === $role->getStructure()->getId() - * || $localContext->getStructure()->estFilleDeLaStructureDeNiv2($role->getStructure())) { - * return true; - * } - * - * $this->cannotDoThat( - * "Votre structure de responsabilité ('{$role->getStructure()}') ne vous permet pas d'ajouter/modifier de formation" - * . "pour la structure '{$localContext->getStructure()}'", $runEx); - * - * return $this->cannotDoThat('Vous n\'avez pas les droits nécessaires pour ajouter ou modifier une formation', $runEx); - * } - * - * /** - * Détermine si l'étape peut être éditée ou non - * - * @param int|\Application\Entity\Db\Etape $etape - * - * @return boolean - * - * public function canSave($etape, $runEx = false) - * { - * if (! $this->canAdd($runEx)) { - * return false; - * } - * - * if (!$etape instanceof EtapeEntity) { - * $etape = $this->get($etape); - * } - * - * if ($etape->getSource()->getCode() !== \Application\Entity\Db\Source::CODE_SOURCE_OSE){ - * $errStr = 'Cette formation n\'est pas modifiable dans OSE car elle provient du logiciel '.$etape->getSource(); - * $errStr .= '. Si vous souhaitez mettre à jour ces informations, nous vous invitons donc à les modifier directement dans '.$etape->getSource().'.'; - * - * return $this->cannotDoThat($errStr, $runEx); - * } - * - * return true; - * } - * - * /** - * Détermine si l'étape peut être supprimée ou non - * - * @param \Application\Entity\Db\Etape $etape - * @param boolean $runEx - * - * @return boolean - * - * public function canDelete(EtapeEntity $etape, $runEx=false) - * { - * return $this->canSave($etape,$runEx); - * }* - * - * public function canEditModulateurs($etape, $runEx = false) - * { - * if (!$etape instanceof EtapeEntity) { - * $etape = $this->get($etape); - * } - * - * $ir = $this->getServiceContext()->getSelectedIdentityRole(); - * if ($ir instanceof \Application\Acl\ComposanteRole) { - * if ($etape->getStructure() != $ir->getStructure()) { - * return $this->cannotDoThat('Vous n\'avez pas les autorisations nécessaires pour éditer les modulateurs de cette structure', $runEx); - * } - * } elseif ($ir->getRoleId() == \Application\Acl\Role::ROLE_ID || $ir->getRoleId() == 'user') { - * return $this->cannotDoThat('Vous n\'êtes pas autorisé à éditer de modulateurs', $runEx); - * } elseif ($ir instanceof \Application\Acl\IntervenantRole) { - * return $this->cannotDoThat('Les intervenants n\'ont pas la possibilité d\'ajouter de modulateur', $runEx); - * } - * - * $stm = $this->getServiceLocator()->get('applicationTypeModulateur'); - * /* @var $stm \Application\Service\TypeModulateur * - * if (0 === $stm->count($stm->finderByEtape($etape))) { - * return $this->cannotDoThat('Aucun modulateur ne peut être saisi sur cette étape', $runEx); - * } - * - * return true; - * } - * - * - * - * public function canEditCentresCouts($etape, $runEx = false) - * { - * if (!$etape instanceof EtapeEntity) { - * $etape = $this->get($etape); - * } - * - * $ir = $this->getServiceContext()->getSelectedIdentityRole(); - * if ($ir instanceof \Application\Acl\ComposanteRole) { - * if ($etape->getStructure() != $ir->getStructure()) { - * return $this->cannotDoThat('Vous n\'avez pas les autorisations nécessaires pour paramétrer les centres de coûts de cette structure', $runEx); - * } - * } elseif ($ir->getRoleId() == \Application\Acl\Role::ROLE_ID || $ir->getRoleId() == 'user') { - * return $this->cannotDoThat('Vous n\'êtes pas autorisé à paramétrer les centres de coûts', $runEx); - * } elseif ($ir instanceof \Application\Acl\IntervenantRole) { - * return $this->cannotDoThat('Les intervenants n\'ont pas la possibilité de paramétrer les centres de coûts', $runEx); - * } - * - * // $stm = $this->getServiceLocator()->get('applicationTypeModulateur'); - * // /* @var $stm \Application\Service\TypeModulateur * - * // if (0 === $stm->count( $stm->finderByEtape($etape) ) ){ - * // return $this->cannotDoThat('Aucun modulateur ne peut être saisi sur cette étape', $runEx); - * // } - * - * return true; - * }*/ - - /** * Retourne la liste des étapes * diff --git a/module/Application/src/Application/Service/Parametres.php b/module/Application/src/Application/Service/Parametres.php index 9d4810b464..d1d9be848a 100644 --- a/module/Application/src/Application/Service/Parametres.php +++ b/module/Application/src/Application/Service/Parametres.php @@ -73,9 +73,6 @@ class Parametres extends AbstractService { */ public function get($param) { - if (! $this->getCache($param)){ - throw new LogicException('Le paramètre "'.$param.'" est invalide.'); - } return $this->getCache($param); } diff --git a/module/Application/src/Application/Service/ServiceService.php b/module/Application/src/Application/Service/ServiceService.php index 9487662d52..0f1e20b273 100644 --- a/module/Application/src/Application/Service/ServiceService.php +++ b/module/Application/src/Application/Service/ServiceService.php @@ -22,6 +22,7 @@ use Application\Form\Service\RechercheHydrator; use Application\Service\Traits\ElementPedagogiqueAwareTrait; use Application\Service\Traits\IntervenantAwareTrait; use Application\Service\Traits\StructureAwareTrait; +use Application\Service\Traits\TypeIntervenantAwareTrait; use Application\Service\Traits\TypeInterventionAwareTrait; use Application\Service\Traits\TypeVolumeHoraireAwareTrait; use Application\Service\Traits\VolumeHoraireAwareTrait; @@ -44,6 +45,7 @@ class ServiceService extends AbstractEntityService use EtatVolumeHoraireAwareTrait; use TypeVolumeHoraireAwareTrait; use VolumeHoraireAwareTrait; + use TypeIntervenantAwareTrait; /** * @@ -67,7 +69,7 @@ class ServiceService extends AbstractEntityService */ public function getEntityClass() { - return 'Application\Entity\Db\Service'; + return ServiceEntity::class; } @@ -418,8 +420,9 @@ class ServiceService extends AbstractEntityService $this->leftJoin($serviceElementPedagogique, $qb, 'elementPedagogique', false, $alias); $serviceElementPedagogique->leftJoin($serviceStructure, $qb, 'structure', false, null, 's_ens'); - $filter = "(($iAlias INSTANCE OF Application\Entity\Db\IntervenantPermanent AND $iAlias.structure = :composante) OR s_ens = :composante)"; + $filter = "(($iAlias.type = :typeIntervenantPermanent AND $iAlias.structure = :composante) OR s_ens = :composante)"; $qb->andWhere($filter)->setParameter('composante', $structure); + $qb->setParameter('typeIntervenantPermanent', $this->getServiceTypeIntervenant()->getPermanent()); return $qb; } @@ -442,7 +445,8 @@ class ServiceService extends AbstractEntityService $this->join($serviceIntervenant, $qb, 'intervenant', false, $alias); $serviceIntervenant->finderByStructure($structure, $qb); - $qb->andWhere($iAlias . ' INSTANCE OF Application\Entity\Db\IntervenantPermanent'); + $qb->andWhere("$iAlias.type = :typeIntervenantPermanent"); + $qb->setParameter('typeIntervenantPermanent', $this->getServiceTypeIntervenant()->getPermanent()); return $qb; } diff --git a/module/Application/src/Application/Service/TypeIntervenant.php b/module/Application/src/Application/Service/TypeIntervenant.php index 0221ca969b..ba69b3e1ee 100644 --- a/module/Application/src/Application/Service/TypeIntervenant.php +++ b/module/Application/src/Application/Service/TypeIntervenant.php @@ -20,7 +20,7 @@ class TypeIntervenant extends AbstractEntityService */ public function getEntityClass() { - return 'Application\Entity\Db\TypeIntervenant'; + return TypeIntervenantEntity::class; } /** @@ -55,7 +55,7 @@ class TypeIntervenant extends AbstractEntityService /** * * @param string $code - * @return \Application\Entity\Db\TypeValidation + * @return TypeIntervenantEntity */ public function getByCode( $code ) { diff --git a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php index 28354d4070..f824ab6137 100644 --- a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php +++ b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php @@ -84,11 +84,6 @@ class IntervenantViewHelper extends AbstractHtmlElement ], ]; - /* @deprecated en attendant la fusion des types d'intervenants... */ - if (!$entity->estPermanent()) { - $vars['identite']['Situation familiale'] = $entity->getSituationFamiliale() ?: "(Inconnue)"; - } - $html = ''; foreach ($vars as $bloc => $vvs) { $html .= "<dl class=\"intervenant intervenant-$bloc dl-horizontal\">\n"; diff --git a/module/Application/view/application/discipline/index.phtml b/module/Application/view/application/discipline/index.phtml index fa180e1fb0..72b217b372 100644 --- a/module/Application/view/application/discipline/index.phtml +++ b/module/Application/view/application/discipline/index.phtml @@ -1,7 +1,15 @@ <?php /* @var $disciplines \Application\Entity\Db\Discipline[] */ +/* @var $libellesCodesCorresp string[] */ $canEdit = $this->isAllowed('privilege/'.\Application\Entity\Db\Privilege::DISCIPLINE_EDITION); + +function truncCodesCorresp($value){ + if (strlen($value) > 20) $value = '<span title="'.str_replace(',', ', ', $value).'">'.substr($value, 0, 19) . '...</span>'; + return str_replace(',', ', ', $value); +} + + ?> <h1>Gestion des disciplines</h1> @@ -11,6 +19,10 @@ $canEdit = $this->isAllowed('privilege/'.\Application\Entity\Db\Privilege::DISCI <th>Code</th> <th>Libellé court</th> <th>Libellé long</th> + <?php if (isset($libellesCodesCorresp[1])) echo '<th>'.$libellesCodesCorresp[1].'</th>' ?> + <?php if (isset($libellesCodesCorresp[2])) echo '<th>'.$libellesCodesCorresp[2].'</th>' ?> + <?php if (isset($libellesCodesCorresp[3])) echo '<th>'.$libellesCodesCorresp[3].'</th>' ?> + <?php if (isset($libellesCodesCorresp[4])) echo '<th>'.$libellesCodesCorresp[4].'</th>' ?> <th>Src/Actions</th> </tr> </htead> @@ -20,6 +32,10 @@ $canEdit = $this->isAllowed('privilege/'.\Application\Entity\Db\Privilege::DISCI <td style="text-align: center"><?php echo $discipline->getSourceCode(); ?></td> <td><?php echo $discipline->getLibelleCourt(); ?></td> <td><?php echo $discipline->getLibelleLong(); ?></td> + <?php if (isset($libellesCodesCorresp[1])) echo '<td>'.truncCodesCorresp($discipline->getCodesCorresp1()).'</td>' ?> + <?php if (isset($libellesCodesCorresp[2])) echo '<td>'.truncCodesCorresp($discipline->getCodesCorresp2()).'</td>' ?> + <?php if (isset($libellesCodesCorresp[3])) echo '<td>'.truncCodesCorresp($discipline->getCodesCorresp3()).'</td>' ?> + <?php if (isset($libellesCodesCorresp[4])) echo '<td>'.truncCodesCorresp($discipline->getCodesCorresp4()).'</td>' ?> <td style="text-align: center"> <?php if ($discipline->getSource()->isOse() && $canEdit): ?> <a class="ajax-modal" data-event="discipline-edition" href="<?php echo $this->url('discipline/saisir', ['discipline' => $discipline->getId()])?>" title="Modifier la discipline"><span class="glyphicon glyphicon-edit"></span></a> diff --git a/module/Application/view/application/discipline/saisir.phtml b/module/Application/view/application/discipline/saisir.phtml index 1b30369030..0b3ef92eb5 100644 --- a/module/Application/view/application/discipline/saisir.phtml +++ b/module/Application/view/application/discipline/saisir.phtml @@ -13,6 +13,9 @@ if ($errors) { echo $this->formControlGroup($form->get('source-code')); echo $this->formControlGroup($form->get('libelle-long')); echo $this->formControlGroup($form->get('libelle-court')); +for( $i = 1; $i <= 4; $i++ ) { + if ($form->has('codes-corresp-' . $i)) echo $this->formControlGroup($form->get('codes-corresp-' . $i)); +} echo $this->formRow($form->get('submit')); echo $this->formHidden($form->get('id')); diff --git a/module/Application/view/application/service/index.phtml b/module/Application/view/application/service/index.phtml index 427f312532..db4bd2b9b5 100644 --- a/module/Application/view/application/service/index.phtml +++ b/module/Application/view/application/service/index.phtml @@ -59,6 +59,7 @@ if ($intervenant) $serviceListe->showPrevuToPrevu($intervenant); <hr /> <?php echo $serviceListe->render(); ?> + <?php if ($intervenant): ?> <div id="s-horodatage" data-url="<?php echo $this->url('service/horodatage', [ 'intervenant' => $intervenant->getSourceCode(), 'typeVolumeHoraire' => $typeVolumeHoraire->getId(), @@ -70,8 +71,9 @@ if ($intervenant) $serviceListe->showPrevuToPrevu($intervenant); 'referentiel' => false ]); ?> </div> + <?php endif; ?> - <?php if ($intervenant === null || $intervenant->getStatut()->getPeutSaisirReferentiel()): ?> + <?php if ($intervenant && $intervenant->getStatut()->getPeutSaisirReferentiel()): ?> <?php echo $this->servicesRefListe; ?> <div id="sr-horodatage" data-url="<?php echo $this->url('service/horodatage', [ 'intervenant' => $intervenant->getSourceCode(), diff --git a/module/Import/src/Import/Processus/Import.php b/module/Import/src/Import/Processus/Import.php index f5c453fd3f..56e90e1756 100644 --- a/module/Import/src/Import/Processus/Import.php +++ b/module/Import/src/Import/Processus/Import.php @@ -244,8 +244,6 @@ class Import implements ServiceLocatorAwareInterface $this->execMaj( 'INTERVENANT', 'SOURCE_CODE', $sourceCode, $action ?: self::A_INSERT ); $id = $this->getQueryGenerator()->getIdFromSourceCode( 'INTERVENANT', $sourceCode, $this->getServiceContext()->getAnnee()->getId() ); if (! empty($id)){ - $this->execMaj( 'INTERVENANT_PERMANENT', 'SOURCE_CODE', $id, $action ?: self::A_ALL ); - $this->execMaj( 'INTERVENANT_EXTERIEUR', 'SOURCE_CODE', $id, $action ?: self::A_ALL ); $this->execMaj( 'ADRESSE_INTERVENANT', 'INTERVENANT_ID', $id, $action ?: self::A_ALL ); $this->execMaj( 'AFFECTATION_RECHERCHE', 'INTERVENANT_ID', $id, $action ?: self::A_ALL ); } @@ -265,24 +263,16 @@ class Import implements ServiceLocatorAwareInterface $q1 = new Query('INTERVENANT'); $q1->setSourceCode($intervenant->getSourceCode()); - $q2 = new Query('INTERVENANT_PERMANENT'); - $q2->setSourceCode($intervenant->getSourceCode()); + $q2 = new Query('ADRESSE_INTERVENANT'); + $q2->addColValue('INTERVENANT_ID', $intervenant->getId() ); - $q3 = new Query('INTERVENANT_EXTERIEUR'); - $q3->setSourceCode($intervenant->getSourceCode()); - - $q4 = new Query('ADRESSE_INTERVENANT'); - $q4->addColValue('INTERVENANT_ID', $intervenant->getId() ); - - $q5 = new Query('AFFECTATION_RECHERCHE'); - $q5->addColValue('INTERVENANT_ID', $intervenant->getId() ); + $q3 = new Query('AFFECTATION_RECHERCHE'); + $q3->addColValue('INTERVENANT_ID', $intervenant->getId() ); $diff = array_merge( $differentiel->make($q1)->fetchAll(), $differentiel->make($q2)->fetchAll(), - $differentiel->make($q3)->fetchAll(), - $differentiel->make($q4)->fetchAll(), - $differentiel->make($q5)->fetchAll() + $differentiel->make($q3)->fetchAll() ); return $diff; -- GitLab