diff --git a/module/Application/src/Application/Assertion/ServiceAssertion.php b/module/Application/src/Application/Assertion/ServiceAssertion.php
index d0e6db0fd965e8bfc2a6e8dcf88b29b7fda73879..0fdc6bfc778c786e2fa08b4034a509e0d972b392 100644
--- a/module/Application/src/Application/Assertion/ServiceAssertion.php
+++ b/module/Application/src/Application/Assertion/ServiceAssertion.php
@@ -7,7 +7,6 @@ use Application\Acl\ComposanteRole;
use Application\Acl\DrhRole;
use Application\Acl\EtablissementRole;
use Application\Acl\IntervenantRole;
-use Application\Entity\Db\IntervenantPermanent;
use Application\Entity\Db\Intervenant;
use Application\Entity\Db\Service;
use Zend\Permissions\Acl\Acl;
diff --git a/module/Application/src/Application/Controller/DossierController.php b/module/Application/src/Application/Controller/DossierController.php
index 9724852e7e6667c46ed50eb295aac89c5e1f1914..97a7fff5fa2be749fe584f653ae2e2331fda3f90 100644
--- a/module/Application/src/Application/Controller/DossierController.php
+++ b/module/Application/src/Application/Controller/DossierController.php
@@ -5,7 +5,7 @@ namespace Application\Controller;
use Application\Acl\IntervenantRole;
use Application\Controller\Plugin\Context;
use Application\Entity\Db\Intervenant;
-use Application\Entity\Db\IntervenantExterieur;
+use Application\Entity\Db\Intervenant;
use Application\Entity\Db\StatutIntervenant;
use Application\Entity\Db\Listener\DossierListener;
use Application\Entity\Db\TypeValidation;
@@ -52,7 +52,7 @@ class DossierController extends AbstractActionController implements WorkflowInte
/**
- * @var IntervenantExterieur
+ * @var Intervenant
*/
private $intervenant;
@@ -76,7 +76,6 @@ class DossierController extends AbstractActionController implements WorkflowInte
{
$this->em()->getFilters()->enable('historique')->init([
'Application\Entity\Db\Intervenant',
- 'Application\Entity\Db\IntervenantExterieur',
'Application\Entity\Db\Validation',
'Application\Entity\Db\TypeValidation',
'Application\Entity\Db\Dossier',
@@ -127,7 +126,7 @@ class DossierController extends AbstractActionController implements WorkflowInte
}
// refetch intervenant avec jointure sur dossier (et respect de l'historique)
- $qb = $this->em()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("i")
+ $qb = $this->em()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("i")
->select("i, d")
->leftJoin("i.dossier", "d")
->andWhere("i = :i")
diff --git a/module/Application/src/Application/Controller/PieceJointeController.php b/module/Application/src/Application/Controller/PieceJointeController.php
index b42c710b9dd0dc0b48d993aa9bb1faf06424ab49..7c6e82a27eea8392955c90e9106243c1d4f49d30 100644
--- a/module/Application/src/Application/Controller/PieceJointeController.php
+++ b/module/Application/src/Application/Controller/PieceJointeController.php
@@ -5,7 +5,7 @@ namespace Application\Controller;
use Application\Assertion\FichierAssertion;
use Application\Assertion\PieceJointeAssertion;
use Application\Entity\Db\Fichier;
-use Application\Entity\Db\IntervenantExterieur;
+use Application\Entity\Db\Intervenant;
use Application\Entity\Db\PieceJointe;
use Application\Entity\Db\TypePieceJointe;
use Application\Entity\Db\TypePieceJointeStatut;
@@ -89,7 +89,7 @@ class PieceJointeController extends AbstractActionController implements Workflow
{
$this->initFilters();
- if (!$this->getIntervenant() instanceof IntervenantExterieur) {
+ if ($this->getIntervenant()->estPermanent()) {
throw new MessageException("Les pièces justificatives ne concernent que les intervenants extérieurs.");
}
@@ -469,7 +469,7 @@ class PieceJointeController extends AbstractActionController implements Workflow
/**
- * @var IntervenantExterieur
+ * @var Intervenant
*/
private $intervenant;
diff --git a/module/Application/src/Application/Controller/ServiceReferentielController.php b/module/Application/src/Application/Controller/ServiceReferentielController.php
index 37af990fbd7c4a2ed3a2d942a17d761313bb1858..23f61216074146213dbf644c9cb7f1e1e5e74b71 100644
--- a/module/Application/src/Application/Controller/ServiceReferentielController.php
+++ b/module/Application/src/Application/Controller/ServiceReferentielController.php
@@ -11,7 +11,6 @@ use Application\Service\Traits\VolumeHoraireReferentielAwareTrait;
use Zend\Mvc\Controller\AbstractActionController;
use Common\Exception\MessageException;
use Application\Exception\DbException;
-use Application\Entity\Db\IntervenantPermanent;
use Application\Entity\Service\Recherche;
use Application\Service\Traits\ContextAwareTrait;
diff --git a/module/Application/src/Application/Controller/ValidationController.php b/module/Application/src/Application/Controller/ValidationController.php
index 01b6409c0cd8b4ea5736ed618fab5bf1e270dfb5..6dee96956fefb7ee6f5cd3042b7793066ab59282 100644
--- a/module/Application/src/Application/Controller/ValidationController.php
+++ b/module/Application/src/Application/Controller/ValidationController.php
@@ -59,7 +59,7 @@ class ValidationController extends AbstractActionController
private $isReferentiel;
/**
- * @var \Application\Entity\Db\IntervenantExterieur
+ * @var \Application\Entity\Db\Intervenant
*/
private $intervenant;
diff --git a/module/Application/src/Application/Entity/Db/Contrat.php b/module/Application/src/Application/Entity/Db/Contrat.php
index 48b6ccd0d6c27bfc6e6498b53b2a69341ccbbf2a..7e07b0f6749a36c8ebb7b266a64391206c2e4136 100644
--- a/module/Application/src/Application/Entity/Db/Contrat.php
+++ b/module/Application/src/Application/Entity/Db/Contrat.php
@@ -24,7 +24,7 @@ class Contrat implements HistoriqueAwareInterface, ResourceInterface
private $typeContrat;
/**
- * @var \Application\Entity\Db\IntervenantExterieur
+ * @var \Application\Entity\Db\Intervenant
*/
private $intervenant;
@@ -226,11 +226,11 @@ class Contrat implements HistoriqueAwareInterface, ResourceInterface
/**
* Set intervenant
*
- * @param \Application\Entity\Db\IntervenantExterieur $intervenant
+ * @param \Application\Entity\Db\Intervenant $intervenant
*
* @return self
*/
- public function setIntervenant(\Application\Entity\Db\IntervenantExterieur $intervenant = null)
+ public function setIntervenant(\Application\Entity\Db\Intervenant $intervenant = null)
{
$this->intervenant = $intervenant;
@@ -242,7 +242,7 @@ class Contrat implements HistoriqueAwareInterface, ResourceInterface
/**
* Get intervenant
*
- * @return \Application\Entity\Db\IntervenantExterieur
+ * @return \Application\Entity\Db\Intervenant
*/
public function getIntervenant()
{
diff --git a/module/Application/src/Application/Entity/Db/Dossier.php b/module/Application/src/Application/Entity/Db/Dossier.php
index 3683412b2e5ff6dba5cb10200528287bd00f9763..bb921c7fc6631ff5e1bc0162d06b5d94023a0cf7 100644
--- a/module/Application/src/Application/Entity/Db/Dossier.php
+++ b/module/Application/src/Application/Entity/Db/Dossier.php
@@ -553,10 +553,10 @@ class Dossier implements HistoriqueAwareInterface
/**
*
- * @param \Application\Entity\Db\IntervenantExterieur $intervenant
+ * @param \Application\Entity\Db\Intervenant $intervenant
* @return \Application\Entity\Db\Dossier
*/
- public function fromIntervenant(IntervenantExterieur $intervenant)
+ public function fromIntervenant(Intervenant $intervenant)
{
$this
->setNomUsuel($intervenant->getNomUsuel())
diff --git a/module/Application/src/Application/Entity/Db/TypeIntervenant.php b/module/Application/src/Application/Entity/Db/TypeIntervenant.php
index 21706ef5552cb7e197ed7ab81903562bcd95ab7e..e79b29b9685ea8c1aa9bad07193697aa2c602268 100644
--- a/module/Application/src/Application/Entity/Db/TypeIntervenant.php
+++ b/module/Application/src/Application/Entity/Db/TypeIntervenant.php
@@ -1,6 +1,7 @@
<?php
namespace Application\Entity\Db;
+
use UnicaenApp\Entity\HistoriqueAwareInterface;
use UnicaenApp\Entity\HistoriqueAwareTrait;
@@ -9,12 +10,10 @@ use UnicaenApp\Entity\HistoriqueAwareTrait;
*/
class TypeIntervenant implements HistoriqueAwareInterface
{
- use HistoriqueAwareTrait;
+ CONST CODE_PERMANENT = 'P';
+ CONST CODE_EXTERIEUR = 'E';
- public $classToCode = [
- 'Application\Entity\Db\IntervenantPermanent' => 'P',
- 'Application\Entity\Db\IntervenantExterieur' => 'E',
- ];
+ use HistoriqueAwareTrait;
/**
* @var string
@@ -101,13 +100,6 @@ class TypeIntervenant implements HistoriqueAwareInterface
- CONST CODE_PERMANENT = 'P';
- CONST CODE_EXTERIEUR = 'E';
- CONST TYPE_PERMANENT = 1;
- CONST TYPE_EXTERIEUR = 2;
-
-
-
/**
* Retourne la représentation littérale de cet objet.
*
diff --git a/module/Application/src/Application/Entity/Db/TypeIntervenantExterieur.php b/module/Application/src/Application/Entity/Db/TypeIntervenantExterieur.php
deleted file mode 100644
index 552078039874c40c476a095971390fb5ea9eb53c..0000000000000000000000000000000000000000
--- a/module/Application/src/Application/Entity/Db/TypeIntervenantExterieur.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-namespace Application\Entity\Db;
-use UnicaenApp\Entity\HistoriqueAwareInterface;
-use UnicaenApp\Entity\HistoriqueAwareTrait;
-
-/**
- * TypeIntervenantExterieur
- */
-class TypeIntervenantExterieur implements HistoriqueAwareInterface
-{
- use HistoriqueAwareTrait;
-
- /**
- * @var string
- */
- protected $libelle;
-
- /**
- * @var float
- */
- protected $limiteHeuresComplementaires;
-
- /**
- * @var integer
- */
- protected $id;
-
-
-
- /**
- * Set libelle
- *
- * @param string $libelle
- *
- * @return TypeIntervenantExterieur
- */
- public function setLibelle($libelle)
- {
- $this->libelle = $libelle;
-
- return $this;
- }
-
-
-
- /**
- * Get libelle
- *
- * @return string
- */
- public function getLibelle()
- {
- return $this->libelle;
- }
-
-
-
- /**
- * Set limiteHeuresComplementaires
- *
- * @param float $limiteHeuresComplementaires
- *
- * @return TypeIntervenantExterieur
- */
- public function setLimiteHeuresComplementaires($limiteHeuresComplementaires)
- {
- $this->limiteHeuresComplementaires = $limiteHeuresComplementaires;
-
- return $this;
- }
-
-
-
- /**
- * Get limiteHeuresComplementaires
- *
- * @return float
- */
- public function getLimiteHeuresComplementaires()
- {
- return $this->limiteHeuresComplementaires;
- }
-
-
-
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
-
-}
diff --git a/module/Application/src/Application/Form/Intervenant/Dossier.php b/module/Application/src/Application/Form/Intervenant/Dossier.php
index 60746c6ae2761adce1dcb9286e3b053c3a111489..e099666289d321cdf6766ef33a894a6a100eaced 100644
--- a/module/Application/src/Application/Form/Intervenant/Dossier.php
+++ b/module/Application/src/Application/Form/Intervenant/Dossier.php
@@ -62,7 +62,7 @@ class Dossier extends Form implements ServiceLocatorAwareInterface
public function bind($object, $flags = FormInterface::VALUES_NORMALIZED)
{
if ($object->estPermanent()) {
- throw new LogicException("Ce formulaire ne peut être bindé qu'à un IntervenantExterieur.");
+ throw new LogicException("Ce formulaire ne peut être bindé qu'à un vacataire.");
}
return parent::bind($object, $flags);
diff --git a/module/Application/src/Application/Form/Intervenant/DossierHydrator.php b/module/Application/src/Application/Form/Intervenant/DossierHydrator.php
index 3f527c0d54e70ea00c7d8f70b2e54cafca3e210c..334f15e9b9d8056e9b6b493bd96025915a1121e4 100644
--- a/module/Application/src/Application/Form/Intervenant/DossierHydrator.php
+++ b/module/Application/src/Application/Form/Intervenant/DossierHydrator.php
@@ -2,7 +2,7 @@
namespace Application\Form\Intervenant;
use Application\Entity\Db\Dossier as DossierEntity;
-use Application\Entity\Db\IntervenantExterieur;
+use Application\Entity\Db\Intervenant;
use Application\Entity\Db\StatutIntervenant;
use Zend\Stdlib\Hydrator\HydratorInterface;
@@ -25,8 +25,8 @@ class DossierHydrator implements HydratorInterface
* Hydrate $object with the provided $data.
*
* @param array $data
- * @param IntervenantExterieur $intervenant
- * @return IntervenantExterieur
+ * @param Intervenant $intervenant
+ * @return Intervenant
*/
public function hydrate(array $data, $intervenant)
{
@@ -47,7 +47,7 @@ class DossierHydrator implements HydratorInterface
/**
* Extract values from an object
*
- * @param IntervenantExterieur $intervenant
+ * @param Intervenant $intervenant
* @return array
*/
public function extract($intervenant)
diff --git a/module/Application/src/Application/Form/Service/SaisieFieldset.php b/module/Application/src/Application/Form/Service/SaisieFieldset.php
index 4a87d43ba84896699a705e862810fc180835ad77..64498b0b448f18ae590ed0c89e7b0f731dfdb726 100644
--- a/module/Application/src/Application/Form/Service/SaisieFieldset.php
+++ b/module/Application/src/Application/Form/Service/SaisieFieldset.php
@@ -10,7 +10,7 @@ use Zend\ServiceManager\ServiceLocatorAwareTrait;
use Application\Acl\ComposanteRole;
use Application\Acl\IntervenantRole;
use Zend\InputFilter\InputFilterProviderInterface;
-use Application\Entity\Db\IntervenantExterieur;
+
/**
* Description of SaisieFieldset
@@ -70,7 +70,7 @@ class SaisieFieldset extends Fieldset implements InputFilterProviderInterface, S
$this->add($intervenant);
}
- if (!($identityRole instanceof IntervenantRole && $identityRole->getIntervenant() instanceof IntervenantExterieur)){
+ if (!($identityRole instanceof IntervenantRole && !$identityRole->getIntervenant()->estPermanent())){
$this->add([
'type' => 'Radio',
'name' => 'interne-externe',
diff --git a/module/Application/src/Application/Rule/Intervenant/PeutCreerContratInitialRule.php b/module/Application/src/Application/Rule/Intervenant/PeutCreerContratInitialRule.php
index 2c302da0354847183e3df874372a1df1dac94d97..03ba6d49562df49a8955d6983298f5a667dc24a4 100644
--- a/module/Application/src/Application/Rule/Intervenant/PeutCreerContratInitialRule.php
+++ b/module/Application/src/Application/Rule/Intervenant/PeutCreerContratInitialRule.php
@@ -3,7 +3,6 @@
namespace Application\Rule\Intervenant;
use Application\Entity\Db\Contrat;
-use Application\Entity\Db\IntervenantExterieur;
use Application\Entity\Db\TypeContrat;
use Application\Entity\Db\Validation;
use Application\Entity\Db\VolumeHoraire;
@@ -63,7 +62,7 @@ class PeutCreerContratInitialRule extends PeutCreerContratAbstractRule
public function isRelevant()
{
- return $this->getIntervenant() instanceof IntervenantExterieur;
+ return !$this->getIntervenant()->estPermanent();
}
/**
diff --git a/module/Application/src/Application/Rule/Intervenant/PossedeContratRule.php b/module/Application/src/Application/Rule/Intervenant/PossedeContratRule.php
index 88ea83208f2e2335e0950ce279ea562afc5e6838..f403dfe4f700689aee7fa085c756051034f2b22c 100644
--- a/module/Application/src/Application/Rule/Intervenant/PossedeContratRule.php
+++ b/module/Application/src/Application/Rule/Intervenant/PossedeContratRule.php
@@ -2,10 +2,8 @@
namespace Application\Rule\Intervenant;
-use Application\Entity\Db\IntervenantExterieur;
use Application\Traits\StructureAwareTrait;
use Application\Traits\TypeContratAwareTrait;
-use Common\Exception\LogicException;
use Doctrine\ORM\QueryBuilder;
/**
@@ -68,7 +66,7 @@ class PossedeContratRule extends AbstractIntervenantRule
public function getQueryBuilder()
{
$qb = $this->getServiceIntervenant()->getEntityManager()->createQueryBuilder()
- ->from("Application\Entity\Db\IntervenantExterieur", "i")
+ ->from("Application\Entity\Db\Intervenant", "i")
->select("i.id")
->join("i.contrat", "c");
@@ -97,7 +95,7 @@ class PossedeContratRule extends AbstractIntervenantRule
public function isRelevant()
{
if ($this->getIntervenant()) {
- return $this->getIntervenant() instanceof IntervenantExterieur;
+ return !$this->getIntervenant()->estPermanent();
}
return true;
diff --git a/module/Application/src/Application/Rule/Intervenant/PossedeDossierRule.php b/module/Application/src/Application/Rule/Intervenant/PossedeDossierRule.php
index 13b8cf8c557beb0f37c29cc2878fa095bf38f8de..8a67c6714ee33e806ca4af6c61654707d29cd8a4 100644
--- a/module/Application/src/Application/Rule/Intervenant/PossedeDossierRule.php
+++ b/module/Application/src/Application/Rule/Intervenant/PossedeDossierRule.php
@@ -2,7 +2,6 @@
namespace Application\Rule\Intervenant;
-use Application\Entity\Db\IntervenantExterieur;
use Common\Exception\LogicException;
/**
@@ -71,13 +70,13 @@ class PossedeDossierRule extends AbstractIntervenantRule
public function getQueryBuilder()
{
$em = $this->getServiceIntervenant()->getEntityManager();
- $qb = $em->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("i")
+ $qb = $em->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("i")
->select("i.id")
->join("i.dossier", "d");
if ($this->getIntervenant()) {
- if (!$this->getIntervenant() instanceof IntervenantExterieur) {
- throw new LogicException("L'intervenant spécifié doit être un IntervenantExterieur.");
+ if ($this->getIntervenant()->estPermanent()) {
+ throw new LogicException("L'intervenant spécifié doit être un vacataire.");
}
$qb->andWhere("i = " . $this->getIntervenant()->getId());
diff --git a/module/Application/src/Application/Service/Context.php b/module/Application/src/Application/Service/Context.php
index 3a87b4c403dcfa08451caa31d7144a8bcaffee3d..12ac2c2c32b15ad2503c5a0a4e3cb1d7b5d19d00 100644
--- a/module/Application/src/Application/Service/Context.php
+++ b/module/Application/src/Application/Service/Context.php
@@ -8,7 +8,6 @@ use Application\Entity\Db\Annee as AnneeEntity;
use Application\Entity\Db\Structure as StructureEntity;
use \DateTime;
use Zend\Session\Container;
-use \Application\Interfaces\StructureAwareInterface;
/**
* Service fournissant les différents contextes de fonctionnement de l'application.
@@ -17,12 +16,12 @@ use \Application\Interfaces\StructureAwareInterface;
*/
class Context extends AbstractService
{
- use Traits\EtablissementAwareTrait,
- Traits\AnneeAwareTrait,
- Traits\IntervenantAwareTrait,
- Traits\ParametresAwareTrait,
- Traits\StructureAwareTrait
- ;
+ use Traits\EtablissementAwareTrait;
+ use Traits\AnneeAwareTrait;
+ use Traits\IntervenantAwareTrait;
+ use Traits\ParametresAwareTrait;
+ use Traits\StructureAwareTrait;
+
/**
* selectedIdentityRole
diff --git a/module/Application/src/Application/Service/Indicateur/Contrat/AgrementCAMaisPasContratIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Contrat/AgrementCAMaisPasContratIndicateurImpl.php
index eebce4fd895df85eeb6dabbe4414982e2368bbda..8337485616320375c49ad34d3daa62a5f154f2f4 100644
--- a/module/Application/src/Application/Service/Indicateur/Contrat/AgrementCAMaisPasContratIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Contrat/AgrementCAMaisPasContratIndicateurImpl.php
@@ -39,9 +39,9 @@ class AgrementCAMaisPasContratIndicateurImpl extends AbstractIntervenantResultIn
protected function getQueryBuilder()
{
// INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.statut", "st", Join::WITH, "st.peutAvoirContrat = 1")
->join("int.agrement", "a")
diff --git a/module/Application/src/Application/Service/Indicateur/Contrat/AttenteAvenantIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Contrat/AttenteAvenantIndicateurImpl.php
index 1b609d4d7a969c1f1cf5cd04fe5075d8b4027f84..4f27fcb19ce4b04ad24b6e966e499f431871dc63 100644
--- a/module/Application/src/Application/Service/Indicateur/Contrat/AttenteAvenantIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Contrat/AttenteAvenantIndicateurImpl.php
@@ -39,9 +39,9 @@ class AttenteAvenantIndicateurImpl extends AbstractIntervenantResultIndicateurIm
protected function getQueryBuilder()
{
// INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.statut", "st", Join::WITH, "st.peutAvoirContrat = 1")
->join("int.service", "s")
diff --git a/module/Application/src/Application/Service/Indicateur/Contrat/AttenteContratIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Contrat/AttenteContratIndicateurImpl.php
index e0fb3ba1ecf72573855f7e0dd041ce9a9f2a3df8..44837d1fa469ef0278db8343fa0b45728083633e 100644
--- a/module/Application/src/Application/Service/Indicateur/Contrat/AttenteContratIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Contrat/AttenteContratIndicateurImpl.php
@@ -39,9 +39,9 @@ class AttenteContratIndicateurImpl extends AbstractIntervenantResultIndicateurIm
protected function getQueryBuilder()
{
// INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.statut", "st", Join::WITH, "st.peutAvoirContrat = 1")
->join("int.service", "s")
diff --git a/module/Application/src/Application/Service/Indicateur/Contrat/AttenteRetourContratIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Contrat/AttenteRetourContratIndicateurImpl.php
index 7455adb2f088ce9eb20c80bb5e68f26819ed6dde..3ddffb33d11ba54865e59fbe4719f92674438898 100644
--- a/module/Application/src/Application/Service/Indicateur/Contrat/AttenteRetourContratIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Contrat/AttenteRetourContratIndicateurImpl.php
@@ -69,7 +69,7 @@ class AttenteRetourContratIndicateurImpl extends AbstractIntervenantResultIndica
*/
protected function getQueryBuilder()
{
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.contrat", "c")
->andWhere("int.annee = :annee")
@@ -85,7 +85,7 @@ class AttenteRetourContratIndicateurImpl extends AbstractIntervenantResultIndica
protected function initQueryBuilder(QueryBuilder $qb)
{
// INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
$qb
->join("c.typeContrat", "tc", Join::WITH, "tc.code = :codeTypeContrat")
diff --git a/module/Application/src/Application/Service/Indicateur/Contrat/ContratAvenantDeposesIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Contrat/ContratAvenantDeposesIndicateurImpl.php
index a261bb7f5730d446fbfe7d1122db9361bed944f3..edee7be6680e81fa9893cfbc1be2b063a28a93e6 100644
--- a/module/Application/src/Application/Service/Indicateur/Contrat/ContratAvenantDeposesIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Contrat/ContratAvenantDeposesIndicateurImpl.php
@@ -138,10 +138,10 @@ class ContratAvenantDeposesIndicateurImpl extends AbstractIntervenantResultIndic
*/
protected function getQueryBuilder()
{
- // INDISPENSABLE si plusieurs requêtes successives sur IntervenantExterieur !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ // INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.contrat", "c", Join::WITH, "1 = pasHistorise(c)")
->join("c.fichier", "f", Join::WITH, "1 = pasHistorise(f)")
diff --git a/module/Application/src/Application/Service/Indicateur/Contrat/SaisieServiceApresContratAvenantIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Contrat/SaisieServiceApresContratAvenantIndicateurImpl.php
index 59eabf528190cf8a3fe8a4283ad2210742e209cf..08808bf263d8c73f6aafc28cc90c56a75bb844ef 100644
--- a/module/Application/src/Application/Service/Indicateur/Contrat/SaisieServiceApresContratAvenantIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Contrat/SaisieServiceApresContratAvenantIndicateurImpl.php
@@ -37,10 +37,10 @@ class SaisieServiceApresContratAvenantIndicateurImpl extends AbstractIntervenant
*/
protected function getQueryBuilder()
{
- // INDISPENSABLE si plusieurs requêtes successives sur IntervenantExterieur !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ // INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.contrat", "c")
->join("int.service", "s")
diff --git a/module/Application/src/Application/Service/Indicateur/Dossier/AttenteValidationDonneesPersoIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Dossier/AttenteValidationDonneesPersoIndicateurImpl.php
index 35a426c12bf8e806e33a0f7721e5a1d7047b547a..f822f0c50a5e8904cbd84cc72f44e14c768768be 100644
--- a/module/Application/src/Application/Service/Indicateur/Dossier/AttenteValidationDonneesPersoIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Dossier/AttenteValidationDonneesPersoIndicateurImpl.php
@@ -37,10 +37,10 @@ class AttenteValidationDonneesPersoIndicateurImpl extends AbstractIntervenantRes
*/
protected function getQueryBuilder()
{
- // INDISPENSABLE si plusieurs requêtes successives sur IntervenantExterieur !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ // INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.statut", "st", Join::WITH, "st.peutSaisirDossier = 1")
->andWhere("int.annee = :annee")
diff --git a/module/Application/src/Application/Service/Indicateur/Dossier/DonneesPersoDiffImportIndicateurImpl.php b/module/Application/src/Application/Service/Indicateur/Dossier/DonneesPersoDiffImportIndicateurImpl.php
index 605d82d5c810dd1a9f1435abe768628ac2a95166..b67e163f8ace4a63d0708979b58efea05c90f72d 100644
--- a/module/Application/src/Application/Service/Indicateur/Dossier/DonneesPersoDiffImportIndicateurImpl.php
+++ b/module/Application/src/Application/Service/Indicateur/Dossier/DonneesPersoDiffImportIndicateurImpl.php
@@ -35,10 +35,10 @@ class DonneesPersoDiffImportIndicateurImpl extends AbstractIntervenantResultIndi
*/
protected function getQueryBuilder()
{
- // INDISPENSABLE si plusieurs requêtes successives sur IntervenantExterieur !
- $this->getEntityManager()->clear('Application\Entity\Db\IntervenantExterieur');
+ // INDISPENSABLE si plusieurs requêtes successives sur Intervenant !
+ $this->getEntityManager()->clear('Application\Entity\Db\Intervenant');
- $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\IntervenantExterieur')->createQueryBuilder("int");
+ $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\Intervenant')->createQueryBuilder("int");
$qb
->join("int.statut", "st", Join::WITH, "st.peutSaisirDossier = 1")
->join("int.vIndicDiffDossier", "vidd")
diff --git a/module/Application/src/Application/Service/PieceJointe.php b/module/Application/src/Application/Service/PieceJointe.php
index 7d4fe9256619c1af871d02d2fc6723201a2875ea..dc1cbed643a0e6758104122589181bbd7c3cd4f2 100644
--- a/module/Application/src/Application/Service/PieceJointe.php
+++ b/module/Application/src/Application/Service/PieceJointe.php
@@ -6,7 +6,6 @@ use Doctrine\ORM\QueryBuilder;
use Application\Entity\Db\TypePieceJointe as TypePieceJointeEntity;
use Application\Entity\Db\PieceJointe as PieceJointeEntity;
use Application\Entity\Db\Fichier as FichierEntity;
-use Application\Entity\Db\IntervenantExterieur as IntervenantExterieurEntity;
use Application\Entity\Db\Intervenant as IntervenantEntity;
use Application\Entity\Db\TypeValidation as TypeValidationEntity;
use Application\Assertion\PieceJointeAssertion;
@@ -120,7 +119,7 @@ EOS;
* @param boolean $deleteFiles Supprimer les fichiers après création de la PJ$
* @return PieceJointeEntity[]
*/
- public function ajouterFichiers($files, IntervenantExterieurEntity $intervenant, TypePieceJointeEntity $type, $deleteFiles = true)
+ public function ajouterFichiers($files, IntervenantEntity $intervenant, TypePieceJointeEntity $type, $deleteFiles = true)
{
if (!$files) {
throw new \Common\Exception\LogicException("Aucune donnée sur les fichiers spécifiée.");
diff --git a/module/Application/src/Application/Service/Process/ContratProcess.php b/module/Application/src/Application/Service/Process/ContratProcess.php
index 413cedfcb848d5b5bc59a57b2522099817cf1dee..af7b0127e052c09ad6aec317c1f821573f9acd2d 100644
--- a/module/Application/src/Application/Service/Process/ContratProcess.php
+++ b/module/Application/src/Application/Service/Process/ContratProcess.php
@@ -2,22 +2,19 @@
namespace Application\Service\Process;
-use Application\Acl\ComposanteRole;
use Application\Entity\Db\TypeContrat;
use Application\Entity\Db\TypeValidation;
use Application\Rule\Intervenant\PeutCreerAvenantRule;
use Application\Rule\Intervenant\PeutCreerContratInitialRule;
use Application\Service\AbstractService;
-use Application\Service\Contrat as ContratService;
use Application\Traits\IntervenantAwareTrait;
-use Common\Exception\LogicException;
use Common\Exception\RuntimeException;
use Application\Entity\Db\Contrat;
/**
* Workflow de création des contrats et avenants.
*
- * @method \Application\Entity\Db\IntervenantExterieur getIntervenant() Description
+ * @method \Application\Entity\Db\Intervenant getIntervenant() Description
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class ContratProcess extends AbstractService
diff --git a/module/Application/src/Application/Service/Process/PieceJointeProcess.php b/module/Application/src/Application/Service/Process/PieceJointeProcess.php
index 4bbb9f8e4a34593b6556662ed8a4b3e95cca3c7c..d655500f3739e11af020eaabebb503559d47fa7b 100644
--- a/module/Application/src/Application/Service/Process/PieceJointeProcess.php
+++ b/module/Application/src/Application/Service/Process/PieceJointeProcess.php
@@ -3,7 +3,7 @@
namespace Application\Service\Process;
use Application\Entity\Db\Dossier;
-use Application\Entity\Db\IntervenantExterieur;
+use Application\Entity\Db\Intervenant;
use Application\Entity\Db\PieceJointe;
use Application\Entity\Db\StatutIntervenant;
use Application\Entity\Db\TypePieceJointe;
@@ -145,17 +145,17 @@ class PieceJointeProcess extends AbstractService
}
/**
- * @var IntervenantExterieur
+ * @var Intervenant
*/
private $intervenant;
/**
*
- * @param IntervenantExterieur $intervenant
+ * @param Intervenant $intervenant
* @return \Application\Service\DossierProcess
* @throws AucuneAFournirException
*/
- public function setIntervenant(IntervenantExterieur $intervenant)
+ public function setIntervenant(Intervenant $intervenant)
{
$this->intervenant = $intervenant;
@@ -174,7 +174,7 @@ class PieceJointeProcess extends AbstractService
}
/**
- * @return IntervenantExterieur
+ * @return Intervenant
*/
public function getIntervenant()
{
diff --git a/module/Application/src/Application/Service/ServiceService.php b/module/Application/src/Application/Service/ServiceService.php
index 7abde173ff9cd25e26ff4d10b5b77927b8929059..9487662d524abad6adefe5bd8abeb5845acbbea2 100644
--- a/module/Application/src/Application/Service/ServiceService.php
+++ b/module/Application/src/Application/Service/ServiceService.php
@@ -478,7 +478,7 @@ class ServiceService extends AbstractEntityService
/**
* Retourne la liste des services selon l'étape donnée
*
- * @param string $statutInterv "Application\Entity\Db\IntervenantPermanent" ou "Application\Entity\Db\IntervenantExterieur"
+ * @param TypeIntervenantEntity $typeIntervenant
* @param QueryBuilder|null $queryBuilder
*
* @return QueryBuilder
@@ -1250,7 +1250,7 @@ class ServiceService extends AbstractEntityService
public function canHaveMotifNonPaiement(ServiceEntity $service, $runEx = false)
{
- if ($service->getIntervenant() instanceof \Application\Entity\Db\IntervenantExterieur) {
+ if (!$service->getIntervenant()->estPermanent()) {
return $this->cannotDoThat("Un intervenant vacataire ne peut pas avoir de motif de non paiement", $runEx);
}
if ($this->getServiceContext()->getSelectedIdentityRole() instanceof \Application\Acl\IntervenantRole) {
diff --git a/module/Application/src/Application/Service/Workflow/Step/EditionContratStep.php b/module/Application/src/Application/Service/Workflow/Step/EditionContratStep.php
index 16918589e32d67c2a222680d0be13ed8ab120c73..23fe775faabaa2a3fde5e3300b7efcefc4418895 100644
--- a/module/Application/src/Application/Service/Workflow/Step/EditionContratStep.php
+++ b/module/Application/src/Application/Service/Workflow/Step/EditionContratStep.php
@@ -2,8 +2,6 @@
namespace Application\Service\Workflow\Step;
-use Application\Acl\IntervenantPermanentRole;
-use Application\Acl\IntervenantExterieurRole;
use Application\Acl\ComposanteRole;
use Application\Acl\IntervenantRole;
diff --git a/module/Application/src/Application/View/Helper/AppLink.php b/module/Application/src/Application/View/Helper/AppLink.php
index c79d4fdb26760960ff7f7da7453a77051c70f577..ce1470f6f6f96f61e72aa36bed2217e6a62c2bf3 100644
--- a/module/Application/src/Application/View/Helper/AppLink.php
+++ b/module/Application/src/Application/View/Helper/AppLink.php
@@ -1,6 +1,7 @@
<?php
namespace Application\View\Helper;
+use Application\Entity\Db\Traits\AnneeAwareTrait;
use Zend\I18n\View\Helper\AbstractTranslatorHelper;
use Zend\Mvc\Router\RouteMatch;
use Zend\Mvc\Router\RouteStackInterface;
@@ -19,7 +20,7 @@ use Zend\Form\Element\Select;
*/
class AppLink extends AbstractTranslatorHelper
{
- use \Application\Traits\AnneeAwareTrait;
+ use AnneeAwareTrait;
/**
* @var string
diff --git a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php
index 576a054247a8233e0152507b5e52f5e54607b3eb..28354d4070db23c978f223be2d0a11c2e63fc3b7 100644
--- a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php
+++ b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php
@@ -85,7 +85,7 @@ class IntervenantViewHelper extends AbstractHtmlElement
];
/* @deprecated en attendant la fusion des types d'intervenants... */
- if ($entity instanceof \Application\Entity\Db\IntervenantExterieur) {
+ if (!$entity->estPermanent()) {
$vars['identite']['Situation familiale'] = $entity->getSituationFamiliale() ?: "(Inconnue)";
}
diff --git a/module/Application/view/application/index/index.phtml b/module/Application/view/application/index/index.phtml
index d66f10c482e62f4f51131ba59389e8c90cf2502a..df11c597d706800d85bdfbc88699ef18331cc713 100755
--- a/module/Application/view/application/index/index.phtml
+++ b/module/Application/view/application/index/index.phtml
@@ -29,7 +29,7 @@ echo $this->messenger()->addMessagesFromFlashMessenger();
$wf = $this->workflow($intervenant, $role)->getWorkflow();
if ($wf->getSteps()) {
$step = $wf->getCurrentStep() ?: $wf->getLastStep();
- /* @var $wf \Application\Service\Workflow\WorkflowIntervenantExterieur */
+ /* @var $wf \Application\Service\Workflow\WorkflowIntervenant */
$url = $wf->getStepUrl($step);
$label = $this->translate($step->getLabel($role));
diff --git a/module/Common/src/Common/ORM/Filter/AnneeFilter.php b/module/Common/src/Common/ORM/Filter/AnneeFilter.php
index 926c60545feb5c401649d57ee914ec7bfd743102..56202f5f66e8394fc7f434e0b3bad3f4954ce54b 100644
--- a/module/Common/src/Common/ORM/Filter/AnneeFilter.php
+++ b/module/Common/src/Common/ORM/Filter/AnneeFilter.php
@@ -2,6 +2,8 @@
namespace Common\ORM\Filter;
+use Application\Entity\Db\Etape;
+use Application\Entity\Db\Interfaces\AnneeAwareInterface;
use Application\Service\Traits\ContextAwareTrait;
use Doctrine\ORM\Mapping\ClassMetaData;
use Application\Entity\Db\Annee;
@@ -22,9 +24,9 @@ class AnneeFilter extends AbstractFilter
public function addFilterConstraint(ClassMetaData $targetEntity, $targetTableAlias)
{
if (isset($this->enabledEntities[$targetEntity->name])) {
- if ($targetEntity->name == Application\Entity\Db\Etape::class) {
+ if ($targetEntity->name == Etape::class) {
return $this->addEtapeFilterConstraint($targetTableAlias);
- } elseif ($targetEntity->reflClass->implementsInterface(Application\Entity\Db\Interfaces\AnneeAwareInterface::class)) {
+ } elseif ($targetEntity->reflClass->implementsInterface(AnneeAwareInterface::class)) {
return $targetTableAlias . '.ANNEE_ID = ' . $this->getServiceContext()->getAnnee()->getId();
}
}
diff --git a/tests/OSETest/Rule/AgrementFourniRuleTest.php b/tests/OSETest/Rule/AgrementFourniRuleTest.php
index 631c7947f1258feb77699aeaa4ad0211a2191063..685141b4906b778f7cb8a2d5485bd60e9c06d787 100644
--- a/tests/OSETest/Rule/AgrementFourniRuleTest.php
+++ b/tests/OSETest/Rule/AgrementFourniRuleTest.php
@@ -3,8 +3,6 @@
namespace OSETest\Rule;
use Application\Entity\Db\Intervenant;
-use Application\Entity\Db\IntervenantExterieur;
-use Application\Entity\Db\IntervenantPermanent;
use Application\Entity\Db\StatutIntervenant;
use Application\Entity\Db\TypeAgrement;
use Application\Entity\Db\TypeAgrementStatut;
@@ -27,12 +25,12 @@ class AgrementFourniRuleTest extends BaseRuleTest
protected $rule;
/**
- * @var IntervenantExterieur
+ * @var Intervenant
*/
private $ie;
/**
- * @var IntervenantPermanent
+ * @var Intervenant
*/
private $ip;