diff --git "a/data/Sql/Param\303\250tres.sql" "b/data/Sql/Param\303\250tres.sql" index 56107f845575fe491a34ca6ea9dab38ffa94a402..1c5f9fe8f9547e90cef5ff815636605f4a6d7dc2 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 484d79c8a099803c2184d215731fad9e1b23aa7c..d748473608aa005e33e0d346eee47b573517929f 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 97a7fff5fa2be749fe584f653ae2e2331fda3f90..7e20d2202708036fe14c894c7d4864231464bc9f 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 1f95c8a4950bb061ed855a0addc6433237698f0a..98dc523409081c4a102891302909fa4ed0c94880 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 3bc1a5314af0ee35d75e751038b362809e01c16d..89c5181872e56abbb9707821d4e2194bbb4e9ad9 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 23f61216074146213dbf644c9cb7f1e1e5e74b71..72953d22dcfc185f35421d413a21fd761c15f2d0 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 49677e9c01632f81d5d2e1ebaa61841838b15f5a..95ff1e0400648dd9216759b28487958375022ae7 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 fb9a3a59cd89226cd6848b815f6b7ed54f0586d2..0000000000000000000000000000000000000000 --- 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 58c083584711e28746d66ebd0313a5fe4e078c67..216e298a1fb64d0876040a94d4fd5261fbfa2f18 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 8bbdfb4a579b9cf3f6438f4ff395177848c33b71..0000000000000000000000000000000000000000 --- 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 c8446d656f36fb72e4b110b585274a0b31c25376..0000000000000000000000000000000000000000 --- 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 98050b2d36669a0447e114d3ff557b037628c965..0000000000000000000000000000000000000000 --- 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 2b81faabeeca205b2629b56b2deeaa59ad06a29d..35dfb72039423abed5274d6678f6cd2ac1a1215b 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 e5528565062c01d171d73091c8a19b186cd2ebd3..0000000000000000000000000000000000000000 --- 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 e3a4dda7328fe5a2e2cc78685e8fc8952110a849..0000000000000000000000000000000000000000 --- 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 9bbfe9dce0c9700a260857b88904270a35d332cf..148488f2303768110eb5cb877c03357e195be7fa 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 37c623c4c23e5ffc024a660611ab6101f903da4f..0000000000000000000000000000000000000000 --- 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 6e668ec5161d0c8acac81d3add7c1d146a2bb8c4..ff67a97652208774c2cedafbd2aa6acc39eaab48 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 cf3ed2c8f5e110ed001765b2e4ca0d8ace229870..3f6ba42d608cb2acf6fee769fcc3c7d2d38be509 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 28379a75edddc79fb76755121ec5576dc94ee32e..0000000000000000000000000000000000000000 --- 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 5e8efd74beca6c60be38a148c0193c7fe335c263..0000000000000000000000000000000000000000 --- 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 9381210d74161776fc54fe5ca747a9d7092d79e1..0000000000000000000000000000000000000000 --- 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 e03a647539d10485f2ab06d1b34e64dca037aaeb..0000000000000000000000000000000000000000 --- 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 c979634defa251e8d30464e3858bc94f1bfa7d03..0000000000000000000000000000000000000000 --- 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 240f26f126d2b91045eb5c1136c027a19381f469..0000000000000000000000000000000000000000 --- 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 a4ae7e667a7f24b8331724b6d31d0a906ff4f90b..0000000000000000000000000000000000000000 --- 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 1dec1ea39c5e6449d5be271aa4c83d260d30fbd8..2380cd459d3254a676d322c2dd182306c4b76639 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 3d8ed90c2631cb097f53776ebf9ee4d7eebf0f45..ae71ba296058b33fbd58d8341da07fbb33e8bb36 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 9d4810b464875b525983494231dcb0f6ec748cf8..d1d9be848a77f3dbdd2bf5675bad6b26afc6ea80 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 9487662d524abad6adefe5bd8abeb5845acbbea2..0f1e20b27387efa3a9c8372bca0071a5e35ab5e4 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 0221ca969bfd708e537578f2ab3360aebe3a75fc..ba69b3e1eecda35bf92feb95ee3147988b649726 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 28354d4070db23c978f223be2d0a11c2e63fc3b7..f824ab6137e3096713d0c94d431a8b5e1a651764 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 fa180e1fb00ba69f0d4c878eadefab2884220ac6..72b217b3726255f8b3a09d8b3bbdcd3a71cd84b4 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 1b303690301b2b996da1e6825599cb05ffc84621..0b3ef92eb577c39fad49b270dbfaecb53c19bd32 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 427f31253246d183b592f619327fd233b093fe89..db4bd2b9b54f599f6dcba0d4d4e6ed852de25a3f 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 f5c453fd3f2a8e7eb136a9d49be6f04a987c3291..56e90e17567d26cc5ccc017d8b2147771b18d5c1 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;