From d52ea6f9b4e035e321ac7b7806d86ea83723c18e Mon Sep 17 00:00:00 2001 From: gauthierb <gauthierb@d57fa8bc-6af1-4de9-8b7d-78e900e231e7> Date: Fri, 12 Sep 2014 09:32:09 +0000 Subject: [PATCH] =?UTF-8?q?Agr=C3=A9ment=20Conseil=20Acad=C3=A9mique=20:?= =?UTF-8?q?=20ce=20sont=20les=20Administrateurs=20qui=20le=20saisisse=20et?= =?UTF-8?q?=20plus=20les=20gestionnaires=20de=20composante=20;=20plus=20au?= =?UTF-8?q?cune=20structure=20associ=C3=A9=20=C3=A0=20l'agr=C3=A9ment.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__CG__ApplicationEntityDbAgrement.php | 477 ++++++++++++++++++ ...pplicationEntityDbIntervenantExterieur.php | 43 +- .../__CG__ApplicationEntityDbStructure.php | 37 +- .../__CG__ApplicationEntityDbTypeAgrement.php | 11 + ..._ApplicationEntityDbTypeAgrementStatut.php | 466 +++++++++++++++++ ...plicationEntityDbTypePieceJointeStatut.php | 60 +-- module/Application/config/agrement.config.php | 4 +- .../Controller/AgrementController.php | 78 +-- .../Application.Entity.Db.Structure.dcm.xml | 1 + .../src/Application/Entity/Db/Structure.php | 38 ++ .../Application/Entity/Db/TypeAgrement.php | 25 + .../Provider/Role/RoleProvider.php | 2 + .../Rule/Intervenant/AgrementFourniRule.php | 52 +- .../Service/Assertion/AgrementAssertion.php | 45 +- .../view/application/agrement/lister.phtml | 6 +- 15 files changed, 1225 insertions(+), 120 deletions(-) create mode 100644 data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbAgrement.php create mode 100644 data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrementStatut.php diff --git a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbAgrement.php b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbAgrement.php new file mode 100644 index 0000000000..6eba73d99b --- /dev/null +++ b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbAgrement.php @@ -0,0 +1,477 @@ +<?php + +namespace DoctrineORMModule\Proxy\__CG__\Application\Entity\Db; + +/** + * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR + */ +class Agrement extends \Application\Entity\Db\Agrement implements \Doctrine\ORM\Proxy\Proxy +{ + /** + * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with + * three parameters, being respectively the proxy object to be initialized, the method that triggered the + * initialization process and an array of ordered parameters that were passed to that method. + * + * @see \Doctrine\Common\Persistence\Proxy::__setInitializer + */ + public $__initializer__; + + /** + * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object + * + * @see \Doctrine\Common\Persistence\Proxy::__setCloner + */ + public $__cloner__; + + /** + * @var boolean flag indicating if this object was already initialized + * + * @see \Doctrine\Common\Persistence\Proxy::__isInitialized + */ + public $__isInitialized__ = false; + + /** + * @var array properties to be lazy loaded, with keys being the property + * names and values being their default values + * + * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties + */ + public static $lazyPropertiesDefaults = array(); + + + + /** + * @param \Closure $initializer + * @param \Closure $cloner + */ + public function __construct($initializer = null, $cloner = null) + { + + $this->__initializer__ = $initializer; + $this->__cloner__ = $cloner; + } + + + + + + + + /** + * + * @return array + */ + public function __sleep() + { + if ($this->__isInitialized__) { + return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'url', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'dateDecision', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'intervenant', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'structure', 'annee'); + } + + return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'url', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'dateDecision', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'intervenant', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\Agrement' . "\0" . 'structure', 'annee'); + } + + /** + * + */ + public function __wakeup() + { + if ( ! $this->__isInitialized__) { + $this->__initializer__ = function (Agrement $proxy) { + $proxy->__setInitializer(null); + $proxy->__setCloner(null); + + $existingProperties = get_object_vars($proxy); + + foreach ($proxy->__getLazyProperties() as $property => $defaultValue) { + if ( ! array_key_exists($property, $existingProperties)) { + $proxy->$property = $defaultValue; + } + } + }; + + } + } + + /** + * + */ + public function __clone() + { + $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', array()); + } + + /** + * Forces initialization of the proxy + */ + public function __load() + { + $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', array()); + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setInitialized($initialized) + { + $this->__isInitialized__ = $initialized; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setInitializer(\Closure $initializer = null) + { + $this->__initializer__ = $initializer; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __getInitializer() + { + return $this->__initializer__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setCloner(\Closure $cloner = null) + { + $this->__cloner__ = $cloner; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific cloning logic + */ + public function __getCloner() + { + return $this->__cloner__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + * @static + */ + public function __getLazyProperties() + { + return self::$lazyPropertiesDefaults; + } + + + /** + * {@inheritDoc} + */ + public function setHistoCreation($histoCreation) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoCreation', array($histoCreation)); + + return parent::setHistoCreation($histoCreation); + } + + /** + * {@inheritDoc} + */ + public function getHistoCreation() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoCreation', array()); + + return parent::getHistoCreation(); + } + + /** + * {@inheritDoc} + */ + public function setHistoDestruction($histoDestruction) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoDestruction', array($histoDestruction)); + + return parent::setHistoDestruction($histoDestruction); + } + + /** + * {@inheritDoc} + */ + public function getHistoDestruction() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoDestruction', array()); + + return parent::getHistoDestruction(); + } + + /** + * {@inheritDoc} + */ + public function setHistoModification($histoModification) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoModification', array($histoModification)); + + return parent::setHistoModification($histoModification); + } + + /** + * {@inheritDoc} + */ + public function getHistoModification() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoModification', array()); + + return parent::getHistoModification(); + } + + /** + * {@inheritDoc} + */ + public function setUrl($url) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUrl', array($url)); + + return parent::setUrl($url); + } + + /** + * {@inheritDoc} + */ + public function getUrl() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUrl', array()); + + return parent::getUrl(); + } + + /** + * {@inheritDoc} + */ + public function setDateDecision($dateDecision) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDateDecision', array($dateDecision)); + + return parent::setDateDecision($dateDecision); + } + + /** + * {@inheritDoc} + */ + public function getDateDecision() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDateDecision', array()); + + return parent::getDateDecision(); + } + + /** + * {@inheritDoc} + */ + public function getId() + { + if ($this->__isInitialized__ === false) { + return (int) parent::getId(); + } + + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array()); + + return parent::getId(); + } + + /** + * {@inheritDoc} + */ + public function setType(\Application\Entity\Db\TypeAgrement $type = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setType', array($type)); + + return parent::setType($type); + } + + /** + * {@inheritDoc} + */ + public function getType() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getType', array()); + + return parent::getType(); + } + + /** + * {@inheritDoc} + */ + public function setIntervenant(\Application\Entity\Db\Intervenant $intervenant = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setIntervenant', array($intervenant)); + + return parent::setIntervenant($intervenant); + } + + /** + * {@inheritDoc} + */ + public function getIntervenant() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getIntervenant', array()); + + return parent::getIntervenant(); + } + + /** + * {@inheritDoc} + */ + public function setHistoModificateur(\Application\Entity\Db\Utilisateur $histoModificateur = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoModificateur', array($histoModificateur)); + + return parent::setHistoModificateur($histoModificateur); + } + + /** + * {@inheritDoc} + */ + public function getHistoModificateur() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoModificateur', array()); + + return parent::getHistoModificateur(); + } + + /** + * {@inheritDoc} + */ + public function setHistoDestructeur(\Application\Entity\Db\Utilisateur $histoDestructeur = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoDestructeur', array($histoDestructeur)); + + return parent::setHistoDestructeur($histoDestructeur); + } + + /** + * {@inheritDoc} + */ + public function getHistoDestructeur() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoDestructeur', array()); + + return parent::getHistoDestructeur(); + } + + /** + * {@inheritDoc} + */ + public function setHistoCreateur(\Application\Entity\Db\Utilisateur $histoCreateur = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoCreateur', array($histoCreateur)); + + return parent::setHistoCreateur($histoCreateur); + } + + /** + * {@inheritDoc} + */ + public function getHistoCreateur() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoCreateur', array()); + + return parent::getHistoCreateur(); + } + + /** + * {@inheritDoc} + */ + public function setStructure(\Application\Entity\Db\Structure $structure = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setStructure', array($structure)); + + return parent::setStructure($structure); + } + + /** + * {@inheritDoc} + */ + public function getStructure() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getStructure', array()); + + return parent::getStructure(); + } + + /** + * {@inheritDoc} + */ + public function setAnnee(\Application\Entity\Db\Annee $annee = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setAnnee', array($annee)); + + return parent::setAnnee($annee); + } + + /** + * {@inheritDoc} + */ + public function getAnnee() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getAnnee', array()); + + return parent::getAnnee(); + } + + /** + * {@inheritDoc} + */ + public function __toString() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, '__toString', array()); + + return parent::__toString(); + } + + /** + * {@inheritDoc} + */ + public function getResourceId() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getResourceId', array()); + + return parent::getResourceId(); + } + +} diff --git a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbIntervenantExterieur.php b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbIntervenantExterieur.php index 692a3f954d..22182b6d98 100644 --- a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbIntervenantExterieur.php +++ b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbIntervenantExterieur.php @@ -64,10 +64,10 @@ class IntervenantExterieur extends \Application\Entity\Db\IntervenantExterieur i public function __sleep() { if ($this->__isInitialized__) { - return array('__isInitialized__', 'validiteDebut', 'validiteFin', 'typePoste', 'regimeSecu', 'typeIntervenantExterieur', 'situationFamiliale', 'dossier', 'contrat', 'dateNaissance', 'depNaissanceCodeInsee', 'depNaissanceLibelle', 'email', 'histoCreation', 'histoDestruction', 'histoModification', 'nomPatronymique', 'nomUsuel', 'numeroInsee', 'numeroInseeCle', 'numeroInseeProvisoire', 'paysNaissanceCodeInsee', 'paysNaissanceLibelle', 'paysNationaliteCodeInsee', 'paysNationaliteLibelle', 'prenom', 'primeExcellenceScient', 'sourceCode', 'telMobile', 'telPro', 'villeNaissanceCodeInsee', 'villeNaissanceLibelle', 'id', 'affectation', 'adresse', 'source', 'statut', 'structure', 'discipline', 'civilite', 'BIC', 'IBAN', 'histoDestructeur', 'histoModificateur', 'histoCreateur', 'type', 'service', 'validation'); + return array('__isInitialized__', 'validiteDebut', 'validiteFin', 'typePoste', 'regimeSecu', 'typeIntervenantExterieur', 'situationFamiliale', 'dossier', 'contrat', 'dateNaissance', 'depNaissanceCodeInsee', 'depNaissanceLibelle', 'email', 'histoCreation', 'histoDestruction', 'histoModification', 'nomPatronymique', 'nomUsuel', 'numeroInsee', 'numeroInseeCle', 'numeroInseeProvisoire', 'paysNaissanceCodeInsee', 'paysNaissanceLibelle', 'paysNationaliteCodeInsee', 'paysNationaliteLibelle', 'prenom', 'primeExcellenceScient', 'sourceCode', 'telMobile', 'telPro', 'villeNaissanceCodeInsee', 'villeNaissanceLibelle', 'id', 'affectation', 'adresse', 'source', 'statut', 'structure', 'discipline', 'civilite', 'BIC', 'IBAN', 'histoDestructeur', 'histoModificateur', 'histoCreateur', 'type', 'service', 'validation', 'agrement'); } - return array('__isInitialized__', 'validiteDebut', 'validiteFin', 'typePoste', 'regimeSecu', 'typeIntervenantExterieur', 'situationFamiliale', 'dossier', 'contrat', 'dateNaissance', 'depNaissanceCodeInsee', 'depNaissanceLibelle', 'email', 'histoCreation', 'histoDestruction', 'histoModification', 'nomPatronymique', 'nomUsuel', 'numeroInsee', 'numeroInseeCle', 'numeroInseeProvisoire', 'paysNaissanceCodeInsee', 'paysNaissanceLibelle', 'paysNationaliteCodeInsee', 'paysNationaliteLibelle', 'prenom', 'primeExcellenceScient', 'sourceCode', 'telMobile', 'telPro', 'villeNaissanceCodeInsee', 'villeNaissanceLibelle', 'id', 'affectation', 'adresse', 'source', 'statut', 'structure', 'discipline', 'civilite', 'BIC', 'IBAN', 'histoDestructeur', 'histoModificateur', 'histoCreateur', 'type', 'service', 'validation'); + return array('__isInitialized__', 'validiteDebut', 'validiteFin', 'typePoste', 'regimeSecu', 'typeIntervenantExterieur', 'situationFamiliale', 'dossier', 'contrat', 'dateNaissance', 'depNaissanceCodeInsee', 'depNaissanceLibelle', 'email', 'histoCreation', 'histoDestruction', 'histoModification', 'nomPatronymique', 'nomUsuel', 'numeroInsee', 'numeroInseeCle', 'numeroInseeProvisoire', 'paysNaissanceCodeInsee', 'paysNaissanceLibelle', 'paysNationaliteCodeInsee', 'paysNationaliteLibelle', 'prenom', 'primeExcellenceScient', 'sourceCode', 'telMobile', 'telPro', 'villeNaissanceCodeInsee', 'villeNaissanceLibelle', 'id', 'affectation', 'adresse', 'source', 'statut', 'structure', 'discipline', 'civilite', 'BIC', 'IBAN', 'histoDestructeur', 'histoModificateur', 'histoCreateur', 'type', 'service', 'validation', 'agrement'); } /** @@ -352,12 +352,12 @@ class IntervenantExterieur extends \Application\Entity\Db\IntervenantExterieur i /** * {@inheritDoc} */ - public function getContrat() + public function getContrat(\Application\Entity\Db\TypeContrat $typeContrat = NULL, \Application\Entity\Db\Structure $structure = NULL, \Application\Entity\Db\Annee $annee = NULL) { - $this->__initializer__ && $this->__initializer__->__invoke($this, 'getContrat', array()); + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getContrat', array($typeContrat, $structure, $annee)); - return parent::getContrat(); + return parent::getContrat($typeContrat, $structure, $annee); } /** @@ -1255,6 +1255,39 @@ class IntervenantExterieur extends \Application\Entity\Db\IntervenantExterieur i return parent::getValidation($type); } + /** + * {@inheritDoc} + */ + public function addAgrement(\Application\Entity\Db\Agrement $agrement) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'addAgrement', array($agrement)); + + return parent::addAgrement($agrement); + } + + /** + * {@inheritDoc} + */ + public function removeAgrement(\Application\Entity\Db\Agrement $agrement) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeAgrement', array($agrement)); + + return parent::removeAgrement($agrement); + } + + /** + * {@inheritDoc} + */ + public function getAgrement(\Application\Entity\Db\TypeAgrement $typeAgrement = NULL, \Application\Entity\Db\Annee $annee = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getAgrement', array($typeAgrement, $annee)); + + return parent::getAgrement($typeAgrement, $annee); + } + /** * {@inheritDoc} */ diff --git a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbStructure.php b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbStructure.php index ada5c808f7..907e72c603 100644 --- a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbStructure.php +++ b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbStructure.php @@ -64,10 +64,10 @@ class Structure extends \Application\Entity\Db\Structure implements \Doctrine\OR public function __sleep() { if ($this->__isInitialized__) { - return array('__isInitialized__', 'histoCreation', 'histoDestruction', 'histoModification', 'libelleCourt', 'libelleLong', 'niveau', 'sourceCode', 'contactPj', 'validiteDebut', 'validiteFin', 'id', 'source', 'type', 'histoModificateur', 'histoDestructeur', 'etablissement', 'histoCreateur', 'parente', 'structureNiv2', 'elementPedagogique'); + return array('__isInitialized__', 'histoCreation', 'histoDestruction', 'histoModification', 'libelleCourt', 'libelleLong', 'niveau', 'sourceCode', 'contactPj', 'validiteDebut', 'validiteFin', 'id', 'source', 'type', 'histoModificateur', 'histoDestructeur', 'etablissement', 'histoCreateur', 'parente', 'structureNiv2', 'elementPedagogique', 'service'); } - return array('__isInitialized__', 'histoCreation', 'histoDestruction', 'histoModification', 'libelleCourt', 'libelleLong', 'niveau', 'sourceCode', 'contactPj', 'validiteDebut', 'validiteFin', 'id', 'source', 'type', 'histoModificateur', 'histoDestructeur', 'etablissement', 'histoCreateur', 'parente', 'structureNiv2', 'elementPedagogique'); + return array('__isInitialized__', 'histoCreation', 'histoDestruction', 'histoModification', 'libelleCourt', 'libelleLong', 'niveau', 'sourceCode', 'contactPj', 'validiteDebut', 'validiteFin', 'id', 'source', 'type', 'histoModificateur', 'histoDestructeur', 'etablissement', 'histoCreateur', 'parente', 'structureNiv2', 'elementPedagogique', 'service'); } /** @@ -617,6 +617,39 @@ class Structure extends \Application\Entity\Db\Structure implements \Doctrine\OR return parent::getElementPedagogique(); } + /** + * {@inheritDoc} + */ + public function addService(\Application\Entity\Db\Service $service) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'addService', array($service)); + + return parent::addService($service); + } + + /** + * {@inheritDoc} + */ + public function removeService(\Application\Entity\Db\Service $service) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeService', array($service)); + + return parent::removeService($service); + } + + /** + * {@inheritDoc} + */ + public function getService() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getService', array()); + + return parent::getService(); + } + /** * {@inheritDoc} */ diff --git a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrement.php b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrement.php index ed27d14dfb..159e66f511 100644 --- a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrement.php +++ b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrement.php @@ -375,4 +375,15 @@ class TypeAgrement extends \Application\Entity\Db\TypeAgrement implements \Doctr return parent::__toString(); } + /** + * {@inheritDoc} + */ + public function __call($name, $arguments) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, '__call', array($name, $arguments)); + + return parent::__call($name, $arguments); + } + } diff --git a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrementStatut.php b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrementStatut.php new file mode 100644 index 0000000000..14acad394a --- /dev/null +++ b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypeAgrementStatut.php @@ -0,0 +1,466 @@ +<?php + +namespace DoctrineORMModule\Proxy\__CG__\Application\Entity\Db; + +/** + * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR + */ +class TypeAgrementStatut extends \Application\Entity\Db\TypeAgrementStatut implements \Doctrine\ORM\Proxy\Proxy +{ + /** + * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with + * three parameters, being respectively the proxy object to be initialized, the method that triggered the + * initialization process and an array of ordered parameters that were passed to that method. + * + * @see \Doctrine\Common\Persistence\Proxy::__setInitializer + */ + public $__initializer__; + + /** + * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object + * + * @see \Doctrine\Common\Persistence\Proxy::__setCloner + */ + public $__cloner__; + + /** + * @var boolean flag indicating if this object was already initialized + * + * @see \Doctrine\Common\Persistence\Proxy::__isInitialized + */ + public $__isInitialized__ = false; + + /** + * @var array properties to be lazy loaded, with keys being the property + * names and values being their default values + * + * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties + */ + public static $lazyPropertiesDefaults = array(); + + + + /** + * @param \Closure $initializer + * @param \Closure $cloner + */ + public function __construct($initializer = null, $cloner = null) + { + + $this->__initializer__ = $initializer; + $this->__cloner__ = $cloner; + } + + + + + + + + /** + * + * @return array + */ + public function __sleep() + { + if ($this->__isInitialized__) { + return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'premierRecrutement', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'statut', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'obligatoire', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'seuilHetd'); + } + + return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'premierRecrutement', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'statut', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'obligatoire', '' . "\0" . 'Application\\Entity\\Db\\TypeAgrementStatut' . "\0" . 'seuilHetd'); + } + + /** + * + */ + public function __wakeup() + { + if ( ! $this->__isInitialized__) { + $this->__initializer__ = function (TypeAgrementStatut $proxy) { + $proxy->__setInitializer(null); + $proxy->__setCloner(null); + + $existingProperties = get_object_vars($proxy); + + foreach ($proxy->__getLazyProperties() as $property => $defaultValue) { + if ( ! array_key_exists($property, $existingProperties)) { + $proxy->$property = $defaultValue; + } + } + }; + + } + } + + /** + * + */ + public function __clone() + { + $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', array()); + } + + /** + * Forces initialization of the proxy + */ + public function __load() + { + $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', array()); + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setInitialized($initialized) + { + $this->__isInitialized__ = $initialized; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setInitializer(\Closure $initializer = null) + { + $this->__initializer__ = $initializer; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __getInitializer() + { + return $this->__initializer__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + */ + public function __setCloner(\Closure $cloner = null) + { + $this->__cloner__ = $cloner; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific cloning logic + */ + public function __getCloner() + { + return $this->__cloner__; + } + + /** + * {@inheritDoc} + * @internal generated method: use only when explicitly handling proxy specific loading logic + * @static + */ + public function __getLazyProperties() + { + return self::$lazyPropertiesDefaults; + } + + + /** + * {@inheritDoc} + */ + public function setHistoCreation($histoCreation) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoCreation', array($histoCreation)); + + return parent::setHistoCreation($histoCreation); + } + + /** + * {@inheritDoc} + */ + public function getHistoCreation() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoCreation', array()); + + return parent::getHistoCreation(); + } + + /** + * {@inheritDoc} + */ + public function setHistoDestruction($histoDestruction) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoDestruction', array($histoDestruction)); + + return parent::setHistoDestruction($histoDestruction); + } + + /** + * {@inheritDoc} + */ + public function getHistoDestruction() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoDestruction', array()); + + return parent::getHistoDestruction(); + } + + /** + * {@inheritDoc} + */ + public function setHistoModification($histoModification) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoModification', array($histoModification)); + + return parent::setHistoModification($histoModification); + } + + /** + * {@inheritDoc} + */ + public function getHistoModification() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoModification', array()); + + return parent::getHistoModification(); + } + + /** + * {@inheritDoc} + */ + public function setPremierRecrutement($premierRecrutement) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setPremierRecrutement', array($premierRecrutement)); + + return parent::setPremierRecrutement($premierRecrutement); + } + + /** + * {@inheritDoc} + */ + public function getPremierRecrutement() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPremierRecrutement', array()); + + return parent::getPremierRecrutement(); + } + + /** + * {@inheritDoc} + */ + public function setObligatoire($obligatoire) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setObligatoire', array($obligatoire)); + + return parent::setObligatoire($obligatoire); + } + + /** + * {@inheritDoc} + */ + public function setSeuilHetd($seuilHetd) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSeuilHetd', array($seuilHetd)); + + return parent::setSeuilHetd($seuilHetd); + } + + /** + * {@inheritDoc} + */ + public function getId() + { + if ($this->__isInitialized__ === false) { + return (int) parent::getId(); + } + + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array()); + + return parent::getId(); + } + + /** + * {@inheritDoc} + */ + public function setHistoModificateur(\Application\Entity\Db\Utilisateur $histoModificateur = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoModificateur', array($histoModificateur)); + + return parent::setHistoModificateur($histoModificateur); + } + + /** + * {@inheritDoc} + */ + public function getHistoModificateur() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoModificateur', array()); + + return parent::getHistoModificateur(); + } + + /** + * {@inheritDoc} + */ + public function setHistoDestructeur(\Application\Entity\Db\Utilisateur $histoDestructeur = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoDestructeur', array($histoDestructeur)); + + return parent::setHistoDestructeur($histoDestructeur); + } + + /** + * {@inheritDoc} + */ + public function getHistoDestructeur() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoDestructeur', array()); + + return parent::getHistoDestructeur(); + } + + /** + * {@inheritDoc} + */ + public function setHistoCreateur(\Application\Entity\Db\Utilisateur $histoCreateur = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setHistoCreateur', array($histoCreateur)); + + return parent::setHistoCreateur($histoCreateur); + } + + /** + * {@inheritDoc} + */ + public function getHistoCreateur() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getHistoCreateur', array()); + + return parent::getHistoCreateur(); + } + + /** + * {@inheritDoc} + */ + public function setType(\Application\Entity\Db\TypeAgrement $type = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setType', array($type)); + + return parent::setType($type); + } + + /** + * {@inheritDoc} + */ + public function getType() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getType', array()); + + return parent::getType(); + } + + /** + * {@inheritDoc} + */ + public function setStatut(\Application\Entity\Db\StatutIntervenant $statut = NULL) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'setStatut', array($statut)); + + return parent::setStatut($statut); + } + + /** + * {@inheritDoc} + */ + public function getStatut() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getStatut', array()); + + return parent::getStatut(); + } + + /** + * {@inheritDoc} + */ + public function getObligatoire() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getObligatoire', array()); + + return parent::getObligatoire(); + } + + /** + * {@inheritDoc} + */ + public function getSeuilHetd() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSeuilHetd', array()); + + return parent::getSeuilHetd(); + } + + /** + * {@inheritDoc} + */ + public function isObligatoire($totalHETDIntervenant) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'isObligatoire', array($totalHETDIntervenant)); + + return parent::isObligatoire($totalHETDIntervenant); + } + + /** + * {@inheritDoc} + */ + public function getObligatoireToString($totalHETDIntervenant) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getObligatoireToString', array($totalHETDIntervenant)); + + return parent::getObligatoireToString($totalHETDIntervenant); + } + + /** + * {@inheritDoc} + */ + public function isSeuilHETDDepasse($totalHETDIntervenant) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'isSeuilHETDDepasse', array($totalHETDIntervenant)); + + return parent::isSeuilHETDDepasse($totalHETDIntervenant); + } + +} diff --git a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypePieceJointeStatut.php b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypePieceJointeStatut.php index 90acc91b2f..bcb33485c6 100644 --- a/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypePieceJointeStatut.php +++ b/data/DoctrineORMModule/Proxy/__CG__ApplicationEntityDbTypePieceJointeStatut.php @@ -64,10 +64,10 @@ class TypePieceJointeStatut extends \Application\Entity\Db\TypePieceJointeStatut public function __sleep() { if ($this->__isInitialized__) { - return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'premierRecrutement', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'obligatoire', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'seuilHetd', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteDebut', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteFin', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'statut'); + return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'premierRecrutement', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteDebut', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteFin', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'statut', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'obligatoire', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'seuilHetd'); } - return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'premierRecrutement', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'obligatoire', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'seuilHetd', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteDebut', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteFin', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'statut'); + return array('__isInitialized__', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreation', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestruction', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModification', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'premierRecrutement', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteDebut', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'validiteFin', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'id', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoModificateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoDestructeur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'histoCreateur', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'type', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'statut', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'obligatoire', '' . "\0" . 'Application\\Entity\\Db\\TypePieceJointeStatut' . "\0" . 'seuilHetd'); } /** @@ -272,17 +272,6 @@ class TypePieceJointeStatut extends \Application\Entity\Db\TypePieceJointeStatut return parent::setObligatoire($obligatoire); } - /** - * {@inheritDoc} - */ - public function getObligatoire() - { - - $this->__initializer__ && $this->__initializer__->__invoke($this, 'getObligatoire', array()); - - return parent::getObligatoire(); - } - /** * {@inheritDoc} */ @@ -294,17 +283,6 @@ class TypePieceJointeStatut extends \Application\Entity\Db\TypePieceJointeStatut return parent::setSeuilHetd($seuilHetd); } - /** - * {@inheritDoc} - */ - public function getSeuilHetd() - { - - $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSeuilHetd', array()); - - return parent::getSeuilHetd(); - } - /** * {@inheritDoc} */ @@ -477,23 +455,45 @@ class TypePieceJointeStatut extends \Application\Entity\Db\TypePieceJointeStatut /** * {@inheritDoc} */ - public function isObligatoire($totalHETDIntervenant) + public function getObligatoireToString($totalHETDIntervenant) { - $this->__initializer__ && $this->__initializer__->__invoke($this, 'isObligatoire', array($totalHETDIntervenant)); + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getObligatoireToString', array($totalHETDIntervenant)); - return parent::isObligatoire($totalHETDIntervenant); + return parent::getObligatoireToString($totalHETDIntervenant); } /** * {@inheritDoc} */ - public function getObligatoireToString($totalHETDIntervenant) + public function getObligatoire() { - $this->__initializer__ && $this->__initializer__->__invoke($this, 'getObligatoireToString', array($totalHETDIntervenant)); + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getObligatoire', array()); - return parent::getObligatoireToString($totalHETDIntervenant); + return parent::getObligatoire(); + } + + /** + * {@inheritDoc} + */ + public function getSeuilHetd() + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSeuilHetd', array()); + + return parent::getSeuilHetd(); + } + + /** + * {@inheritDoc} + */ + public function isObligatoire($totalHETDIntervenant) + { + + $this->__initializer__ && $this->__initializer__->__invoke($this, 'isObligatoire', array($totalHETDIntervenant)); + + return parent::isObligatoire($totalHETDIntervenant); } /** diff --git a/module/Application/config/agrement.config.php b/module/Application/config/agrement.config.php index 15b1706146..fa68490c53 100644 --- a/module/Application/config/agrement.config.php +++ b/module/Application/config/agrement.config.php @@ -63,7 +63,7 @@ return array( 'voir-str' => array( 'type' => 'Segment', 'options' => array( - 'route' => '/:typeAgrement/voir-str/:structure', + 'route' => '/:typeAgrement/voir-str[/:structure]', 'constraints' => array( 'typeAgrement' => '[0-9]*', 'structure' => '[0-9]*', @@ -205,7 +205,7 @@ return array( 'BjyAuthorize\Provider\Rule\Config' => array( 'allow' => array( array( - array(ComposanteRole::ROLE_ID), + array(ComposanteRole::ROLE_ID, 'Administrateur'), 'Agrement', array('create', 'read', 'delete', 'update'), 'AgrementAssertion', diff --git a/module/Application/src/Application/Controller/AgrementController.php b/module/Application/src/Application/Controller/AgrementController.php index 5cf2b75144..fd6aa4c660 100644 --- a/module/Application/src/Application/Controller/AgrementController.php +++ b/module/Application/src/Application/Controller/AgrementController.php @@ -109,7 +109,7 @@ implements ContextProviderAwareInterface, ->setIntervenant($this->intervenant) ->setTypeAgrement($this->typeAgrement)/* ->execute()*/; - + /** * Il y a un Conseil Restreint par structure d'enseignement */ @@ -122,10 +122,12 @@ implements ContextProviderAwareInterface, * Il y a un seul Conseil Academique pour toutes les structures d'enseignement */ elseif ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_ACADEMIQUE) { - $structureEns = $this->intervenant->getStructure()->getParenteNiv2(); - $structures = [ $structureEns->getId() => $structureEns]; - $messages[] = sprintf("Est attendu un seul agrément « %s » par la composante d'enseignement « %s ».", - $this->typeAgrement, $structureEns); +// $structureEns = $this->intervenant->getStructure()->getParenteNiv2(); +// $structures = [ $structureEns->getId() => $structureEns]; +// $messages[] = sprintf("Est attendu un seul agrément « %s » par la composante d'enseignement « %s ».", +// $this->typeAgrement, $structureEns); + $structures = [ null ]; + $messages[] = sprintf("Est attendu un seul agrément « %s ».", $this->typeAgrement); } else { throw new LogicException("Type d'agrément inattendu!"); @@ -142,8 +144,7 @@ implements ContextProviderAwareInterface, // instanciation d'un support de création d'agrément (utilisé pour les ACL/assertion) $agrement = $this->getNewEntity()->setStructure($s); /* @var $agrement Agrement */ } - $data[$s->getId()]['structure'] = $s; - $data[$s->getId()]['agrement'] = $agrement; + $data[] = ['structure' => $s, 'agrement' => $agrement]; } if (!$data) { @@ -190,9 +191,13 @@ implements ContextProviderAwareInterface, { $this->intervenant = $this->context()->mandatory()->intervenantFromRoute(); $this->typeAgrement = $this->context()->mandatory()->typeAgrementFromRoute(); - $structure = $this->context()->mandatory()->structureFromRoute(); + $structure = $this->context()->structureFromRoute(); $this->agrement = $this->getAgrementForStructure($structure); + if (!$structure && !$this->typeAgrement->isConseilAcademique()) { + throw new LogicException(sprintf("Une structure doit être spécifiée pour le type d'agrément '%s'.", $this->typeAgrement)); + } + $this->view = new ViewModel(array( 'agrement' => $this->agrement, )); @@ -270,25 +275,25 @@ implements ContextProviderAwareInterface, $this->getFormSaisie()->setAttribute('action', $this->url()->fromRoute(null, array(), array(), true)); - /** - * Il y a un Conseil Restreint par structure d'enseignement - */ - if ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_RESTREINT) { - $structureEns = $this->role->getStructure(); - } - /** - * Il y a un seul Conseil Academique pour toutes les structures d'enseignement - */ - elseif ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_ACADEMIQUE) { - $structureEns = $this->intervenant->getStructure()->getParenteNiv2(); - } - else { - throw new LogicException("Type d'agrément inattendu!"); - } - - if ($this->agrement->getStructure() !== $structureEns) { - throw new UnAuthorizedException("Les structures ne correspondent pas!"); - } +// /** +// * Il y a un Conseil Restreint par structure d'enseignement +// */ +// if ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_RESTREINT) { +// $structureEns = $this->role->getStructure(); +// } +// /** +// * Il y a un seul Conseil Academique pour toutes les structures d'enseignement +// */ +// elseif ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_ACADEMIQUE) { +// $structureEns = $this->intervenant->getStructure()->getParenteNiv2(); +// } +// else { +// throw new LogicException("Type d'agrément inattendu!"); +// } +// +// if ($this->agrement->getStructure() !== $structureEns) { +// throw new UnAuthorizedException("Les structures ne correspondent pas!"); +// } $this->updateCommon(); @@ -337,24 +342,25 @@ implements ContextProviderAwareInterface, * Il y a un Conseil Restreint par structure d'enseignement */ if ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_RESTREINT) { - $structureEns = $this->role->getStructure(); + $structure = $this->role->getStructure(); } /** * Il y a un seul Conseil Academique pour toutes les structures d'enseignement */ elseif ($this->typeAgrement->getCode() === TypeAgrement::CODE_CONSEIL_ACADEMIQUE) { // $structureEns = $this->intervenant->getStructure()->getParenteNiv2(); - $structureEns = $this->role->getStructure(); +// $structureEns = $this->role->getStructure(); + $structure = null; } else { throw new LogicException("Type d'agrément inattendu!"); } - $this->title = sprintf("Ajout d'agréments « %s » par lot <small>%s</small>", $this->typeAgrement, $structureEns); + $this->title = sprintf("Ajout d'agréments « %s » par lot <small>%s</small>", $this->typeAgrement, $structure); /** * Recherche des intervenants candidats : - * - ayant des services sur la structure adéquate + * - ayant des services sur la structure adéquate éventuelle * - et en attente du type d'agrément spécifié dans la requête */ $serviceIntervenant = $this->getIntervenantService(); @@ -366,7 +372,9 @@ implements ContextProviderAwareInterface, ->join("sta.typeAgrementStatut", "tas") ->join("tas.type", 'ta') ->andWhere("ta = :type")->setParameter('type', $this->typeAgrement); - $serviceService->finderByStructureEns($structureEns, $qb); + if ($structure) { + $serviceService->finderByStructureEns($structure, $qb); + } $serviceService->finderByAnnee($this->getContextProvider()->getGlobalContext()->getAnnee(), $qb); $serviceIntervenant->join($serviceService, $qb, "service"); //print_r($qb->getQuery()->getDQL()); $intervenantsCandidats = $serviceIntervenant->getList($qb); @@ -387,7 +395,7 @@ implements ContextProviderAwareInterface, } if ($intervenants) { - $this->agrement = $this->getNewEntity()->setStructure($structureEns); + $this->agrement = $this->getNewEntity()->setStructure($structure); $this->formSaisie = $this->getFormSaisie() ->setIntervenants($intervenants) ->bind($this->agrement); @@ -444,10 +452,10 @@ implements ContextProviderAwareInterface, /** * Recherche d'un agrément par l'intervenant, le type et la structure. * - * @param Structure $structure + * @param Structure|null $structure * @return Agrement */ - private function getAgrementForStructure(Structure $structure) + private function getAgrementForStructure(Structure $structure = null) { $service = $this->getAgrementService(); diff --git a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml index b87addfd47..49998c1917 100644 --- a/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml +++ b/module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml @@ -67,6 +67,7 @@ <join-column name="PARENTE_ID" referenced-column-name="ID"/> </join-columns> </many-to-one> + <one-to-many field="service" target-entity="Application\Entity\Db\Service" mapped-by="structureEns" /> <one-to-many field="elementPedagogique" target-entity="Application\Entity\Db\ElementPedagogique" mapped-by="structure" /> </entity> </doctrine-mapping> diff --git a/module/Application/src/Application/Entity/Db/Structure.php b/module/Application/src/Application/Entity/Db/Structure.php index 59e0a5acbd..93c8697761 100644 --- a/module/Application/src/Application/Entity/Db/Structure.php +++ b/module/Application/src/Application/Entity/Db/Structure.php @@ -109,6 +109,11 @@ class Structure implements HistoriqueAwareInterface */ protected $elementPedagogique; + /** + * @var \Doctrine\Common\Collections\Collection + */ + protected $service; + /** * Set histoCreation * @@ -566,6 +571,39 @@ class Structure implements HistoriqueAwareInterface return $this->elementPedagogique; } + /** + * Add service + * + * @param \Application\Entity\Db\Service $service + * @return Intervenant + */ + public function addService(\Application\Entity\Db\Service $service) + { + $this->service[] = $service; + + return $this; + } + + /** + * Remove service + * + * @param \Application\Entity\Db\Service $service + */ + public function removeService(\Application\Entity\Db\Service $service) + { + $this->service->removeElement($service); + } + + /** + * Get service + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getService() + { + return $this->service; + } + /************************************************************************************************** * Début ajout diff --git a/module/Application/src/Application/Entity/Db/TypeAgrement.php b/module/Application/src/Application/Entity/Db/TypeAgrement.php index 30ca1b1890..b56226f583 100644 --- a/module/Application/src/Application/Entity/Db/TypeAgrement.php +++ b/module/Application/src/Application/Entity/Db/TypeAgrement.php @@ -10,6 +10,11 @@ class TypeAgrement implements HistoriqueAwareInterface const CODE_CONSEIL_RESTREINT = 'CONSEIL_RESTREINT'; const CODE_CONSEIL_ACADEMIQUE = 'CONSEIL_ACADEMIQUE'; + static public $codes = [ + self::CODE_CONSEIL_RESTREINT, + self::CODE_CONSEIL_ACADEMIQUE, + ]; + /** * @var string */ @@ -258,4 +263,24 @@ class TypeAgrement implements HistoriqueAwareInterface { return $this->getLibelle(); } + + /** + * Intercepte les appels de méthodes de la forme "isXxxxxx" où Xxxxxx est un + * code de type d'agrément. + * + * @param string $name Ex: isConseilRestreint, isConseilAcademique + * @param araay $arguments + * @throws \BadMethodCallException + */ + public function __call($name, $arguments) + { + if (substr($name, 0, $len = 2) === 'is') { + $code = strtolower(substr($name, $len)); + if (in_array($code, static::$codes)) { + return strtolower($this->getCode()) === $code; + } + } + + throw new \BadMethodCallException("Méthode inconnue : $name"); + } } diff --git a/module/Application/src/Application/Provider/Role/RoleProvider.php b/module/Application/src/Application/Provider/Role/RoleProvider.php index d61cfd774e..450db52eaf 100644 --- a/module/Application/src/Application/Provider/Role/RoleProvider.php +++ b/module/Application/src/Application/Provider/Role/RoleProvider.php @@ -23,6 +23,8 @@ use Zend\Permissions\Acl\Role\GenericRole; */ class RoleProvider implements ProviderInterface { + const ROLE_ID_ADMIN = 'Administrateur'; + /** * @var array */ diff --git a/module/Application/src/Application/Rule/Intervenant/AgrementFourniRule.php b/module/Application/src/Application/Rule/Intervenant/AgrementFourniRule.php index e314b3aa4a..963d9a28a6 100644 --- a/module/Application/src/Application/Rule/Intervenant/AgrementFourniRule.php +++ b/module/Application/src/Application/Rule/Intervenant/AgrementFourniRule.php @@ -2,21 +2,24 @@ namespace Application\Rule\Intervenant; -use Zend\ServiceManager\ServiceLocatorAwareInterface; -use Zend\ServiceManager\ServiceLocatorAwareTrait; +use Application\Entity\Db\Agrement; +use Application\Entity\Db\Structure; +use Application\Entity\Db\TypeAgrement; use Application\Rule\AbstractRule; +use Application\Service\Agrement as AgrementService; use Application\Service\ContextProviderAwareInterface; use Application\Service\ContextProviderAwareTrait; -use Application\Traits\StructureAwareTrait; +use Application\Service\Service as ServiceService; +use Application\Service\Structure as StructureService; +use Application\Service\TypeAgrementStatut; +use Application\Service\TypeAgrementStatut as TypeAgrementStatutService; use Application\Traits\IntervenantAwareTrait; +use Application\Traits\StructureAwareTrait; use Application\Traits\TypeAgrementAwareTrait; -use Application\Service\TypeAgrementStatut as TypeAgrementStatutService; -use Application\Service\Agrement as AgrementService; -use Application\Service\Structure as StructureService; -use Application\Service\Service as ServiceService; -use Application\Entity\Db\Structure; -use Application\Entity\Db\Agrement; -use Application\Entity\Db\TypeAgrement; +use Common\Exception\LogicException; +use Doctrine\ORM\EntityManager; +use Zend\ServiceManager\ServiceLocatorAwareInterface; +use Zend\ServiceManager\ServiceLocatorAwareTrait; /** * Description of AgrementFourniRule @@ -42,7 +45,7 @@ class AgrementFourniRule extends AbstractRule implements ServiceLocatorAwareInte */ if ($this->getMemePartiellement()) { if ($this->getStructure()) { - throw new \Common\Exception\LogicException( + throw new LogicException( "Si une structure est fournie à cette règle, le flag d'agrément partiel ne peut être à true."); } if (count($this->getTypesAgrementFournis())) { @@ -58,8 +61,10 @@ class AgrementFourniRule extends AbstractRule implements ServiceLocatorAwareInte $this->setMessage(sprintf("L'agrément « %s » n'a pas encore été donné.", $this->getTypeAgrement())); return false; } - // une structure d'enseignement précise doit être fournie - $structures = [ $this->getStructure()->getId() => $this->getStructure() ]; +// // une structure d'enseignement précise doit être fournie +// $structures = [ $this->getStructure()->getId() => $this->getStructure() ]; + // aucun critère de structure pour ce type d'agrément + $structures = [ null ]; } /** * Conseil Restreint (un par structure d'enseignement) @@ -78,9 +83,9 @@ class AgrementFourniRule extends AbstractRule implements ServiceLocatorAwareInte // teste si un agrément existe pour chaque structure d'enseignement foreach ($structures as $structure) { if (!count($this->getAgrementsFournis($structure))) { - $this->setMessage(sprintf("L'agrément « %s » n'a pas encore été donné par la structure « %s ».", + $this->setMessage(sprintf("L'agrément « %s » n'a pas encore été donné%s.", $this->getTypeAgrement(), - $structure)); + $structure ? sprintf(" par la structure « %s »", $structure) : null)); return false; } } @@ -122,7 +127,7 @@ class AgrementFourniRule extends AbstractRule implements ServiceLocatorAwareInte * Change la valeur du flag indiquant si l'on se satisfait d'un agrément "partiel". * * @param boolean $memePartiellement - * @return \Application\Rule\Intervenant\AgrementFourniRule + * @return AgrementFourniRule */ public function setMemePartiellement($memePartiellement = true) { @@ -172,8 +177,9 @@ class AgrementFourniRule extends AbstractRule implements ServiceLocatorAwareInte } /** + * Recherche les agréments déjà fournis. * - * @param Structure $structure + * @param Structure|null $structure Structure concernée éventuelle * @return array id => Agrement */ public function getAgrementsFournis(Structure $structure = null) @@ -204,12 +210,12 @@ class AgrementFourniRule extends AbstractRule implements ServiceLocatorAwareInte public function getStructuresEnseignement() { // recherche des structures d'enseignements de l'intervenant - $serviceStructure = $this->getServiceStructure(); - $serviceService = $this->getServiceService(); - $qb = $serviceStructure->initQuery()[0]; - $serviceStructure->join($serviceService, $qb, 'id', 'structureEns'); - $serviceService->finderByIntervenant($this->getIntervenant(), $qb); - $structuresEns = $serviceStructure->getList($qb); + $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default'); /* @var $em EntityManager */ + $qb = $em->getRepository('Application\Entity\Db\Structure')->createQueryBuilder("str") + ->join("str.service", "s") + ->where("s.intervenant = :intervenant") + ->setParameter('intervenant', $this->getIntervenant()); + $structuresEns = $qb->getQuery()->getResult(); return $structuresEns; } diff --git a/module/Application/src/Application/Service/Assertion/AgrementAssertion.php b/module/Application/src/Application/Service/Assertion/AgrementAssertion.php index 23e806f889..5a6175b5f6 100644 --- a/module/Application/src/Application/Service/Assertion/AgrementAssertion.php +++ b/module/Application/src/Application/Service/Assertion/AgrementAssertion.php @@ -57,34 +57,35 @@ class AgrementAssertion extends EntityAssertion implements AgrementServiceAwareI if ($this->identityRole instanceof ComposanteDbRole) { // structure de responsabilité de l'utilisateur et structure de l'agrément doivent correspondre if ($this->identityRole->getStructure() !== $this->resource->getStructure()) { +// if ($this->resource->getStructure() && $this->identityRole->getStructure()->getId() !== $this->resource->getStructure()->getId()) { return false; } - - $agrementStepKey = 'KEY_' . $this->resource->getType()->getCode(); - - // l'étape Agrement du workflow doit être atteignable - if (!$this->getWorkflow()->isStepReachable($agrementStepKey)) { + } + + $agrementStepKey = 'KEY_' . $this->resource->getType()->getCode(); + + // l'étape Agrement du workflow doit être atteignable + if (!$this->getWorkflow()->isStepReachable($agrementStepKey)) { + return false; + } + + /** + * Modification, suppression + */ + if (in_array($this->privilege, ['update', 'delete'])) { + // l'étape suivante du workflow ne doit pas avoir été franchie + $nextStep = $this->getWorkflow()->getNextStep($agrementStepKey); + if ($nextStep && $this->getWorkflow()->isStepCrossable($nextStep)) { return false; } - - /** - * Modification, suppression - */ - if (in_array($this->privilege, ['update', 'delete'])) { - // l'étape suivante du workflow ne doit pas avoir été franchie - $nextStep = $this->getWorkflow()->getNextStep($agrementStepKey); - if ($nextStep && $this->getWorkflow()->isStepCrossable($nextStep)) { - return false; - } - } - - return true; } -// /********************************************************* -// * Rôle X -// *********************************************************/ -// if ($this->identityRole instanceof XRole) { + return true; + + /********************************************************* + * Rôle X + *********************************************************/ +// if ($this->identityRole->getRoleId() === \Application\Provider\Role\RoleProvider::ROLE_ID_ADMIN) { // // } diff --git a/module/Application/view/application/agrement/lister.phtml b/module/Application/view/application/agrement/lister.phtml index 81c955a862..e5f4f04a37 100644 --- a/module/Application/view/application/agrement/lister.phtml +++ b/module/Application/view/application/agrement/lister.phtml @@ -21,7 +21,11 @@ <?php $structure = $array['structure']; $agrement = $array['agrement']; - $params = ['agrement' => $agrement->getId(), 'structure' => $structure->getId(), 'typeAgrement' => $typeAgrement->getId()]; + $params = [ + 'agrement' => $agrement->getId(), + 'structure' => $structure ? $structure->getId() : null, + 'typeAgrement' => $typeAgrement->getId(), + ]; $refreshUrl = $agrement->getId() ? $this->url('intervenant/agrement/voir', $params, array(), true) : $this->url('intervenant/agrement/voir-str', $params, array(), true); -- GitLab