diff --git a/module/Application/config/dossier-pieces.config.php b/module/Application/config/dossier-pieces.config.php index 4288a8f56cfa820521484836089de82571d5ec59..de13ba48f7ab4a8ceb19ddeb63c6e457a9eede36 100755 --- a/module/Application/config/dossier-pieces.config.php +++ b/module/Application/config/dossier-pieces.config.php @@ -4,7 +4,6 @@ namespace Application; use Application\Entity\Db\Service; use Application\Provider\Privilege\Privileges; -use Application\Service\IntervenantDossierService; use UnicaenAuth\Guard\PrivilegeController; use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider; @@ -317,7 +316,7 @@ return [ 'default' => [ 'home' => [ 'pages' => [ - 'intervenant' => [ + 'intervenant' => [ 'pages' => [ 'dossier' => [ 'label' => "Données personnelles", diff --git a/module/Application/config/intervenant-dossier.config.php b/module/Application/config/intervenant-dossier.config.php index 8c546b6c0433b511d11541c3de6530fe45c27b94..64c9257e882022621488c80d8ddcda73c5aa750e 100755 --- a/module/Application/config/intervenant-dossier.config.php +++ b/module/Application/config/intervenant-dossier.config.php @@ -105,19 +105,6 @@ return [ ], 'may_terminate' => true, ], - 'delete' => [ - 'type' => 'Segment', - 'options' => [ - 'route' => '/delete[/:dossierAutre]', - 'constraints' => [ - 'dossierAutre' => '[0-9]*', - ], - 'defaults' => [ - 'action' => 'dossier-autre-delete', - ], - ], - 'may_terminate' => true, - ], ], ], ], @@ -216,12 +203,22 @@ return [ IntervenantDossierAssertion::PRIV_VIEW_ADRESSE, IntervenantDossierAssertion::PRIV_EDIT_CONTACT, IntervenantDossierAssertion::PRIV_VIEW_CONTACT, - IntervenantDossierAssertion::PRIV_EDIT_EMPLOYEUR, - IntervenantDossierAssertion::PRIV_VIEW_EMPLOYEUR, IntervenantDossierAssertion::PRIV_EDIT_INSEE, IntervenantDossierAssertion::PRIV_VIEW_INSEE, - IntervenantDossierAssertion::PRIV_EDIT_IBAN, IntervenantDossierAssertion::PRIV_VIEW_IBAN, + IntervenantDossierAssertion::PRIV_EDIT_IBAN, + IntervenantDossierAssertion::PRIV_VIEW_EMPLOYEUR, + IntervenantDossierAssertion::PRIV_EDIT_EMPLOYEUR, + IntervenantDossierAssertion::PRIV_VIEW_AUTRE1, + IntervenantDossierAssertion::PRIV_EDIT_AUTRE1, + IntervenantDossierAssertion::PRIV_VIEW_AUTRE2, + IntervenantDossierAssertion::PRIV_EDIT_AUTRE2, + IntervenantDossierAssertion::PRIV_VIEW_AUTRE3, + IntervenantDossierAssertion::PRIV_EDIT_AUTRE3, + IntervenantDossierAssertion::PRIV_VIEW_AUTRE4, + IntervenantDossierAssertion::PRIV_EDIT_AUTRE4, + IntervenantDossierAssertion::PRIV_VIEW_AUTRE5, + IntervenantDossierAssertion::PRIV_EDIT_AUTRE5, IntervenantDossierAssertion::PRIV_CAN_VALIDE, IntervenantDossierAssertion::PRIV_CAN_DEVALIDE, @@ -242,7 +239,6 @@ return [ 'service_manager' => [ 'invokables' => [ Service\DossierService::class => Service\DossierService::class, - IntervenantDossierService::class => IntervenantDossierService::class, AdresseNumeroComplService::class => AdresseNumeroComplService::class, DossierAutreService::class => DossierAutreService::class, DossierAutreTypeService::class => DossierAutreTypeService::class, diff --git a/module/Application/src/Application/Assertion/IntervenantDossierAssertion.php b/module/Application/src/Application/Assertion/IntervenantDossierAssertion.php index 5f593194010645bde7672d2adf4ebc1a9ba92982..3aa30c88c696adeb8bf044b4ddd8a5582ace7ff7 100644 --- a/module/Application/src/Application/Assertion/IntervenantDossierAssertion.php +++ b/module/Application/src/Application/Assertion/IntervenantDossierAssertion.php @@ -5,12 +5,11 @@ namespace Application\Assertion; use Application\Acl\Role; use Application\Entity\Db\Contrat; use Application\Entity\Db\Intervenant; -use Application\Entity\Db\IntervenantDossier; use Application\Entity\Db\WfEtape; use Application\Provider\Privilege\Privileges; // sous réserve que vous utilisiez les privilèges d'UnicaenAuth et que vous ayez généré votre fournisseur -use Application\Service\Traits\IntervenantDossierServiceAwareTrait; +use Application\Service\Traits\DossierServiceAwareTrait; use Application\Service\Traits\WorkflowServiceAwareTrait; use UnicaenAuth\Assertion\AbstractAssertion; use Zend\Permissions\Acl\Resource\ResourceInterface; @@ -34,13 +33,23 @@ class IntervenantDossierAssertion extends AbstractAssertion const PRIV_VIEW_INSEE = 'dossier-voir-insee'; const PRIV_EDIT_EMPLOYEUR = 'dossier-edit-employeur'; const PRIV_VIEW_EMPLOYEUR = 'dossier-voir-employeur'; + const PRIV_EDIT_AUTRE1 = 'dossier-edit-autre1'; + const PRIV_VIEW_AUTRE1 = 'dossier-voir-autre1'; + const PRIV_EDIT_AUTRE2 = 'dossier-edit-autre2'; + const PRIV_VIEW_AUTRE2 = 'dossier-voir-autre2'; + const PRIV_EDIT_AUTRE3 = 'dossier-edit-autre3'; + const PRIV_VIEW_AUTRE3 = 'dossier-voir-autre3'; + const PRIV_EDIT_AUTRE4 = 'dossier-edit-autre4'; + const PRIV_VIEW_AUTRE4 = 'dossier-voir-autre4'; + const PRIV_EDIT_AUTRE5 = 'dossier-edit-autre5'; + const PRIV_VIEW_AUTRE5 = 'dossier-voir-autre5'; const PRIV_CAN_VALIDE = 'dossier-peut-valider'; const PRIV_CAN_DEVALIDE = 'dossier-peut-devalider'; //Constantes utiles const CODE_TYPE_PERMANENT = 'P'; use WorkflowServiceAwareTrait; - use IntervenantDossierServiceAwareTrait; + use DossierServiceAwareTrait; /** * @param ResourceInterface $entity @@ -63,6 +72,16 @@ class IntervenantDossierAssertion extends AbstractAssertion self::PRIV_EDIT_IBAN, self::PRIV_VIEW_EMPLOYEUR, self::PRIV_EDIT_EMPLOYEUR, + self::PRIV_VIEW_AUTRE1, + self::PRIV_EDIT_AUTRE1, + self::PRIV_VIEW_AUTRE2, + self::PRIV_EDIT_AUTRE2, + self::PRIV_VIEW_AUTRE3, + self::PRIV_EDIT_AUTRE3, + self::PRIV_VIEW_AUTRE4, + self::PRIV_EDIT_AUTRE4, + self::PRIV_VIEW_AUTRE5, + self::PRIV_EDIT_AUTRE5, self::PRIV_CAN_VALIDE, self::PRIV_CAN_DEVALIDE, ]; @@ -95,6 +114,30 @@ class IntervenantDossierAssertion extends AbstractAssertion return $this->assertEditIban($entity); case self::PRIV_VIEW_IBAN: return $this->assertViewIban($entity); + case self::PRIV_EDIT_EMPLOYEUR: + return $this->assertEditEmployeur($entity); + case self::PRIV_VIEW_EMPLOYEUR: + return $this->assertViewEmployeur($entity); + case self::PRIV_EDIT_AUTRE1: + return $this->assertEditAutre1($entity); + case self::PRIV_VIEW_AUTRE1: + return $this->assertViewAutre1($entity); + case self::PRIV_EDIT_AUTRE2: + return $this->assertEditAutre2($entity); + case self::PRIV_VIEW_AUTRE2: + return $this->assertViewAutre2($entity); + case self::PRIV_EDIT_AUTRE3: + return $this->assertEditAutre3($entity); + case self::PRIV_VIEW_AUTRE3: + return $this->assertViewAutre3($entity); + case self::PRIV_EDIT_AUTRE4: + return $this->assertEditAutre4($entity); + case self::PRIV_VIEW_AUTRE4: + return $this->assertViewAutre4($entity); + case self::PRIV_EDIT_AUTRE5: + return $this->assertEditAutre5($entity); + case self::PRIV_VIEW_AUTRE5: + return $this->assertViewAutre5($entity); case self::PRIV_CAN_VALIDE: return $this->assertCanValidate($entity); case self::PRIV_CAN_DEVALIDE: @@ -124,7 +167,7 @@ class IntervenantDossierAssertion extends AbstractAssertion //rajouter test si dossier valider ou non return $this->asserts([ - !$this->getServiceIntervenantDossier()->getValidation($intervenant), + !$this->getServiceDossier()->getValidation($intervenant), $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_IDENTITE_SUITE_VISUALISATION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_IDENTITE_SUITE_EDITION), @@ -149,7 +192,7 @@ class IntervenantDossierAssertion extends AbstractAssertion //rajouter test si dossier valider ou non return $this->asserts([ - !$this->getServiceIntervenantDossier()->getValidation($intervenant), + !$this->getServiceDossier()->getValidation($intervenant), $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_ADRESSE_VISUALISATION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_ADRESSE_EDITION), @@ -174,7 +217,7 @@ class IntervenantDossierAssertion extends AbstractAssertion //rajouter test si dossier valider ou non return $this->asserts([ - !$this->getServiceIntervenantDossier()->getValidation($intervenant), + !$this->getServiceDossier()->getValidation($intervenant), $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_CONTACT_VISUALISATION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_CONTACT_EDITION), @@ -201,7 +244,7 @@ class IntervenantDossierAssertion extends AbstractAssertion //On affiche le fieldset INSEE uniquement si on a le droit visualisation et que l'on est vacataire return $this->asserts([ - !$this->getServiceIntervenantDossier()->getValidation($intervenant), + !$this->getServiceDossier()->getValidation($intervenant), $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_INSEE_VISUALISATION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_INSEE_EDITION) @@ -229,7 +272,7 @@ class IntervenantDossierAssertion extends AbstractAssertion protected function assertEditIban(Intervenant $intervenant) { return $this->asserts([ - !$this->getServiceIntervenantDossier()->getValidation($intervenant), + !$this->getServiceDossier()->getValidation($intervenant), $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_BANQUE_VISUALISATION), $this->getRole()->hasPrivilege(Privileges::DOSSIER_BANQUE_EDITION) @@ -253,14 +296,149 @@ class IntervenantDossierAssertion extends AbstractAssertion + protected function assertEditEmployeur(Intervenant $intervenant) + { + return $this->asserts([ + !$this->getServiceDossier()->getValidation($intervenant), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EMPLOYEUR_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EMPLOYEUR_EDITION), + ]); + } + + + + protected function assertViewEmployeur(Intervenant $intervenant) + { + $typeIntervenantCode = $intervenant->getStatut()->getTypeIntervenant()->getCode(); + + return $this->asserts([ + $this->getRole()->hasPrivilege(Privileges::DOSSIER_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EMPLOYEUR_VISUALISATION), + ]); + } + + + + protected function assertEditAutre1(Intervenant $intervenant) + { + return $this->asserts([ + !$this->getServiceDossier()->getValidation($intervenant), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_1_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_1_EDITION), + ]); + } + + + + protected function assertViewAutre1(Intervenant $intervenant) + { + return $this->asserts([ + $this->getRole()->hasPrivilege(Privileges::DOSSIER_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_1_VISUALISATION), + ]); + } + + + + protected function assertEditAutre2(Intervenant $intervenant) + { + return $this->asserts([ + !$this->getServiceDossier()->getValidation($intervenant), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_2_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_2_EDITION), + ]); + } + + + + protected function assertViewAutre2(Intervenant $intervenant) + { + return $this->asserts([ + $this->getRole()->hasPrivilege(Privileges::DOSSIER_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_2_VISUALISATION), + ]); + } + + + + protected function assertEditAutre3(Intervenant $intervenant) + { + return $this->asserts([ + !$this->getServiceDossier()->getValidation($intervenant), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_3_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_3_EDITION), + ]); + } + + + + protected function assertViewAutre3(Intervenant $intervenant) + { + return $this->asserts([ + $this->getRole()->hasPrivilege(Privileges::DOSSIER_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_3_VISUALISATION), + ]); + } + + + + protected function assertEditAutre4(Intervenant $intervenant) + { + return $this->asserts([ + !$this->getServiceDossier()->getValidation($intervenant), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_4_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_4_EDITION), + ]); + } + + + + protected function assertViewAutre4(Intervenant $intervenant) + { + return $this->asserts([ + $this->getRole()->hasPrivilege(Privileges::DOSSIER_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_4_VISUALISATION), + ]); + } + + + + protected function assertEditAutre5(Intervenant $intervenant) + { + return $this->asserts([ + !$this->getServiceDossier()->getValidation($intervenant), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_EDITION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_5_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_5_EDITION), + ]); + } + + + + protected function assertViewAutre5(Intervenant $intervenant) + { + return $this->asserts([ + $this->getRole()->hasPrivilege(Privileges::DOSSIER_VISUALISATION), + $this->getRole()->hasPrivilege(Privileges::DOSSIER_CHAMP_AUTRE_5_VISUALISATION), + ]); + } + + + protected function assertCanValidate(Intervenant $intervenant) { - $isComplete = $this->getServiceIntervenantDossier()->isComplete($intervenant); - $isValidate = $this->getServiceIntervenantDossier()->getValidation($intervenant); + $completudeDossier = $this->getServiceDossier()->isComplete($intervenant); + $isValidate = $this->getServiceDossier()->getValidation($intervenant); + return $this->asserts([ - $isComplete, + $completudeDossier['dossier'], !$isValidate, $this->getRole()->hasPrivilege(Privileges::DOSSIER_VALIDATION), ]); @@ -273,8 +451,8 @@ class IntervenantDossierAssertion extends AbstractAssertion protected function assertCanDevalidate(Intervenant $intervenant) { - $isComplete = $this->getServiceIntervenantDossier()->isComplete($intervenant); - $isValidate = $this->getServiceIntervenantDossier()->getValidation($intervenant); + $isComplete = $this->getServiceDossier()->isComplete($intervenant); + $isValidate = $this->getServiceDossier()->getValidation($intervenant); return $this->asserts([ $isValidate, diff --git a/module/Application/src/Application/Controller/DossierController.php b/module/Application/src/Application/Controller/DossierController.php index 0e177bfb623b371b35b0d0e48899f84dbec14208..fd79cffdfaee41cf5850100df2b535fd6582e2cb 100755 --- a/module/Application/src/Application/Controller/DossierController.php +++ b/module/Application/src/Application/Controller/DossierController.php @@ -12,7 +12,6 @@ use Application\Form\Intervenant\Traits\DossierAwareTrait; use Application\Provider\Privilege\Privileges; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\DossierServiceAwareTrait; -use Application\Service\Traits\IntervenantDossierServiceAwareTrait; use Application\Service\Traits\ServiceServiceAwareTrait; use Application\Service\Traits\ValidationServiceAwareTrait; use Application\Service\Traits\WorkflowServiceAwareTrait; @@ -33,8 +32,6 @@ class DossierController extends AbstractController use ValidationServiceAwareTrait; use DossierAwareTrait; use UserContextServiceAwareTrait; - use IntervenantDossierServiceAwareTrait; - /** @@ -168,7 +165,10 @@ class DossierController extends AbstractController return compact('role', 'form', 'validation', 'canValider', 'canDevalider', 'canSupprimer', 'dossier'); } - public function indexnewAction(){ + + + public function indexnewAction() + { $this->initFilters(); /* Initialisation */ @@ -182,15 +182,14 @@ class DossierController extends AbstractController $form = $this->getFormIntervenantDossier(); - /* $form->bindRequestSave($intervenantDossier, $this->getRequest(), function (IntervenantDossier $id) { - try { - $this->getServiceIntervenantDossier()->save($id); - $this->flashMessenger()->addSuccessMessage('Enregistrement effectué'); - } catch (\Exception $e) { - $this->flashMessenger()->addErrorMessage($this->translate($e)); - } - });*/ - + /* $form->bindRequestSave($intervenantDossier, $this->getRequest(), function (IntervenantDossier $id) { + try { + $this->getServiceIntervenantDossier()->save($id); + $this->flashMessenger()->addSuccessMessage('Enregistrement effectué'); + } catch (\Exception $e) { + $this->flashMessenger()->addErrorMessage($this->translate($e)); + } + });*/ return compact('form', 'role', 'intervenant'); diff --git a/module/Application/src/Application/Controller/IntervenantDossierController.php b/module/Application/src/Application/Controller/IntervenantDossierController.php index 4c2d822a3eb0bda897b61dfcd3c3ff37ffa67340..62a850798c298b5003c14bba33bf400efe39b64e 100755 --- a/module/Application/src/Application/Controller/IntervenantDossierController.php +++ b/module/Application/src/Application/Controller/IntervenantDossierController.php @@ -59,6 +59,13 @@ class IntervenantDossierController extends AbstractController public function indexAction() { + + /** + * TODO : + * Remettre en place les bon required et les validator + * Sortir la gestion des champs autres de ce controller + * + */ $this->initFilters(); /* Initialisation */ @@ -69,16 +76,24 @@ class IntervenantDossierController extends AbstractController throw new \LogicException('Intervenant non précisé ou inexistant'); } /* Récupération du dossier de l'intervenant */ + $service = $this->getServiceDossier(); $intervenantDossier = $this->getServiceDossier()->getByIntervenant($intervenant); $intervenantDossierValidation = $this->getServiceDossier()->getValidation($intervenant); + $intervenantDossierStatut = $intervenantDossier->getStatut(); + $intervenantDossierCompletude = $this->getServiceDossier()->isComplete($intervenant); + + /* Initialisation du formulaire */ + $form = $this->getIntervenantDossierForm($intervenant); + $champsAutres = $intervenant->getStatut()->getChampsAutres(); /* Règles pour afficher ou non les fieldsets */ $fieldsetRules = [ 'fieldset-identite' => $intervenant->getStatut()->getDossierIdentite(), - 'fiedlset-adresse' => $intervenant->getStatut()->getDossierAdresse(), - 'fiedlset-contact' => $intervenant->getStatut()->getDossierContact(), - 'fiedlset-iban' => $intervenant->getStatut()->getDossierIban(), - 'fiedlset-insee' => $intervenant->getStatut()->getDossierInsee(), - 'fiedlset-employeur' => $intervenant->getStatut()->getDossierEmployeur(), + 'fieldset-adresse' => $intervenant->getStatut()->getDossierAdresse(), + 'fieldset-contact' => $intervenant->getStatut()->getDossierContact(), + 'fieldset-iban' => $intervenant->getStatut()->getDossierIban(), + 'fieldset-insee' => $intervenant->getStatut()->getDossierInsee(), + 'fieldset-employeur' => $intervenant->getStatut()->getDossierEmployeur(), + 'fieldset-autres' => (!empty($champsAutres)) ? 1 : 0,//Si le statut intervenant a au moins 1 champs autre ]; $privileges['edit'] = $this->isAllowed(Privileges::getResourceId(Privileges::DOSSIER_EDITION)); @@ -86,10 +101,6 @@ class IntervenantDossierController extends AbstractController $privileges['devalider'] = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_CAN_DEVALIDE); $privileges['supprimer'] = $this->isAllowed(Privileges::getResourceId(Privileges::DOSSIER_SUPPRESSION)); - /* Initialisation du formulaire */ - $form = $this->getIntervenantDossierForm($intervenant); - $champsAutres = $this->getServiceDossierAutre()->getList(); - /* Traitement du formulaire */ $form->bindRequestSave($intervenantDossier, $this->getRequest(), function (\Application\Entity\Db\IntervenantDossier $intervenantDossier) use ($intervenant) { @@ -119,7 +130,18 @@ class IntervenantDossierController extends AbstractController ); } - return compact('form', 'role', 'intervenant', 'intervenantDossier', 'intervenantDossierValidation', 'privileges', 'champsAutres', 'fieldsetRules'); + return compact( + ['form', + 'role', + 'intervenant', + 'intervenantDossier', + 'intervenantDossierValidation', + 'intervenantDossierStatut', + 'intervenantDossierCompletude', + 'privileges', + 'champsAutres', + 'fieldsetRules'] + ); } @@ -256,10 +278,9 @@ class IntervenantDossierController extends AbstractController public function dossierAutreSaisieAction() { - $dossierAutreList = $this->getServiceDossierAutre()->getList(); - $dossierAutre = $this->getEvent()->getParam('dossierAutre'); - $form = $this->getAutresForm(); - $title = 'Édition d\'un type de ressource'; + $dossierAutre = $this->getEvent()->getParam('dossierAutre'); + $form = $this->getAutresForm(); + $title = 'Édition d\'un type de ressource'; $form->bindRequestSave($dossierAutre, $this->getRequest(), function (DossierAutre $autre) { try { diff --git a/module/Application/src/Application/Form/Intervenant/AutresForm.php b/module/Application/src/Application/Form/Intervenant/AutresForm.php index 2859ee262008215359da507bc21efbd0dade2b52..b0dde51f5a142b5dbf973c210e9582882c5b1cd6 100755 --- a/module/Application/src/Application/Form/Intervenant/AutresForm.php +++ b/module/Application/src/Application/Form/Intervenant/AutresForm.php @@ -26,6 +26,7 @@ class AutresForm extends AbstractForm $hydrator = new DossierAutreHydrator(); $this->setHydrator($hydrator); + $this->setAttribute('action', $this->getCurrentUrl()); $this->add([ 'name' => 'libelle', diff --git a/module/Application/src/Application/Form/Intervenant/Dossier/DossierAutresFieldset.php b/module/Application/src/Application/Form/Intervenant/Dossier/DossierAutresFieldset.php index 96e6a9ad1ee8d8b84ead69a6827dad0e0d66f16c..568bade58090cc35cafa0101df76e4943f60638a 100755 --- a/module/Application/src/Application/Form/Intervenant/Dossier/DossierAutresFieldset.php +++ b/module/Application/src/Application/Form/Intervenant/Dossier/DossierAutresFieldset.php @@ -5,6 +5,7 @@ namespace Application\Form\Intervenant\Dossier; use Application\Form\AbstractFieldset; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\DossierAutreServiceAwareTrait; +use Application\Service\Traits\StatutIntervenantServiceAwareTrait; /** * Description of DossierAutresFieldset @@ -14,6 +15,7 @@ class DossierAutresFieldset extends AbstractFieldset { use ContextServiceAwareTrait; use DossierAutreServiceAwareTrait; + use StatutIntervenantServiceAwareTrait; public function init() { @@ -24,9 +26,9 @@ class DossierAutresFieldset extends AbstractFieldset private function addElements() { - $champsAutres = $this->getServiceDossierAutre()->getList(); - foreach ($champsAutres as $champ) { + $listChampsAutres = $this->getOption('listChampsAutres'); + foreach ($listChampsAutres as $champ) { $this->add([ 'name' => 'champ-autre-' . $champ->getId(), 'options' => [ diff --git a/module/Application/src/Application/Form/Intervenant/Dossier/DossierBancaireFieldset.php b/module/Application/src/Application/Form/Intervenant/Dossier/DossierBancaireFieldset.php index 55113f59a0a469989cc650a07e6800d6da846c24..69b202f39645a8d993d9d5a306ba39ede260b773 100755 --- a/module/Application/src/Application/Form/Intervenant/Dossier/DossierBancaireFieldset.php +++ b/module/Application/src/Application/Form/Intervenant/Dossier/DossierBancaireFieldset.php @@ -5,6 +5,7 @@ namespace Application\Form\Intervenant\Dossier; use Application\Form\AbstractFieldset; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Validator\RIBValidator; +use UnicaenApp\Validator\RIB; /** * Description of DossierBancaireFieldset @@ -19,6 +20,8 @@ class DossierBancaireFieldset extends AbstractFieldset $this->addElements(); } + + private function addElements() { $this->add([ @@ -54,16 +57,17 @@ class DossierBancaireFieldset extends AbstractFieldset ]); - return $this; } + + public function getInputFilterSpecification() { $spec = [ 'ribBic' => [ 'required' => false, - 'readonly' => true, + 'readonly' => true, 'filters' => [ ['name' => 'StringTrim'], ['name' => 'StringToUpper'], @@ -86,6 +90,10 @@ class DossierBancaireFieldset extends AbstractFieldset new RIBValidator(), ], ], + + 'ribHorsSepa' => [ + 'required' => false, + ], ]; return $spec; diff --git a/module/Application/src/Application/Form/Intervenant/Dossier/DossierContactFieldset.php b/module/Application/src/Application/Form/Intervenant/Dossier/DossierContactFieldset.php index e84da5a2d82c198c75b59841cb78d99219987414..4cf8b7d053b8e0a2831c61e64a0e499135463442 100755 --- a/module/Application/src/Application/Form/Intervenant/Dossier/DossierContactFieldset.php +++ b/module/Application/src/Application/Form/Intervenant/Dossier/DossierContactFieldset.php @@ -41,65 +41,65 @@ class DossierContactFieldset extends AbstractFieldset * Mail établissement */ $this->add([ - 'name' => 'emailEtablissement', - 'options' => [ + 'name' => 'emailEtablissement', + 'options' => [ 'label' => 'Mail établissement', ], 'attributes' => [ //'placeholder' => "Email établissement", - 'class' => 'form-control' + 'class' => 'form-control', ], - 'type' => Email::class, + 'type' => Email::class, ]); /** * Mail personnel */ $this->add([ - 'name' => 'emailPersonnel', - 'options' => [ + 'name' => 'emailPersonnel', + 'options' => [ 'label' => 'Mail personnel', ], 'attributes' => [ //'placeholder' => "Email établissement", - 'class' => 'form-control left-border-none' + 'class' => 'form-control left-border-none', ], - 'type' => Email::class + 'type' => Email::class, ]); /** * Téléphone professionnel */ $this->add([ - 'name' => 'telephoneProfessionnel', - 'options' => [ + 'name' => 'telephoneProfessionnel', + 'options' => [ 'label' => 'Téléphone professionnel', ], 'attributes' => [ //'placeholder' => "Email établissement", - 'class' => 'form-control left-border-none' + 'class' => 'form-control left-border-none', ], - 'type' => Tel::class, + 'type' => Tel::class, ]); /** * Téléphone personnel */ $this->add([ - 'name' => 'telephonePersonnel', - 'options' => [ + 'name' => 'telephonePersonnel', + 'options' => [ 'label' => 'Téléphone personnel', ], 'attributes' => [ //'placeholder' => "Email établissement", - 'class' => 'form-control left-border-none' + 'class' => 'form-control left-border-none', ], - 'type' => Tel::class, + 'type' => Tel::class, ]); return $this; @@ -116,17 +116,36 @@ class DossierContactFieldset extends AbstractFieldset public function getInputFilterSpecification() { $spec = [ - 'emailEtablissement' => [ - 'required' => false, + 'emailEtablissement' => [ + 'required' => false, + 'filters' => [ + ['name' => 'StringTrim'], + ], + 'validators' => [ + ['name' => 'EmailAddress'], + ], ], - 'emailPersonnel' => [ - 'required' => false, + 'emailPersonnel' => [ + 'required' => false, + 'filters' => [ + ['name' => 'StringTrim'], + ], + 'validators' => [ + ['name' => 'EmailAddress'], + ], ], - 'telephoneProfessionnel' => [ + 'telephoneProfessionnel' => [ 'required' => false, + 'filters' => [ + ['name' => 'StringTrim'], + ], + ], - 'telephonePersonnel' => [ + 'telephonePersonnel' => [ 'required' => false, + 'filters' => [ + ['name' => 'StringTrim'], + ], ], ]; diff --git a/module/Application/src/Application/Form/Intervenant/Dossier/DossierInseeFieldset.php b/module/Application/src/Application/Form/Intervenant/Dossier/DossierInseeFieldset.php index 9556a1bad74e07634244ef5bfdf7ab9cfccf01ab..4eff175c687613c8660a58da7a76789e89b70feb 100755 --- a/module/Application/src/Application/Form/Intervenant/Dossier/DossierInseeFieldset.php +++ b/module/Application/src/Application/Form/Intervenant/Dossier/DossierInseeFieldset.php @@ -20,6 +20,7 @@ class DossierInseeFieldset extends AbstractFieldset } + private function addElements() { $this->add([ @@ -59,13 +60,14 @@ class DossierInseeFieldset extends AbstractFieldset return $this; } + + public function getInputFilterSpecification() { - //$numeroInseeProvisoire = (bool)$this->get('numeroInseeEstProvisoire')->getValue(); - $numeroInseeProvisoire = true; - + $numeroInseeProvisoire = (bool)$this->get('numeroInseeEstProvisoire')->getValue(); + $spec = [ - 'numeroInsee' => [ + 'numeroInsee' => [ 'required' => false, 'validators' => [ new NumeroINSEEValidator([ @@ -73,12 +75,13 @@ class DossierInseeFieldset extends AbstractFieldset ]), ], ], - 'numeroInseeEstProvisoire' => [ - 'required' => false, + 'numeroInseeEstProvisoire' => [ + 'required' => false, ], ]; return $spec; + return []; } } \ No newline at end of file diff --git a/module/Application/src/Application/Form/Intervenant/IntervenantDossierForm.php b/module/Application/src/Application/Form/Intervenant/IntervenantDossierForm.php index a26c487494a17707d548506ce5a14b9a12c65af0..85c4ec7c7cc6d190400faac91db0fe9431e10d9a 100755 --- a/module/Application/src/Application/Form/Intervenant/IntervenantDossierForm.php +++ b/module/Application/src/Application/Form/Intervenant/IntervenantDossierForm.php @@ -91,15 +91,17 @@ class IntervenantDossierForm extends AbstractForm $this->dossierContactFiedlset = new DossierContactFieldset('DossierContact'); $this->dossierContactFiedlset->init(); + $this->dossierInseeFiedlset = new DossierInseeFieldset('DossierInsee'); $this->dossierInseeFiedlset->init(); + $this->dossierBancaireFieldset = new DossierBancaireFieldset('DossierBancaire'); $this->dossierBancaireFieldset->init(); $this->dossierEmployeurFieldset = new EmployeurFieldset('DossierEmployeur'); $this->dossierEmployeurFieldset->init(); - $this->dossierAutresFiedlset = new DossierAutresFieldset('DossierAutres'); + $this->dossierAutresFiedlset = new DossierAutresFieldset('DossierAutres', ['listChampsAutres' => $statutIntervenant->getChampsAutres()]); $this->dossierAutresFiedlset->init(); $this->setAttribute('id', 'dossier'); @@ -157,12 +159,6 @@ class IntervenantDossierForm extends AbstractForm public function isValid() { - if (!$this->serviceAuthorize->isAllowed(Privileges::getResourceId(Privileges::DOSSIER_BANQUE_VISUALISATION))) { - $inputFilterSpecification = $this->getInputFilter()->get('DossierBancaire')->remove('ribIban'); - $inputFilterSpecification = $this->getInputFilter()->get('DossierBancaire')->remove('ribBic'); - $inputFilterSpecification = $this->getInputFilter()->get('DossierBancaire')->remove('ribHorsSepa'); - } - return parent::isValid(); } diff --git a/module/Application/src/Application/Hydrator/IntervenantDossierHydrator.php b/module/Application/src/Application/Hydrator/IntervenantDossierHydrator.php index 0cb8555777cca40aabbf2b87af6fc4a113d83686..50554daf4349e81ed00ff47d5564677b36724da2 100755 --- a/module/Application/src/Application/Hydrator/IntervenantDossierHydrator.php +++ b/module/Application/src/Application/Hydrator/IntervenantDossierHydrator.php @@ -8,6 +8,7 @@ use Application\Service\Traits\AdresseNumeroComplServiceAwareTrait; use Application\Service\Traits\CiviliteServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\DepartementServiceAwareTrait; +use Application\Service\Traits\DossierServiceAwareTrait; use Application\Service\Traits\EmployeurServiceAwareTrait; use Application\Service\Traits\IntervenantDossierServiceAwareTrait; use Application\Service\Traits\PaysServiceAwareTrait; @@ -21,7 +22,7 @@ use Zend\Hydrator\HydratorInterface; */ class IntervenantDossierHydrator implements HydratorInterface { - use IntervenantDossierServiceAwareTrait; + use DossierServiceAwareTrait; use ContextServiceAwareTrait; use CiviliteServiceAwareTrait; use PaysServiceAwareTrait; @@ -100,15 +101,28 @@ class IntervenantDossierHydrator implements HydratorInterface ]; /* Extract fiedlset dossier bancaire*/ - $data['DossierEmployeur'] = [ - 'employeur' => [ - 'id' => $object->getEmployeur()->getId(), - 'label' => $object->getEmployeur()->getRaisonSociale(), - ], - ]; + if (array_key_exists('DossierEmployeur', $data)) { + $data['DossierEmployeur'] = [ + 'employeur' => [ + 'id' => $object->getEmployeur()->getId(), + 'label' => $object->getEmployeur()->getRaisonSociale(), + ], + ]; + } /* Extract statut intervenant */ - $data['statut'] = $object->getStatut()->getId(); + + $data['statut'] = (!empty($object->getStatut())) ? $object->getStatut()->getId() : ''; + + /* Extract Champs autres */ + /* Il faudra penser à gérer les champs de type select*/ + $data['DossierAutres'] = [ + 'champ-autre-1' => $object->getAutre1(), + 'champ-autre-2' => $object->getAutre2(), + 'champ-autre-3' => $object->getAutre3(), + 'champ-autre-4' => $object->getAutre4(), + 'champ-autre-5' => $object->getAutre5(), + ]; return $data; @@ -206,13 +220,26 @@ class IntervenantDossierHydrator implements HydratorInterface $object->setRibHorsSepa($data['DossierBancaire']['ribHorsSepa']); } - $employeur = $this->getServiceEmployeur()->get($data['DossierEmployeur']['employeur']['id']); - $object->setEmployeur($employeur); + if (isset($data['DossierEmployeur'])) { + $employeur = $this->getServiceEmployeur()->get($data['DossierEmployeur']['employeur']['id']); + $object->setEmployeur($employeur); + } //Hydratation statut if (!empty($data['statut'])) { $statut = $this->getServiceStatutIntervenant()->get($data['statut']); $object->setStatut($statut); + } else { + $object->setStatut(null); + } + + //Hydratation des champs autres + if (isset($data['DossierAutres'])) { + $object->setAutre1((isset($data['DossierAutres']['champ-autre-1'])) ? $data['DossierAutres']['champ-autre-1'] : ''); + $object->setAutre2((isset($data['DossierAutres']['champ-autre-2'])) ? $data['DossierAutres']['champ-autre-2'] : ''); + $object->setAutre3((isset($data['DossierAutres']['champ-autre-3'])) ? $data['DossierAutres']['champ-autre-3'] : ''); + $object->setAutre4((isset($data['DossierAutres']['champ-autre-4'])) ? $data['DossierAutres']['champ-autre-4'] : ''); + $object->setAutre5((isset($data['DossierAutres']['champ-autre-5'])) ? $data['DossierAutres']['champ-autre-5'] : ''); } return $object; diff --git a/module/Application/src/Application/Service/DossierService.php b/module/Application/src/Application/Service/DossierService.php index 44800caef0bab006f7978dc939817864c0ffd1bd..126646ea1cf3188f040063c2cfffdb98c60eeee3 100755 --- a/module/Application/src/Application/Service/DossierService.php +++ b/module/Application/src/Application/Service/DossierService.php @@ -152,9 +152,73 @@ class DossierService extends AbstractEntityService public function isComplete(Intervenant $intervenant) { + $intervenantDossier = $this->getByIntervenant($intervenant); - return true; + + $completude = [ + 'dossier' => false, + 'dossierIdentite' => false, + 'dossierAdresse' => false, + 'dossierContact' => false, + 'dossierInsee' => false, + 'dossierIban' => false, + 'dossierEmployeur' => false, + 'dossierAutres' => false, + ]; + //Complétude de l'identite + + $completudeDossierIdentie = ($intervenantDossier->getCivilite() && + $intervenantDossier->getNomUsuel() && + $intervenantDossier->getPrenom()) ? true : false; + + //Complétude de l'adresse + $completudeAdressePart1 = (($intervenantDossier->getAdressePrecisions() || + $intervenantDossier->getAdresseLieuDit() || + ($intervenantDossier->getAdresseVoie() && $intervenantDossier->getAdresseNumero()))) ? true : false; + + $completudeAdressePart2 = ($intervenantDossier->getAdresseCommune() && + $intervenantDossier->getAdresseCodePostal() && + $intervenantDossier->getAdressePays()) ? true : false; + + if ($completudeAdressePart1 && $completudeAdressePart2) { + $completudeDossierAdresse = true; + } + + //Complétude de contact + $completudeDossierContact = (($intervenantDossier->getEmailPerso() || $intervenantDossier->getEmailPro()) && + ($intervenantDossier->getTelPerso() || $intervenantDossier->getTelPro)) ? true : false; + + //Complétude Insee + $completudeDossierInsee = ($intervenantDossier->getNumeroInsee()) ? true : false; + + //Complétude Iban + $completudeDossierIban = true; + //Complètude Employeur + $completudeDossierEmployeur = false; + //Complétude Autres + $completudeDossierAutre = true; + + $completudeDossier = ($completudeDossierIdentie && + $completudeDossierAdresse && + $completudeDossierContact && + $completudeDossierInsee && + $completudeDossierIban && + $completudeDossierEmployeur && + $completudeDossierAutre) ? true : false; + + $completude = [ + 'dossier' => $completudeDossier, + 'dossierIdentite' => $completudeDossierIdentie, + 'dossierAdresse' => $completudeDossierAdresse, + 'dossierContact' => $completudeDossierContact, + 'dossierInsee' => $completudeDossierInsee, + 'dossierIban' => $completudeDossierIban, + 'dossierEmployeur' => $completudeDossierEmployeur, + 'dossierAutres' => $completudeDossierAutre, + ]; + + return $completude; } diff --git a/module/Application/src/Application/Service/IntervenantDossierService.php b/module/Application/src/Application/Service/IntervenantDossierService.php index 90648ad7109d0fcea30e15c696558b6e70f12f44..583e7fd55becb3d577416f827943cca53a75e8fd 100755 --- a/module/Application/src/Application/Service/IntervenantDossierService.php +++ b/module/Application/src/Application/Service/IntervenantDossierService.php @@ -129,9 +129,54 @@ class IntervenantDossierService extends AbstractEntityService public function isComplete(Intervenant $intervenant) { + $intervenantDossier = $this->getByIntervenant($intervenant); - return true; + + $completude = [ + 'dossier' => false, + 'dossierIdentite' => false, + 'dossierAdresse' => false, + 'dossierContact' => false, + 'dossierInsee' => false, + 'dossierIban' => false, + 'dossierEmployeur' => false, + 'dossierAutres' => false, + ]; + //Complétude de l'identite + + $completudeDossierIdentie = ($intervenantDossier->getCivilite() && + $intervenantDossier->getNomUsuel() && + $intervenantDossier->getPrenom()) ? true : false; + + //Complétude de l'adresse + $completudeAdressePart1 = (($intervenantDossier->getAdressePrecisions() || + $intervenantDossier->getAdresseLieuDit() || + ($intervenantDossier->getAdresseVoie() && $intervenantDossier->getAdresseNumero()))) ? true : false; + + $completudeAdressePart2 = ($intervenantDossier->getAdresseCommune() && + $intervenantDossier->getAdresseCodePostal()) ? true : false; + + if ($completudeAdressePart1 && $completudeAdressePart2) { + $completudeDossierAdresse = true; + } + + //Complétude de contact + $completudeDossierContact = (($intervenantDossier->getEmailPerso() || $intervenantDossier->getEmailPro()) && + ($intervenantDossier->getTelPerso() || $intervenantDossier->getTelPro)) ? true : false; + + $completude = [ + 'dossier' => false, + 'dossierIdentite' => $completudeDossierIdentie, + 'dossierAdresse' => $completudeDossierAdresse, + 'dossierContact' => $completudeDossierContact, + 'dossierInsee' => false, + 'dossierIban' => false, + 'dossierEmployeur' => false, + 'dossierAutres' => false, + ]; + + return $completude; } diff --git a/module/Application/view/application/intervenant-dossier/index.phtml b/module/Application/view/application/intervenant-dossier/index.phtml index 70c53460317e219e7299e9ecc93383f590327920..1f476365b883b7ea30408d8d78efade1f61abbf1 100755 --- a/module/Application/view/application/intervenant-dossier/index.phtml +++ b/module/Application/view/application/intervenant-dossier/index.phtml @@ -3,13 +3,14 @@ use Application\Assertion\IntervenantDossierAssertion; -$editIdentite = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_IDENTITE); -$editAdresse = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_ADRESSE); -$editContact = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_CONTACT); -$editInsee = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_INSEE); -$editIban = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_IBAN); -$canValider = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_CAN_VALIDE); -$canValider = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_CAN_VALIDE); +$editIdentite = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_IDENTITE); +$editAdresse = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_ADRESSE); +$editContact = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_CONTACT); +$editInsee = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_INSEE); +$editIban = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_IBAN); +$editEmployeur = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_EDIT_EMPLOYEUR); +$canValider = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_CAN_VALIDE); +$canValider = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_CAN_VALIDE); //$nextEtape = $validation ? WfEtape::CODE_DONNEES_PERSO_VALIDATION : WfEtape::CODE_DONNEES_PERSO_SAISIE; $nextEtape = ''; @@ -42,14 +43,14 @@ $fieldsets = $form->getFieldsets(); /** * Message Importance des données perso. */ - /*if (!$form->getObject()->getId()){ + if (!$form->getObject()->getId()) { $msg = "Ces données sont indispensables pour éditer %s contrat et mettre en paiement %s heures d'enseignement."; if ($role->getIntervenant()) { $this->messenger()->addMessage(sprintf($msg, 'votre', 'vos'), 'warning'); } else { $this->messenger()->addMessage(sprintf($msg, 'le', 'les'), 'warning'); } - }*/ + } echo $this->messenger()->addCurrentMessagesFromFlashMessenger()->addMessagesFromFlashMessenger(); @@ -59,105 +60,121 @@ $fieldsets = $form->getFieldsets(); <div class="row"> <div class="col-md-12"> + <p class="bg-info" style="padding:15px;"> + Pour commencer à remplir vos données personnelles vous devez choisir obligatoirement un statut. + </p> <?php echo $this->formControlGroup($form->get('statut')); ?> </div> </div> - <div class="row display-flex"> - <?php if ($fieldsetRules['fieldset-identite']): ?> - + <?php if (empty($intervenantDossierStatut)): ?> + <div class="row display-flex hidden"> + <?php else: ?> + <div class="row display-flex"> + <?php endif; ?> <?php - - if ($editIdentite) { - echo $this->partial('application/intervenant-dossier/partial/formIdentite', compact('form', 'intervenant', 'intervenantDossier')); - } else { - echo $this->partial('application/intervenant-dossier/partial/formIdentiteView', compact('form', 'intervenant', 'intervenantDossier')); + /*Fiedlset identite*/ + if ($fieldsetRules['fieldset-identite']) { + if ($editIdentite) { + echo $this->partial('application/intervenant-dossier/partial/formIdentite', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } else { + echo $this->partial('application/intervenant-dossier/partial/formIdentiteView', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } + } + /*Fieldset Adresse*/ + if ($fieldsetRules['fieldset-adresse']) { + if ($editAdresse) { + echo $this->partial('application/intervenant-dossier/partial/formAdresse', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } else { + echo $this->partial('application/intervenant-dossier/partial/formAdresseView', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } + } + /*Fieldset Contact*/ + if ($fieldsetRules['fieldset-contact']) { + if ($editContact) { + echo $this->partial('application/intervenant-dossier/partial/formContact', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } else { + echo $this->partial('application/intervenant-dossier/partial/formContactView', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } + } + /*Fiedlset Insee*/ + if ($fieldsetRules['fieldset-insee']) { + if ($editInsee) { + echo $this->partial('application/intervenant-dossier/partial/formInsee', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } else { + echo $this->partial('application/intervenant-dossier/partial/formInseeView', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } + } + if ($fieldsetRules['fieldset-iban']) { + if ($editIban) { + echo $this->partial('application/intervenant-dossier/partial/formBancaire', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } else { + echo $this->partial('application/intervenant-dossier/partial/formBancaireView', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } + } + /*Fiedlset Employeur*/ + if ($fieldsetRules['fieldset-employeur']) { + if ($editEmployeur) { + echo $this->partial('application/intervenant-dossier/partial/formEmployeur', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } else { + echo $this->partial('application/intervenant-dossier/partial/formEmployeurView', compact('form', 'intervenant', 'intervenantDossier', 'intervenantDossierCompletude')); + } + } + /*Fieldset Autres*/ + if ($fieldsetRules['fieldset-autres']) { + echo $this->partial('application/intervenant-dossier/partial/formAutres', compact('form', 'intervenant', 'intervenantDossier', 'champsAutres', 'intervenantDossierCompletude')); } - ?> - - <?php endif; ?> - - - <?php - if ($editAdresse) { - echo $this->partial('application/intervenant-dossier/partial/formAdresse', compact('form', 'intervenant', 'intervenantDossier')); - } else { - echo $this->partial('application/intervenant-dossier/partial/formAdresseView', compact('form', 'intervenant', 'intervenantDossier')); - } - if ($editContact) { - echo $this->partial('application/intervenant-dossier/partial/formContact', compact('form', 'intervenant', 'intervenantDossier')); - } else { - echo $this->partial('application/intervenant-dossier/partial/formContactView', compact('form', 'intervenant', 'intervenantDossier')); - } - ?> + ?> + </div> - <?php - if ($editInsee) { - echo $this->partial('application/intervenant-dossier/partial/formInsee', compact('form', 'intervenant', 'intervenantDossier')); - } else { - echo $this->partial('application/intervenant-dossier/partial/formInseeView', compact('form', 'intervenant', 'intervenantDossier')); - } - if ($editIban) { - echo $this->partial('application/intervenant-dossier/partial/formBancaire', compact('form', 'intervenant', 'intervenantDossier')); - } else { - echo $this->partial('application/intervenant-dossier/partial/formBancaireView', compact('form', 'intervenant', 'intervenantDossier')); - } - ?> + <div class="row"> + <div class="col-md-12"> + <?php + echo $this->formHidden($this->form->get('security')); + if ($privileges['edit']) { + echo $this->formSubmit($form->get('submit')); + } + + ?> + <?php if ($privileges['valider']): ?> + <a class="valider-dossier btn btn-success pop-ajax" + href="<?= $this->url('intervenant/dossier/valider', [], [], true) ?>" + title="Valider les données personnelles" + data-content="Confirmez-vous cette validation ?" + data-confirm="true" + data-confirm-button="Je confirme" + data-cancel-button="Non" + data-submit-reload="true" + > + <span class="glyphicon glyphicon-thumbs-up"></span> Je valide les données + </a> + <?php endif ?> + <!-- actions de dévalidation du dossier --> + <?php if ($privileges['devalider']): ?> + <a class="devalider-dossier btn btn-danger pop-ajax" + href="<?= $this->url('intervenant/dossier/devalider', [], [], true) ?>" + title="Dévalider les données personnelles" + data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette dévalidation ?</p>" + data-confirm="true" + data-confirm-button="Oui" + data-cancel-button="Non" + data-submit-reload="true" + > + <span class="glyphicon glyphicon-thumbs-down"></span> Je dévalide les données + </a> + <?php endif ?> + </div> + </div> <?php - echo $this->partial('application/intervenant-dossier/partial/formEmployeur', compact('form', 'intervenant', 'intervenantDossier')); - echo $this->partial('application/intervenant-dossier/partial/formAutres', compact('form', 'intervenant', 'intervenantDossier', 'champsAutres')); + echo $this->form()->closeTag(); + echo "<br/>"; + echo $this->feuilleDeRoute($intervenant)->renderNav($nextEtape); ?> + <?php if ($intervenantDossierValidation): ?> </div> - - <div class="row"> - <div class="col-md-12"> - <?php - echo $this->formHidden($this->form->get('security')); - if ($privileges['edit']) { - echo $this->formSubmit($form->get('submit')); - } - - ?> - <?php if ($privileges['valider']): ?> - <a class="valider-dossier btn btn-success pop-ajax" - href="<?= $this->url('intervenant/dossier/valider', [], [], true) ?>" - title="Valider les données personnelles" - data-content="Confirmez-vous cette validation ?" - data-confirm="true" - data-confirm-button="Je confirme" - data-cancel-button="Non" - data-submit-reload="true" - > - <span class="glyphicon glyphicon-thumbs-up"></span> Je valide les données - </a> - <?php endif ?> - <!-- actions de dévalidation du dossier --> - <?php if ($privileges['devalider']): ?> - <a class="devalider-dossier btn btn-danger pop-ajax" - href="<?= $this->url('intervenant/dossier/devalider', [], [], true) ?>" - title="Dévalider les données personnelles" - data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette dévalidation ?</p>" - data-confirm="true" - data-confirm-button="Oui" - data-cancel-button="Non" - data-submit-reload="true" - > - <span class="glyphicon glyphicon-thumbs-down"></span> Je dévalide les données - </a> - <?php endif ?> - </div> - </div> - - - <?php - echo $this->form()->closeTag(); - echo $this->feuilleDeRoute($intervenant)->renderNav($nextEtape); - ?> - <?php if ($intervenantDossierValidation): ?> -</div> <?php endif; ?> diff --git a/module/Application/view/application/intervenant-dossier/partial/formAdresse.phtml b/module/Application/view/application/intervenant-dossier/partial/formAdresse.phtml index f00003cc587a7e1055fbb3d255cd53691941a869..bc4d1fa18be0d3c087afbefc34622708dba5bceb 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formAdresse.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formAdresse.phtml @@ -7,7 +7,15 @@ $dossierAdresse = $form->get('DossierAdresse'); <!-- Fiedlset Adresse --> <div class="col-md-6"> - <h3>Adresse</h3> + <h3> + Adresse + <?php if (!$intervenantDossierCompletude['dossierAdresse']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> + <?= $this->formControlGroup($dossierAdresse->get('precisions')); ?> <?= $this->formControlGroup($dossierAdresse->get('lieuDit')); ?> <div class="row"> diff --git a/module/Application/view/application/intervenant-dossier/partial/formAdresseView.phtml b/module/Application/view/application/intervenant-dossier/partial/formAdresseView.phtml index 19c1d953e547a1513f9c366ee295c393dba20b55..b352e2e07c015347970b188c63a4abcb560f4ced 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formAdresseView.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formAdresseView.phtml @@ -24,7 +24,14 @@ $dossierAdresse = $form->get('DossierAdresse'); /* @var $dossier \Application\Fo <!-- Fiedlset Adresse --> <div class="col-md-6"> - <h3>Adresse</h3> + <h3> + Adresse + <?php if (!$intervenantDossierCompletude['dossierAdresse']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <div class="form-group"> <?= $this->formLabel($dossierAdresse->get('precisions')); ?> <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> diff --git a/module/Application/view/application/intervenant-dossier/partial/formAutres.phtml b/module/Application/view/application/intervenant-dossier/partial/formAutres.phtml index 109c3c8083054d5e5d06886c5651fe7006d3d041..022c03a9b04914c47d56062e254ba2033cd8a703 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formAutres.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formAutres.phtml @@ -1,5 +1,8 @@ <?php +use Application\Assertion\IntervenantDossierAssertion; + + /** * @var $this \Application\View\Renderer\PhpRenderer * @var $form \Application\Form\Intervenant\Dossier @@ -12,7 +15,7 @@ //$Dossier = $dossier; $form->prepare(); -$dossierInsee = $form->get('DossierAutres'); +$dossierAutres = $form->get('DossierAutres'); ?> <style> @@ -28,9 +31,36 @@ $dossierInsee = $form->get('DossierAutres'); <!-- Fiedlset Autres --> <div class="col-md-6"> - <h3>Autres</h3> + <?php if (count($champsAutres) > 0): ?> + <h3> + Autres + <?php if (!$intervenantDossierCompletude['dossierAutres']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <?php endif; ?> + <?php foreach ($champsAutres as $champ): ?> - <?= $this->formControlGroup($dossierInsee->get('champ-autre-' . $champ->getId())); ?> + <?php if (!$this->isAllowed($intervenant, constant('Application\Assertion\IntervenantDossierAssertion::PRIV_EDIT_AUTRE' . $champ->getId()))): ?> + <div class="form-group"> + <?= $this->formLabel($dossierAutres->get('champ-autre-' . $champ->getId())); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + $method = 'getAutre' . $champ->getId(); + $value = $intervenantDossier->$method(); + if (!empty($intervenantDossier->$method())) { + $viewAutre = $this->isAllowed($intervenant, constant('Application\Assertion\IntervenantDossierAssertion::PRIV_VIEW_AUTRE' . $champ->getId())); + echo ($viewAutre) ? $intervenantDossier->$method() : '***************'; + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> + <?php else: ?> + <?php echo $this->formControlGroup($dossierAutres->get('champ-autre-' . $champ->getId())); ?> + <?php endif; ?> <?php endforeach; ?> </div> diff --git a/module/Application/view/application/intervenant-dossier/partial/formBancaire.phtml b/module/Application/view/application/intervenant-dossier/partial/formBancaire.phtml index 9a467b0890c0211fb59639ab2fa256608e167649..3fa68506a40580dd0c47311c5bea8296eaf61be7 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formBancaire.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formBancaire.phtml @@ -17,7 +17,14 @@ $dossierBancaire = $form->get('DossierBancaire'); <!-- Fiedlset Bancaire --> <div class="col-md-6"> - <h3>Coordonnées bancaires</h3> + <h3> + Coordonnées bancaires + <?php if (!$intervenantDossierCompletude['dossierIban']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <?php /* if($viewIban) {*/ diff --git a/module/Application/view/application/intervenant-dossier/partial/formBancaireView.phtml b/module/Application/view/application/intervenant-dossier/partial/formBancaireView.phtml index bbcd5bed3857cfc5ff1d1c01df782bbd26ecebcc..b1fb536dcc5b5cf428155d490ea93028a2573a18 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formBancaireView.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formBancaireView.phtml @@ -25,7 +25,14 @@ $dossierBancaire = $form->get('DossierBancaire'); <!-- Fiedlset Bancaire --> <div class="col-md-6"> - <h3>Coordonnées bancaires</h3> + <h3> + Coordonnées bancaires + <?php if (!$intervenantDossierCompletude['dossierIban']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <div class="form-group"> <?= $this->formLabel($dossierBancaire->get('ribBic')); ?> <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> diff --git a/module/Application/view/application/intervenant-dossier/partial/formContact.phtml b/module/Application/view/application/intervenant-dossier/partial/formContact.phtml index 28f4c45d43de1e743ccbca606f954965bb639852..ce7269ef013445dfcacc756f209fee1ac919f26b 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formContact.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formContact.phtml @@ -28,7 +28,14 @@ $dossierContact = $form->get('DossierContact'); <!-- Fiedlset Contact --> <div class="col-md-6"> - <h3>Contact</h3> + <h3> + Contact + <?php if (!$intervenantDossierCompletude['dossierContact']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <div class="form-group"> <?= $this->formLabel($dossierContact->get('emailEtablissement')); ?> <div class="input-group"> diff --git a/module/Application/view/application/intervenant-dossier/partial/formContactView.phtml b/module/Application/view/application/intervenant-dossier/partial/formContactView.phtml index 5093387d8a21ca3bc3d34eea9d78ee05b0954070..275cc179dc8b06608d75476fd37575e6304193e0 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formContactView.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formContactView.phtml @@ -28,7 +28,14 @@ $dossierContact = $form->get('DossierContact'); <!-- Fiedlset Contact --> <div class="col-md-6"> - <h3>Contact</h3> + <h3> + Contact + <?php if (!$intervenantDossierCompletude['dossierContact']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <div class="form-group"> <?= $this->formLabel($dossierContact->get('emailEtablissement')); ?> <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> diff --git a/module/Application/view/application/intervenant-dossier/partial/formEmployeur.phtml b/module/Application/view/application/intervenant-dossier/partial/formEmployeur.phtml index bb88cfb01f4e158ed208565867b6fbb30fdc0c44..492fc38b4173278d862dedb9a0ad073adfe09553 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formEmployeur.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formEmployeur.phtml @@ -29,7 +29,14 @@ $dossierInsee = $form->get('DossierEmployeur'); <!-- Fiedlset Employeur --> <div class="col-md-6"> - <h3>Employeur</h3> + <h3> + Employeur + <?php if (!$intervenantDossierCompletude['dossierEmployeur']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <?= $this->formControlGroup($dossierInsee->get('employeur')); ?> diff --git a/module/Application/view/application/intervenant-dossier/partial/formEmployeurView.phtml b/module/Application/view/application/intervenant-dossier/partial/formEmployeurView.phtml new file mode 100755 index 0000000000000000000000000000000000000000..df41ef50c740ac3ea0a484e131bd1d53a0daf91b --- /dev/null +++ b/module/Application/view/application/intervenant-dossier/partial/formEmployeurView.phtml @@ -0,0 +1,61 @@ +<?php + +use Application\Assertion\IntervenantDossierAssertion; + +/** + * @var $this \Application\View\Renderer\PhpRenderer + * @var $form \Application\Form\Intervenant\Dossier + * @var $intervenantDossier \Application\Entity\Db\IntervenantDossier + * @var $canValider boolean + * @var $canDevalider boolean + * @var $canSupprimer boolean + * @var $dossier Dossier + */ +$viewEmployeur = $this->isAllowed($intervenant, IntervenantDossierAssertion::PRIV_VIEW_EMPLOYEUR); +$form->prepare(); +$dossierEmployeur = $form->get('DossierEmployeur'); + +?> + +<style> + div.rib-part { + display: inline-block; + vertical-align: top; + } + + div.rib-part input { + width: auto; + } +</style> + + +<!-- Fiedlset Employeur --> +<div class="col-md-6"> + <h3> + Employeur + <?php if (!$intervenantDossierCompletude['dossierEmployeur']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> + <div class="form-group"> + <?= $this->formLabel($dossierEmployeur->get('employeur')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getEmployeur())) { + $employeur = $intervenantDossier->getEmployeur()->getRaisonSociale(); + $siren = $intervenantDossier->getEmployeur()->getSiren(); + echo ($viewEmployeur) ? $employeur . '(SIRET : ' . $siren . ')' : '***************'; + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> +</div> + + + + + diff --git a/module/Application/view/application/intervenant-dossier/partial/formIdentite.phtml b/module/Application/view/application/intervenant-dossier/partial/formIdentite.phtml index 692920301d380572752a5485e4efa3f99067f226..5715c2b65ebed7cfe312ead33b4104e72e1f36cb 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formIdentite.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formIdentite.phtml @@ -11,7 +11,15 @@ $dossierIdentite = $form->get('DossierIdentite'); ?> <!-- Fiedlset Identite --> <div class="col-md-12"> - <h3>Identite</h3> + <h3> + Identité + <?php if (!$intervenantDossierCompletude['dossierIdentite']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> + <div class="row"> <div class="col-md-6"> <?= $this->formControlGroup($dossierIdentite->get('civilite')); ?> diff --git a/module/Application/view/application/intervenant-dossier/partial/formIdentiteView.phtml b/module/Application/view/application/intervenant-dossier/partial/formIdentiteView.phtml index 1af94b9293836cb1bf1a4e7fd460394cdc47c9ec..c45d471ddae01d1ec00d4c4d2ffa96b7c89fa9e4 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formIdentiteView.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formIdentiteView.phtml @@ -29,117 +29,128 @@ $dossierIdentite = $form->get('DossierIdentite'); <!-- Fiedlset Identite --> -<div class="col-md-6"> - - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('civilite')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getCivilite())) { - echo $intervenantDossier->getCivilite()->getLibelleCourt(); - } else { - echo 'NON RENSEIGNE'; - } - ?> +<div class="col-md-12"> + <h3> + Identité + <?php if (!$intervenantDossierCompletude['dossierIdentite']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> + <div class="row"> + <div class="col-md-6"> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('civilite')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getCivilite())) { + echo $intervenantDossier->getCivilite()->getLibelleCourt(); + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('nomUsuel')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getNomUsuel())) { + echo $intervenantDossier->getNomUsuel(); + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('nomPatronymique')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getNomPatronymique())) { + echo $intervenantDossier->getNomPatronymique(); + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('prenom')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getPrenom())) { + echo $intervenantDossier->getPrenom(); + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> </div> - </div> - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('nomUsuel')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getNomUsuel())) { - echo $intervenantDossier->getNomUsuel(); - } else { - echo 'NON RENSEIGNE'; - } - ?> - </div> - </div> - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('nomPatronymique')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getNomPatronymique())) { - echo $intervenantDossier->getNomPatronymique(); - } else { - echo 'NON RENSEIGNE'; - } - ?> - </div> - </div> - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('prenom')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getPrenom())) { - echo $intervenantDossier->getPrenom(); - } else { - echo 'NON RENSEIGNE'; - } - ?> - </div> - </div> -</div> -<div class="col-md-6"> - - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('dateNaissance')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($dossierIdentite->get('dateNaissance')->getValue())) { - echo ($viewIdentite) ? $dossierIdentite->get('dateNaissance')->getValue() : '**/**/****'; - } else { - echo 'NON RENSEIGNE'; - } - ?> - </div> - </div> - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('paysNaissance')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getPaysNaissance())) { - echo ($viewIdentite) ? $intervenantDossier->getPaysNaissance()->getLibelle() : '*******************'; - } else { - echo 'NON RENSEIGNE'; - } - - - ?> - </div> - </div> - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('departementNaissance')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getDepartementNaissance())) { - echo ($viewIdentite) ? $intervenantDossier->getDepartementNaissance()->getLibelle() : '*******************'; - } else { - echo 'NON RENSEIGNE'; - } - - - ?> - </div> - </div> - <div class="form-group"> - <?= $this->formLabel($dossierIdentite->get('villeNaissance')); ?> - <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> - <?php - if (!empty($intervenantDossier->getCommuneNaissance())) { - echo ($viewIdentite) ? $intervenantDossier->getCommuneNaissance() : '*******************'; - } else { - echo 'NON RENSEIGNE'; - } - - - ?> + + <div class="col-md-6"> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('dateNaissance')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($dossierIdentite->get('dateNaissance')->getValue())) { + echo ($viewIdentite) ? $dossierIdentite->get('dateNaissance')->getValue() : '**/**/****'; + } else { + echo 'NON RENSEIGNE'; + } + ?> + </div> + </div> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('paysNaissance')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getPaysNaissance())) { + echo ($viewIdentite) ? $intervenantDossier->getPaysNaissance()->getLibelle() : '*******************'; + } else { + echo 'NON RENSEIGNE'; + } + + + ?> + </div> + </div> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('departementNaissance')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getDepartementNaissance())) { + echo ($viewIdentite) ? $intervenantDossier->getDepartementNaissance()->getLibelle() : '*******************'; + } else { + echo 'NON RENSEIGNE'; + } + + + ?> + </div> + </div> + <div class="form-group"> + <?= $this->formLabel($dossierIdentite->get('villeNaissance')); ?> + <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;"> + <?php + if (!empty($intervenantDossier->getCommuneNaissance())) { + echo ($viewIdentite) ? $intervenantDossier->getCommuneNaissance() : '*******************'; + } else { + echo 'NON RENSEIGNE'; + } + + + ?> + </div> + </div> </div> </div> +</div> -</div> diff --git a/module/Application/view/application/intervenant-dossier/partial/formInsee.phtml b/module/Application/view/application/intervenant-dossier/partial/formInsee.phtml index 7075f671e5f877126e312e5d8c60c423d05bc1a9..ba97a33a626e116609af6969155bd69a3795b852 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formInsee.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formInsee.phtml @@ -18,8 +18,14 @@ $dossierInsee = $form->get('DossierInsee'); <!-- Fiedlset Insee --> <div class="col-md-6"> - <h3>Insee</h3> - <?php + <h3> + Insee + <?php if (!$intervenantDossierCompletude['dossierInsee']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <?php echo $this->formControlGroup($dossierInsee->get('numeroInsee')); echo $this->formControlGroup($dossierInsee->get('numeroInseeEstProvisoire')); ?> diff --git a/module/Application/view/application/intervenant-dossier/partial/formInseeView.phtml b/module/Application/view/application/intervenant-dossier/partial/formInseeView.phtml index 790e5e0112f1ba196dff054709352d0149ae9f40..85b9b92dbe6833d297b842eb544279842de0e779 100755 --- a/module/Application/view/application/intervenant-dossier/partial/formInseeView.phtml +++ b/module/Application/view/application/intervenant-dossier/partial/formInseeView.phtml @@ -25,7 +25,14 @@ $dossierInsee = $form->get('DossierInsee'); <!-- Fiedlset Insee --> <div class="col-md-6"> - <h3>Insee</h3> + <h3> + Insee + <?php if (!$intervenantDossierCompletude['dossierInsee']): ?> + <small><span class="label label-warning">A compléter</span></small> + <?php else: ?> + <small><span class="label label-success">Complet</span></small> + <?php endif; ?> + </h3> <div class="form-group"> <?= $this->formLabel($dossierInsee->get('numeroInsee')); ?> <div class="input-group cold-md-6" style="display:block;background-color:#eee;padding:5px;">