Loading module/Application/src/Application/Form/CentreCout/CentreCoutSaisieForm.php +1 −70 Changes for module/Application/src/Application/Form/CentreCout/CentreCoutSaisieForm.php: 1 added line, 70 removed lines. Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ namespace Application\Form\CentreCout; use Application\Form\AbstractForm; use Application\Hydrator\CentreCoutHydrator; use Zend\Form\Element\Csrf; use Zend\Hydrator\HydratorInterface; use Application\Service\Traits\CcActiviteServiceAwareTrait; use Application\Service\Traits\TypeRessourceServiceAwareTrait; use Application\Service\Traits\CentreCoutServiceAwareTrait; Loading Loading @@ -139,72 +139,3 @@ class CentreCoutSaisieForm extends AbstractForm } } No newline at end of file class CentreCoutHydrator implements HydratorInterface { use CcActiviteServiceAwareTrait; use TypeRessourceServiceAwareTrait; use CentreCoutServiceAwareTrait; use SourceServiceAwareTrait; /** * Hydrate $object with the provided $data. * * @param array $data * @param \Application\Entity\Db\CentreCout $object * * @return object */ public function hydrate(array $data, $object) { $object->setCode($data['code']); $object->setLibelle($data['libelle']); $object->setSourceCode($data['code']); $object->setUniteBudgetaire($data['unite-budgetaire']); if (array_key_exists('activite', $data)) { $object->setActivite($this->getServiceccActivite()->get($data['activite'])); } if (array_key_exists('type-ressource', $data)) { $object->setTypeRessource($this->getServiceTypeRessource()->get($data['type-ressource'])); } if (array_key_exists('parent', $data)) { $object->setParent($this->getServiceCentreCout()->get($data['parent'])); } $object->setSource($this->getServiceSource()->getOse()); return $object; } /** * Extract values from an object * * @param \Application\Entity\Db\CentreCout $object * * @return array */ public function extract($object) { $data = [ 'id' => $object->getId(), 'code' => $object->getCode(), 'libelle' => $object->getLibelle(), 'source-code' => $object->getSourceCode(), 'unite-budgetaire' => $object->getUniteBudgetaire(), 'activite' => ($s = $object->getActivite()) ? $s->getId() : null, 'type-ressource' => ($s = $object->getTypeRessource()) ? $s->getId() : null, 'parent' => ($s = $object->getParent()) ? $s->getId() : null, ]; return $data; } } No newline at end of file module/Application/view/application/statut-intervenant/index.phtml +1 −1 Changes for module/Application/view/application/statut-intervenant/index.phtml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_ST data-id="<?php echo $ti->getId() ?>" onclick="injecte(this); "> <?php echo '<span class="badge">'.$ti->getTypeIntervenant()->getLibelle().'</span> '.$ti->getLibelle(); echo '<span class="badge">'.$ti->getTypeIntervenant()->getLibelle().'</span><span class="statut-libelle-'.$ti->getId().'"> '.$ti->getLibelle() . '</span>'; if ($canEdit) { echo '<span class="pull-right glyphicon glyphicon-move"'; echo 'title = "Vous pouvez trier les champs en déplaçant les lignes" ></span > '; Loading module/Application/view/application/statut-intervenant/saisie.phtml +1 Changes for module/Application/view/application/statut-intervenant/saisie.phtml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -143,5 +143,6 @@ echo $this->form()->openTag($form); ?> console.log('toto'); window.location.reload(); }); $(".statut-libelle-<?= $form->get('id')->getValue() ?>").html("<?= $form->get('libelle')->getValue() ?>"); }); </script> Loading
module/Application/src/Application/Form/CentreCout/CentreCoutSaisieForm.php +1 −70 Changes for module/Application/src/Application/Form/CentreCout/CentreCoutSaisieForm.php: 1 added line, 70 removed lines. Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ namespace Application\Form\CentreCout; use Application\Form\AbstractForm; use Application\Hydrator\CentreCoutHydrator; use Zend\Form\Element\Csrf; use Zend\Hydrator\HydratorInterface; use Application\Service\Traits\CcActiviteServiceAwareTrait; use Application\Service\Traits\TypeRessourceServiceAwareTrait; use Application\Service\Traits\CentreCoutServiceAwareTrait; Loading Loading @@ -139,72 +139,3 @@ class CentreCoutSaisieForm extends AbstractForm } } No newline at end of file class CentreCoutHydrator implements HydratorInterface { use CcActiviteServiceAwareTrait; use TypeRessourceServiceAwareTrait; use CentreCoutServiceAwareTrait; use SourceServiceAwareTrait; /** * Hydrate $object with the provided $data. * * @param array $data * @param \Application\Entity\Db\CentreCout $object * * @return object */ public function hydrate(array $data, $object) { $object->setCode($data['code']); $object->setLibelle($data['libelle']); $object->setSourceCode($data['code']); $object->setUniteBudgetaire($data['unite-budgetaire']); if (array_key_exists('activite', $data)) { $object->setActivite($this->getServiceccActivite()->get($data['activite'])); } if (array_key_exists('type-ressource', $data)) { $object->setTypeRessource($this->getServiceTypeRessource()->get($data['type-ressource'])); } if (array_key_exists('parent', $data)) { $object->setParent($this->getServiceCentreCout()->get($data['parent'])); } $object->setSource($this->getServiceSource()->getOse()); return $object; } /** * Extract values from an object * * @param \Application\Entity\Db\CentreCout $object * * @return array */ public function extract($object) { $data = [ 'id' => $object->getId(), 'code' => $object->getCode(), 'libelle' => $object->getLibelle(), 'source-code' => $object->getSourceCode(), 'unite-budgetaire' => $object->getUniteBudgetaire(), 'activite' => ($s = $object->getActivite()) ? $s->getId() : null, 'type-ressource' => ($s = $object->getTypeRessource()) ? $s->getId() : null, 'parent' => ($s = $object->getParent()) ? $s->getId() : null, ]; return $data; } } No newline at end of file
module/Application/view/application/statut-intervenant/index.phtml +1 −1 Changes for module/Application/view/application/statut-intervenant/index.phtml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_ST data-id="<?php echo $ti->getId() ?>" onclick="injecte(this); "> <?php echo '<span class="badge">'.$ti->getTypeIntervenant()->getLibelle().'</span> '.$ti->getLibelle(); echo '<span class="badge">'.$ti->getTypeIntervenant()->getLibelle().'</span><span class="statut-libelle-'.$ti->getId().'"> '.$ti->getLibelle() . '</span>'; if ($canEdit) { echo '<span class="pull-right glyphicon glyphicon-move"'; echo 'title = "Vous pouvez trier les champs en déplaçant les lignes" ></span > '; Loading
module/Application/view/application/statut-intervenant/saisie.phtml +1 Changes for module/Application/view/application/statut-intervenant/saisie.phtml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -143,5 +143,6 @@ echo $this->form()->openTag($form); ?> console.log('toto'); window.location.reload(); }); $(".statut-libelle-<?= $form->get('id')->getValue() ?>").html("<?= $form->get('libelle')->getValue() ?>"); }); </script>