diff --git a/data/ddl/index/INTERVENANT_CODE_UN.php b/data/ddl/index/INTERVENANT_CODE_UN.php index b5ea5cdbc553c355a1be886f1bb496e97cdd0396..bd0dd4a81c7e1d66766a1afb80c694311d772163 100644 --- a/data/ddl/index/INTERVENANT_CODE_UN.php +++ b/data/ddl/index/INTERVENANT_CODE_UN.php @@ -9,6 +9,8 @@ return [ 'columns' => [ 'CODE', 'ANNEE_ID', + 'STATUT_ID', + 'HISTO_DESTRUCTION', ], ]; diff --git a/data/ddl/index/INTERVENANT_UTIL_CODE_UN.php b/data/ddl/index/INTERVENANT_UTIL_CODE_UN.php index 32bf0298e8c1e9bae595885a93b452b3413ef50f..6e8fc8be9cabb1746499f63d093e1238ad20b93e 100644 --- a/data/ddl/index/INTERVENANT_UTIL_CODE_UN.php +++ b/data/ddl/index/INTERVENANT_UTIL_CODE_UN.php @@ -10,6 +10,7 @@ return [ 'UTILISATEUR_CODE', 'ANNEE_ID', 'STATUT_ID', + 'HISTO_DESTRUCTION', ], ]; diff --git a/data/ddl/table/TYPE_PIECE_JOINTE_STATUT.php b/data/ddl/table/TYPE_PIECE_JOINTE_STATUT.php index 3bb69076778a4c8b8b4812b1bfe139ee2d369224..ebea289506e3c89a3283f067a7408d82f924a28f 100644 --- a/data/ddl/table/TYPE_PIECE_JOINTE_STATUT.php +++ b/data/ddl/table/TYPE_PIECE_JOINTE_STATUT.php @@ -174,6 +174,7 @@ return [ 'precision' => 1, 'nullable' => TRUE, 'default' => '0', + 'position' => 14, 'commentaire' => 'Piece jointe obligatoire même si les heures sont non payables', ], 'SEUIL_HETD' => [ @@ -185,7 +186,7 @@ return [ 'precision' => NULL, 'nullable' => TRUE, 'default' => NULL, - 'position' => 14, + 'position' => 15, 'commentaire' => NULL, ], 'STATUT_INTERVENANT_ID' => [ @@ -197,7 +198,7 @@ return [ 'precision' => NULL, 'nullable' => FALSE, 'default' => NULL, - 'position' => 15, + 'position' => 16, 'commentaire' => NULL, ], 'TYPE_PIECE_JOINTE_ID' => [ @@ -209,7 +210,7 @@ return [ 'precision' => NULL, 'nullable' => FALSE, 'default' => NULL, - 'position' => 16, + 'position' => 17, 'commentaire' => NULL, ], ], diff --git a/data/ddl/unique-constraint/INTERVENANT_CODE_UN.php b/data/ddl/unique-constraint/INTERVENANT_CODE_UN.php index e4c73d2a2b25faf4ca8efdfc0452ca10cb48c047..7ae2c14498265de3d8110a2ea9ee68ee0fac8438 100644 --- a/data/ddl/unique-constraint/INTERVENANT_CODE_UN.php +++ b/data/ddl/unique-constraint/INTERVENANT_CODE_UN.php @@ -9,6 +9,8 @@ return [ 'columns' => [ 'CODE', 'ANNEE_ID', + 'STATUT_ID', + 'HISTO_DESTRUCTION', ], ]; diff --git a/data/ddl/unique-constraint/INTERVENANT_SOURCE_UN.php b/data/ddl/unique-constraint/INTERVENANT_SOURCE_UN.php index 10cb4679886304084ef9033897471507634cf5a8..59297cd4e1bfd8b70a6b7b1ebb08f7c533d6663c 100644 --- a/data/ddl/unique-constraint/INTERVENANT_SOURCE_UN.php +++ b/data/ddl/unique-constraint/INTERVENANT_SOURCE_UN.php @@ -5,11 +5,12 @@ return [ 'name' => 'INTERVENANT_SOURCE_UN', 'table' => 'INTERVENANT', - 'index' => 'INTERVENANT_SOURCE_UN', + 'index' => 'INTERVENANT_SOURCE_UN1', 'columns' => [ 'SOURCE_CODE', 'ANNEE_ID', 'HISTO_DESTRUCTION', + 'STATUT_ID', ], ]; diff --git a/data/ddl/unique-constraint/INTERVENANT_UTIL_CODE_UN.php b/data/ddl/unique-constraint/INTERVENANT_UTIL_CODE_UN.php index 3f6338b6d994f54d55579ea37ffb5f199d0a43ef..df315bc10331c3716214dca71972d545c60dca61 100644 --- a/data/ddl/unique-constraint/INTERVENANT_UTIL_CODE_UN.php +++ b/data/ddl/unique-constraint/INTERVENANT_UTIL_CODE_UN.php @@ -10,6 +10,7 @@ return [ 'UTILISATEUR_CODE', 'ANNEE_ID', 'STATUT_ID', + 'HISTO_DESTRUCTION', ], ]; diff --git a/data/privileges.php b/data/privileges.php index cb8a09e0243a49b0cb801fa7bfb79e01b7375118..f6ffa233f05dd7748aa4a068cdb92ce978b72f47 100644 --- a/data/privileges.php +++ b/data/privileges.php @@ -41,6 +41,8 @@ return [ 'recherche' => 'Recherche', 'fiche' => 'Visualisation de la fiche', 'calcul-hetd' => 'Calcul HETD', + 'creation' => 'Création', + 'ajout-statut' => 'Ajout d\'un nouveau statut', 'edition' => 'Edition', 'suppression' => 'Suppression', 'statut-edition' => 'Statuts (Édition)', @@ -231,7 +233,7 @@ return [ 'edition' => 'Édition', ], ], - 'type-ressource' => [ + 'type-ressource' => [ 'libelle' => 'Types de ressources', 'privileges' => [ 'visualisation' => 'Visualisation', @@ -383,7 +385,7 @@ return [ ], ], - 'formule' => [ + 'formule' => [ 'libelle' => 'Formule de calcul', 'privileges' => [ 'tests' => 'Tests', diff --git a/module/Application/config/intervenant.config.php b/module/Application/config/intervenant.config.php index 8fe8f5bae33680566668ef9dc3d1f914958017d3..94c76551dbb8bad47d6918ffdb9b32d533ec515d 100755 --- a/module/Application/config/intervenant.config.php +++ b/module/Application/config/intervenant.config.php @@ -10,7 +10,7 @@ use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; return [ 'router' => [ 'routes' => [ - 'intervenant' => [ + 'intervenant' => [ 'type' => 'Literal', 'options' => [ 'route' => '/intervenant', @@ -57,6 +57,15 @@ return [ ], ], ], + 'creer' => [ + 'type' => 'Segment', + 'options' => [ + 'route' => '/creer', + 'defaults' => [ + 'action' => 'saisir', + ], + ], + ], 'saisir' => [ 'type' => 'Segment', 'options' => [ @@ -220,7 +229,7 @@ return [ ], ], ], - 'modification-service-du' => [ + 'modification-service-du' => [ 'type' => 'Literal', 'options' => [ 'route' => '/modification-service-du', @@ -240,7 +249,7 @@ return [ ], ], ], - 'validation-volume-horaire-type-intervenant' => [ + 'validation-volume-horaire-type-intervenant' => [ 'type' => 'Literal', 'options' => [ 'route' => '/validation-vh-ti', @@ -251,7 +260,7 @@ return [ ], 'may_terminate' => true, 'child_routes' => [ - 'delete' => [ + 'delete' => [ 'type' => 'Segment', 'options' => [ 'route' => '/delete/:regleStructureValidation', @@ -263,7 +272,7 @@ return [ ], ], ], - 'saisie' => [ + 'saisie' => [ 'type' => 'Segment', 'options' => [ 'route' => '/saisie/[:regleStructureValidation]', @@ -476,7 +485,7 @@ return [ 'action' => ['validation-volume-horaire-type-intervenant', 'validation-volume-horaire-type-intervenant-saisie', 'validation-volume-horaire-type-intervenant-delete', - ], + ], 'privileges' => [ Privileges::MODIF_SERVICE_DU_EDITION, ], @@ -516,10 +525,10 @@ return [ ], 'service_manager' => [ 'factories' => [ - Service\IntervenantService::class => Service\Factory\IntervenantServiceFactory::class, - Processus\IntervenantProcessus::class => Processus\Factory\IntervenantProcessusFactory::class, - Assertion\ModificationServiceDuAssertion::class => \UnicaenAuth\Assertion\AssertionFactory::class, - Assertion\IntervenantAssertion::class => \UnicaenAuth\Assertion\AssertionFactory::class, + Service\IntervenantService::class => Service\Factory\IntervenantServiceFactory::class, + Processus\IntervenantProcessus::class => Processus\Factory\IntervenantProcessusFactory::class, + Assertion\ModificationServiceDuAssertion::class => \UnicaenAuth\Assertion\AssertionFactory::class, + Assertion\IntervenantAssertion::class => \UnicaenAuth\Assertion\AssertionFactory::class, ], 'invokables' => [ Service\MotifModificationServiceDuService::class => Service\MotifModificationServiceDuService::class, diff --git a/module/Application/src/Application/Form/Intervenant/EditionForm.php b/module/Application/src/Application/Form/Intervenant/EditionForm.php index f05e98a2db0212f09814164954cc35ad1c86fd1a..4febf4d34006ebd8ce6b5435e02826c07b8bd7e1 100755 --- a/module/Application/src/Application/Form/Intervenant/EditionForm.php +++ b/module/Application/src/Application/Form/Intervenant/EditionForm.php @@ -3,9 +3,18 @@ namespace Application\Form\Intervenant; use Application\Entity\Db\Intervenant; +use Application\Entity\Db\Traits\GradeAwareTrait; use Application\Filter\FloatFromString; use Application\Filter\StringFromFloat; use Application\Form\AbstractForm; +use Application\Service\Traits\CiviliteServiceAwareTrait; +use Application\Service\Traits\ContextServiceAwareTrait; +use Application\Service\Traits\SourceServiceAwareTrait; +use Application\Service\Traits\StatutIntervenantServiceAwareTrait; +use Application\Service\Traits\StructureServiceAwareTrait; +use UnicaenApp\Util; +use UnicaenImport\Service\Traits\SchemaServiceAwareTrait; +use Zend\Form\FormInterface; use Zend\Hydrator\HydratorInterface; /** @@ -15,27 +24,160 @@ use Zend\Hydrator\HydratorInterface; */ class EditionForm extends AbstractForm { + use SourceServiceAwareTrait; + use SchemaServiceAwareTrait; + use CiviliteServiceAwareTrait; + use StatutIntervenantServiceAwareTrait; + use StructureServiceAwareTrait; + use ContextServiceAwareTrait; + + public function init() - { + {/* + + + + + +, SOURCE_ID NUMBER(*, 0) NOT null +, SOURCE_CODE VARCHAR2(100 CHAR) +, MONTANT_INDEMNITE_FC FLOAT(126) +, ANNEE_ID NUMBER(*, 0) DEFAULT null NOT null ==> année en cours +, GRADE_ID NUMBER(*, 0) +, CRITERE_RECHERCHE VARCHAR2(255 CHAR) ==> automatique +, CODE VARCHAR2(60 CHAR) +, UTILISATEUR_CODE VARCHAR2(60 CHAR) ==> ? ? + +, SYNC_STATUT NUMBER(1, 0) DEFAULT 1 NOT null ==> ?? +, SYNC_STRUCTURE NUMBER(1, 0) DEFAULT 1 NOT null ==> ?? +*/ + $hydrator = new IntervenantFormHydrator; $this->setHydrator($hydrator); - $this->setAttribute('action', $this->getCurrentUrl() ); + $this->setAttribute('action', $this->getCurrentUrl()); + + + $this->add([ + 'name' => 'civilite', + 'type' => 'Select', + 'options' => [ + 'label' => 'Civilité', + 'value_options' => Util::collectionAsOptions($this->getServiceCivilite()->getList()), + ], + ]); + + $this->add([ + 'name' => 'nomUsuel', + 'options' => [ + 'label' => 'Nom usuel', + ], + 'type' => 'Text', + ]); + + $this->add([ + 'name' => 'nomPatronymique', + 'type' => 'Text', + 'options' => [ + 'label' => 'Nom de naissance', + ], + + ]); + + $this->add([ + 'name' => 'prenom', + 'type' => 'Text', + 'options' => [ + 'label' => 'Prénom', + ], + + ]); $this->add([ - 'name' => 'montant-indemnite-fc', + 'name' => 'dateNaissance', + 'type' => 'UnicaenApp\Form\Element\Date', + 'options' => [ + 'label' => 'Date de naissance', + 'label_options' => [ + 'disable_html_escape' => true, + ], + ], + 'attributes' => [ + 'placeholder' => "jj/mm/aaaa", + ], + ]); + + $this->add([ + 'name' => 'statut', + 'type' => 'Select', + 'options' => [ + 'label' => 'Statut', + 'value_options' => Util::collectionAsOptions($this->getServiceStatutIntervenant()->getList($this->getServiceStatutIntervenant()->finderByHistorique())), + ], + ]); + + $this->add([ + 'name' => 'structure', + 'type' => 'Select', + 'options' => [ + 'label' => 'Structure', + ], + ]); + + $this->add([ + 'name' => 'discipline', + 'type' => 'Select', + 'options' => [ + 'label' => 'Discipline', + ], + 'attributes' => [ + 'class' => 'selectpicker', + 'data-live-search' => 'true', + ], + ]); + + $this->add([ + 'name' => 'grade', + 'type' => 'Select', + 'options' => [ + 'label' => 'Grade', + ], + 'attributes' => [ + 'class' => 'selectpicker', + 'data-live-search' => 'true', + ], + ]); + + $this->add([ + 'name' => 'montantIndemniteFc', 'options' => [ 'label' => "Montant annuel de la rémunération FC D714-60 (€) :", ], 'attributes' => [ - 'value' => '0', - 'title' => "Nombre d'heures", + 'value' => '0', + 'title' => "Nombre d'heures", ], 'type' => 'Text', ]); + $this->add([ + 'name' => 'code', + 'type' => 'Text', + 'options' => [ + 'label' => 'Code', + ], + ]); + + $this->add([ + 'name' => 'utilisateurCode', + 'type' => 'Text', + 'options' => [ + 'label' => 'Identifiant LDAP éventuel (' . \AppConfig::get('ldap', 'utilisateurCode', 'supannEmpId') . ')', + ], + ]); + $this->add([ 'name' => 'id', 'type' => 'Hidden', @@ -45,10 +187,37 @@ class EditionForm extends AbstractForm 'name' => 'submit', 'type' => 'Submit', 'attributes' => [ - 'value' => 'Appliquer', + 'value' => 'Enregistrer', 'class' => 'btn btn-primary', ], ]); + + $role = $this->getServiceContext()->getSelectedIdentityRole(); + $serviceStructure = $this->getServiceStructure(); + $qb = $serviceStructure->finderByEnseignement(); + if ($structure = ($role ? $role->getStructure() : null)) { + $serviceStructure->finderById($role->getStructure()->getId(), $qb); // Filtre + } + $this->get('structure') + ->setValueOptions(Util::collectionAsOptions($serviceStructure->getList($qb))); + } + + + + public function bind($object, $flags = FormInterface::VALUES_NORMALIZED) + { + /* @var $object Intervenant */ + parent::bind($object, $flags); + + if ($object->getSource() && $object->getSource()->getImportable()) { + foreach ($this->getElements() as $element) { + if ($this->getServiceSchema()->isImportedProperty($object, $element->getName())) { + $element->setAttribute('readonly', true); + } + } + } + + return $this; } @@ -62,7 +231,7 @@ class EditionForm extends AbstractForm public function getInputFilterSpecification() { return [ - 'montant-indemnite-fc' => [ + 'montantIndemniteFc' => [ 'required' => false, 'filters' => [ ['name' => FloatFromString::class], @@ -80,14 +249,14 @@ class IntervenantFormHydrator implements HydratorInterface { /** - * @param array $data - * @param Intervenant $object + * @param array $data + * @param Intervenant $object * * @return object */ public function hydrate(array $data, $object) { - $object->setMontantIndemniteFc($data['montant-indemnite-fc']); + $object->setMontantIndemniteFc($data['montantIndemniteFc']); return $object; } @@ -95,15 +264,15 @@ class IntervenantFormHydrator implements HydratorInterface /** - * @param Intervenant $object + * @param Intervenant $object * * @return array */ public function extract($object) { $data = [ - 'id' => $object->getId(), - 'montant-indemnite-fc' => StringFromFloat::run($object->getMontantIndemniteFc()), + 'id' => $object->getId(), + 'montantIndemniteFc' => StringFromFloat::run($object->getMontantIndemniteFc()), ]; return $data; diff --git a/module/Application/src/Application/Provider/Privilege/Privileges.php b/module/Application/src/Application/Provider/Privilege/Privileges.php index 4903513022580eb5499624e9ea9d7f6373a03259..09d4bbdc8765ec30f55f495fa39625b638ac33ea 100755 --- a/module/Application/src/Application/Provider/Privilege/Privileges.php +++ b/module/Application/src/Application/Provider/Privilege/Privileges.php @@ -30,6 +30,7 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges const BUDGET_TYPES_RESSOURCES_VISUALISATION = 'budget-types-ressources-visualisation'; const BUDGET_VISUALISATION = 'budget-visualisation'; const CENTRES_COUTS_ADMINISTRATION_EDITION = 'centres-couts-administration-edition'; + const CENTRES_COUTS_ADMINISTRATION_RECONDUCTION = 'centres-couts-administration-reconduction'; const CENTRES_COUTS_ADMINISTRATION_VISUALISATION = 'centres-couts-administration-visualisation'; const CHARGENS_DEPASSEMENT_CSV = 'chargens-depassement-csv'; const CHARGENS_EXPORT_CSV = 'chargens-export-csv'; @@ -54,10 +55,10 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges const CLOTURE_EDITION_SERVICES_AVEC_MEP = 'cloture-edition-services-avec-mep'; const CLOTURE_REOUVERTURE = 'cloture-reouverture'; const CONTRAT_CONTRAT_GENERATION = 'contrat-contrat-generation'; - const CONTRAT_ENVOI_EMAIL = 'contrat-envoi-email'; const CONTRAT_CREATION = 'contrat-creation'; const CONTRAT_DEPOT_RETOUR_SIGNE = 'contrat-depot-retour-signe'; const CONTRAT_DEVALIDATION = 'contrat-devalidation'; + const CONTRAT_ENVOI_EMAIL = 'contrat-envoi-email'; const CONTRAT_MODELES_EDITION = 'contrat-modeles-edition'; const CONTRAT_MODELES_VISUALISATION = 'contrat-modeles-visualisation'; const CONTRAT_PROJET_GENERATION = 'contrat-projet-generation'; @@ -70,15 +71,38 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges const DISCIPLINE_VISUALISATION = 'discipline-visualisation'; const DOMAINES_FONCTIONNELS_ADMINISTRATION_EDITION = 'domaines-fonctionnels-administration-edition'; const DOMAINES_FONCTIONNELS_ADMINISTRATION_VISUALISATION = 'domaines-fonctionnels-administration-visualisation'; + const DOSSIER_ADRESSE_EDITION = 'dossier-adresse-edition'; + const DOSSIER_ADRESSE_VISUALISATION = 'dossier-adresse-visualisation'; + const DOSSIER_BANQUE_EDITION = 'dossier-banque-edition'; + const DOSSIER_BANQUE_VISUALISATION = 'dossier-banque-visualisation'; + const DOSSIER_CHAMP_AUTRE_1_EDITION = 'dossier-champ-autre-1-edition'; + const DOSSIER_CHAMP_AUTRE_1_VISUALISATION = 'dossier-champ-autre-1-visualisation'; + const DOSSIER_CHAMP_AUTRE_2_EDITION = 'dossier-champ-autre-2-edition'; + const DOSSIER_CHAMP_AUTRE_2_VISUALISATION = 'dossier-champ-autre-2-visualisation'; + const DOSSIER_CHAMP_AUTRE_3_EDITION = 'dossier-champ-autre-3-edition'; + const DOSSIER_CHAMP_AUTRE_3_VISUALISATION = 'dossier-champ-autre-3-visualisation'; + const DOSSIER_CHAMP_AUTRE_4_EDITION = 'dossier-champ-autre-4-edition'; + const DOSSIER_CHAMP_AUTRE_4_VISUALISATION = 'dossier-champ-autre-4-visualisation'; + const DOSSIER_CHAMP_AUTRE_5_EDITION = 'dossier-champ-autre-5-edition'; + const DOSSIER_CHAMP_AUTRE_5_VISUALISATION = 'dossier-champ-autre-5-visualisation'; + const DOSSIER_CONTACT_EDITION = 'dossier-contact-edition'; + const DOSSIER_CONTACT_VISUALISATION = 'dossier-contact-visualisation'; const DOSSIER_DEVALIDATION = 'dossier-devalidation'; const DOSSIER_DIFFERENCES = 'dossier-differences'; const DOSSIER_EDITION = 'dossier-edition'; + const DOSSIER_EMPLOYEUR_EDITION = 'dossier-employeur-edition'; + const DOSSIER_EMPLOYEUR_VISUALISATION = 'dossier-employeur-visualisation'; + const DOSSIER_IDENTITE_SUITE_EDITION = 'dossier-identite-suite-edition'; + const DOSSIER_IDENTITE_SUITE_VISUALISATION = 'dossier-identite-suite-visualisation'; + const DOSSIER_INSEE_EDITION = 'dossier-insee-edition'; + const DOSSIER_INSEE_VISUALISATION = 'dossier-insee-visualisation'; const DOSSIER_PURGER_DIFFERENCES = 'dossier-purger-differences'; const DOSSIER_SUPPRESSION = 'dossier-suppression'; const DOSSIER_VALIDATION = 'dossier-validation'; const DOSSIER_VISUALISATION = 'dossier-visualisation'; const DROIT_AFFECTATION_EDITION = 'droit-affectation-edition'; const DROIT_AFFECTATION_VISUALISATION = 'droit-affectation-visualisation'; + const EMPLOYEUR_GESTION = 'employeur-gestion'; const ENSEIGNEMENT_DEVALIDATION = 'enseignement-devalidation'; const ENSEIGNEMENT_EDITION = 'enseignement-edition'; const ENSEIGNEMENT_EXPORT_CSV = 'enseignement-export-csv'; @@ -104,7 +128,9 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges const INDICATEUR_ABONNEMENTS_VISUALISATION = 'indicateur-abonnements-visualisation'; const INDICATEUR_ENVOI_MAIL_INTERVENANTS = 'indicateur-envoi-mail-intervenants'; const INDICATEUR_VISUALISATION = 'indicateur-visualisation'; + const INTERVENANT_AJOUT_STATUT = 'intervenant-ajout-statut'; const INTERVENANT_CALCUL_HETD = 'intervenant-calcul-hetd'; + const INTERVENANT_CREATION = 'intervenant-creation'; const INTERVENANT_EDITION = 'intervenant-edition'; const INTERVENANT_FICHE = 'intervenant-fiche'; const INTERVENANT_RECHERCHE = 'intervenant-recherche'; @@ -138,13 +164,13 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges const ODF_ELEMENT_VISUALISATION = 'odf-element-visualisation'; const ODF_ETAPE_EDITION = 'odf-etape-edition'; const ODF_ETAPE_VISUALISATION = 'odf-etape-visualisation'; - const ODF_RECONDUCTION_OFFRE = 'odf-reconduction-offre'; - const ODF_RECONDUCTION_CENTRE_COUT = 'odf-reconduction-centre-cout'; - const ODF_RECONDUCTION_MODULATEUR = 'odf-reconduction-modulateur'; const ODF_EXPORT_CSV = 'odf-export-csv'; const ODF_GRANDS_TYPES_DIPLOME_EDITION = 'odf-grands-types-diplome-edition'; const ODF_GRANDS_TYPES_DIPLOME_VISUALISATION = 'odf-grands-types-diplome-visualisation'; const ODF_MODULATEURS_EDITION = 'odf-modulateurs-edition'; + const ODF_RECONDUCTION_CENTRE_COUT = 'odf-reconduction-centre-cout'; + const ODF_RECONDUCTION_MODULATEUR = 'odf-reconduction-modulateur'; + const ODF_RECONDUCTION_OFFRE = 'odf-reconduction-offre'; const ODF_TAUX_MIXITE_EDITION = 'odf-taux-mixite-edition'; const ODF_TYPES_DIPLOME_EDITION = 'odf-types-diplome-edition'; const ODF_TYPES_DIPLOME_VISUALISATION = 'odf-types-diplome-visualisation'; @@ -183,7 +209,5 @@ class Privileges extends \UnicaenAuth\Provider\Privilege\Privileges const UNICAEN_TBL_UPDATE_ACTUPROC = 'unicaen-tbl-update-actuproc'; const WORKFLOW_DEPENDANCES_EDITION = 'workflow-dependances-edition'; const WORKFLOW_DEPENDANCES_VISUALISATION = 'workflow-dependances-visualisation'; - const EMPLOYEUR_GESTION = 'employeur-gestion'; - } \ No newline at end of file diff --git a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php index 29f2be181e2fe6807f5972e944e7adafd2ea7482..3676b0887cce47aac189cd785bb9bc96f901f606 100755 --- a/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php +++ b/module/Application/src/Application/View/Helper/Intervenant/IntervenantViewHelper.php @@ -3,6 +3,7 @@ namespace Application\View\Helper\Intervenant; use Application\Constants; +use Application\Provider\Privilege\Privileges; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\IntervenantServiceAwareTrait; use Zend\View\Helper\AbstractHtmlElement; @@ -138,7 +139,7 @@ class IntervenantViewHelper extends AbstractHtmlElement //echo $intervenant . ' <small>' . $intervenant->getStatut() . '</small>'; - $canAddIntervenant = false; // à poursuivre + $canAddIntervenant = $this->getView()->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_AJOUT_STATUT)); $this->getView()->headTitle()->append($intervenant->getNomUsuel())->append($title); $title .= ' <small>' . $intervenant . '</small>'; diff --git a/module/Application/view/application/intervenant/rechercher.phtml b/module/Application/view/application/intervenant/rechercher.phtml index ebc462fa3016aba57b0532e7216186348ac9c8fc..996708d8ea352cd0b5f028e6cfb405608ce50f25 100755 --- a/module/Application/view/application/intervenant/rechercher.phtml +++ b/module/Application/view/application/intervenant/rechercher.phtml @@ -1,26 +1,34 @@ <?php - /* @var $recents [] */ +/* @var $recents [] */ ?> <h1 class="page-header">Rechercher un intervenant</h1> <div style="padding:1em"> -<div class="intervenant-recherche"> - <div class="critere"> - Saisissez le nom suivi éventuellement du prénom (2 lettres au moins) :<br /> - <input id="critere" class="form-control input" type="text" style="width:15em;display:inline" /> - <span class="loading" id="intervenant-recherche-loading" style="display: none"> </span> - </div> - <div class="recherche" data-url="<?= $this->url('intervenant/recherche') ?>"> + <div class="intervenant-recherche"> + <div class="critere"> + Saisissez le nom suivi éventuellement du prénom (2 lettres au moins) :<br/> + <input id="critere" class="form-control input" type="text" style="width:15em;display:inline"/> + <span class="loading" id="intervenant-recherche-loading" style="display: none"> </span> + </div> + <div class="recherche" data-url="<?= $this->url('intervenant/recherche') ?>"> + </div> </div> -</div> -<?php + <?php -if (! empty($recents)){ - echo '<h3>Fiches récemment consultées :</h3>'; - echo $this->partial('liste', ['intervenants' => $recents]); -} + if (!empty($recents)) { + echo '<h3>Fiches récemment consultées :</h3>'; + echo $this->partial('liste', ['intervenants' => $recents]); + } -?> + + $canAddIntervenant = $this->isAllowed(\Application\Provider\Privilege\Privileges::getResourceId(\Application\Provider\Privilege\Privileges::INTERVENANT_CREATION)); + + if ($canAddIntervenant) { + $url = $this->url('intervenant/creer'); + echo $this->tag('a', ['class' => 'btn btn-primary', 'href' => $url])->html("Ajout d'un nouvel intervenant"); + } + + ?> </div> diff --git a/module/Application/view/application/intervenant/saisir.phtml b/module/Application/view/application/intervenant/saisir.phtml index a46a501b8225367c919c34af9c88add7c7ff7c4c..013cb28c48634d9fee4597756e10020f8bc5f30b 100755 --- a/module/Application/view/application/intervenant/saisir.phtml +++ b/module/Application/view/application/intervenant/saisir.phtml @@ -11,8 +11,20 @@ if ($errors) { echo $this->messenger()->setMessages([UnicaenApp\View\Helper\Messenger::ERROR => $errors]); } -echo $this->formControlGroup($form->get('montant-indemnite-fc')); +echo $this->formControlGroup($form->get('civilite')); +echo $this->formControlGroup($form->get('nomUsuel')); +echo $this->formControlGroup($form->get('nomPatronymique')); +echo $this->formControlGroup($form->get('prenom')); +echo $this->formControlGroup($form->get('dateNaissance')); +echo $this->formControlGroup($form->get('statut')); +echo $this->formControlGroup($form->get('structure')); +echo $this->formControlGroup($form->get('discipline')); +echo $this->formControlGroup($form->get('grade')); +echo $this->formControlGroup($form->get('montantIndemniteFc')); +echo $this->formControlGroup($form->get('code')); +echo $this->formControlGroup($form->get('utilisateurCode')); + echo $this->formRow($form->get('submit')); echo $this->formHidden($form->get('id')); -echo $this->form()->closeTag(); \ No newline at end of file +echo $this->form()->closeTag();