Commit dd280005 authored by lecluse's avatar lecluse
Browse files

Gros refactoring (plus d'intervenants permanents et d'intervenants extérieurs)

Mise en place des disciplines et des grades.

Seules restent les disciplines des éléments pédagogiques à mettre en place
parent 21bfd01d
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
......@@ -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');
}
......
......@@ -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;
......
......@@ -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',
]);
}
......
......@@ -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
]);
}
......
......@@ -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;
......
......@@ -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
*
......
<?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
......@@ -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();
}
}
<?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
<?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
<?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
......@@ -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;
......
<?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;
}