Loading data/privileges.php +4 Changes for data/privileges.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -342,6 +342,10 @@ return [ 'periodes-visualisation' => 'Périodes - Visualisation', 'etablissement-edition' => 'Établissement - Édition', 'etablissement-visualisation' => 'Établissement - Visualisation', 'Pays-visualisation' => 'Pays - Visualisation', 'Pays-edition' => 'Pays - Édition', 'Departement-visualisation' => 'Departement - Visualisation', 'Departement-edition' => 'Departement - Édition', ], ], Loading module/Application/config/administration.config.php +19 Changes for module/Application/config/administration.config.php: 19 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -168,6 +168,22 @@ return [ 'order' => 86, 'border - color' => '#111', ], 'gestion-pays' => [ 'label' => 'Gestion des Pays', 'icon' => 'fas fa-table-list', 'route' => 'pays', 'resource' => PrivilegeController::getResourceId('Application\Controller\Pays', 'index'), 'order' => 87, 'border - color' => '#111', ], 'gestion-departement' => [ 'label' => 'Gestion des Pays', 'icon' => 'fas fa-table-list', 'route' => 'departement', 'resource' => PrivilegeController::getResourceId('Application\Controller\Departement', 'index'), 'order' => 88, 'border - color' => '#111', ], 'gestion-intervenant' => [ 'label' => 'Gestion intervenants (Statuts, PJ, etc...)', 'icon' => 'fas fa-table-list', Loading Loading @@ -254,6 +270,7 @@ return [ 'administration-nomenclature-rh', 'administration-periode', 'administration-etablissement', 'administration-pays', 'administration-type-formation',], 'privileges' => [ Privileges::IMPORT_ECARTS, Loading Loading @@ -287,6 +304,8 @@ return [ Privileges::ODF_TYPE_FORMATION_VISUALISATION, Privileges::STRUCTURES_ADMINISTRATION_VISUALISATION, Privileges::PARAMETRES_PERIODES_VISUALISATION, Privileges::PARAMETRES_PAYS_VISUALISATION, Privileges::PARAMETRES_DEPARTEMENT_VISUALISATION, Privileges::INTERVENANT_STATUT_VISUALISATION, ], 'assertion' => Assertion\GestionAssertion::class, Loading module/Application/config/pays.config.php +x+85 Changes for module/Application/config/pays.config.php: 85 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application; use UnicaenAuth\Guard\PrivilegeController; use Application\Provider\Privilege\Privileges; return [ 'router' => [ 'routes' => [ 'pays' => [ 'type' => 'Literal', 'options' => [ 'route' => '/pays', 'defaults' => [ 'controller' => 'Application\Controller\Pays', 'action' => 'index', ], ], 'may_terminate' => true, 'child_routes' => [ 'modifier' => [ 'type' => 'Segment', 'options' => [ 'route' => '/modifier/:id', 'constraints' => [ 'id' => '[0-9]*', ], 'defaults' => [ 'action' => 'modifier', ], ], ], 'saisie' => [ 'type' => 'Segment', 'options' => [ 'route' => '/saisie[/:pays]', 'defaults' => [ 'action' => 'saisie', ], ], 'may_terminate' => true, ], 'supprimer' => [ 'type' => 'Segment', 'options' => [ 'route' => '/supprimer/:pays', 'defaults' => [ 'action' => 'supprimer', ], ], 'may_terminate' => true, ], ], ], ], ], 'bjyauthorize' => [ 'guards' => [ PrivilegeController::class => [ [ 'controller' => 'Application\Controller\Pays', 'action' => ['index'], 'privileges' => [Privileges::PARAMETRES_PAYS_VISUALISATION], ], [ 'controller' => 'Application\Controller\Pays', 'action' => ['saisie', 'supprimer'], 'privileges' => [Privileges::PARAMETRES_PAYS_EDITION], ], ], ], ], 'controllers' => [ 'invokables' => [ 'Application\Controller\Pays' => Controller\PaysController::class, ], ], 'service_manager' => [ 'invokables' => [ Service\PaysService::class => Service\PaysService::class, ], ], ]; module/Application/src/Controller/PaysController.php +x+69 Changes for module/Application/src/Controller/PaysController.php: 69 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Controller; use Application\Form\Pays\Traits\PaysSaisieFormAwareTrait; use Application\Service\Traits\PaysServiceAwareTrait; use UnicaenApp\View\Model\MessengerViewModel; /** * Description of PaysController * * @author Florian Joriot <florian.joriot at unicaen.fr> */ class PaysController extends AbstractController { use \Application\Service\Traits\ContextServiceAwareTrait; use \Application\Service\Traits\PaysServiceAwareTrait; use PaysSaisieFormAwareTrait; use PaysServiceAwareTrait; public function indexAction() { $query = $this->em()->createQuery('SELECT p FROM Application\Entity\Db\Pays p WHERE p.histoDestruction is null'); $payss = $query->getResult(); return compact('payss'); } public function saisieAction() { $pays = $this->getEvent()->getParam('pays'); $form = $this->getFormPaysSaisie(); if (empty($pays)) { $title = "Création d'un nouveau pays"; $pays = $this->getServicePays()->newEntity(); } else { $title = "Edition d'un pays"; } $form->bindRequestSave($pays, $this->getRequest(), function () use ($pays, $form) { try { if ($pays->getSourceCode() == null) { $pays->setSourceCode($pays->getCode()); } $this->getServicePays()->save($pays); $this->flashMessenger()->addSuccessMessage( "Ajout réussis" ); } catch (Exception $e) { $this->flashMessenger()->addErrorMessage($this->translate($e)); } }); return compact('form', 'title'); } public function supprimerAction() { $pays = $this->getEvent()->getParam('pays'); $this->getServicePays()->delete($pays, true); return new MessengerViewModel(); } } No newline at end of file module/Application/src/Entity/Db/Pays.php +22 −19 Changes for module/Application/src/Entity/Db/Pays.php: 22 added lines, 19 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Application\Entity\Db; use DateTime; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface; Loading @@ -18,34 +19,34 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface use ImportAwareTrait; /** * @var int|null * @var integer */ protected $id; protected ?int $id = null; /** * @var string */ protected $code; protected ?string $code = null; /** * @var string|null */ protected $libelle; protected ?string $libelle = null; /** * @var bool|null */ protected $temoinUe; protected ?bool $temoinUe = false; /** * @var \DateTime|null * @var DateTime|null */ protected $validiteDebut; protected ?DateTime $validiteDebut = null; /** * @var \DateTime|null * @var DateTime|null */ protected $validiteFin; protected ?DateTime $validiteFin = null; Loading @@ -57,6 +58,8 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface return $this->id; } /** * @param int|null $id * Loading @@ -74,7 +77,7 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @return string */ public function getCode(): string public function getCode(): ?string { return $this->code; } Loading @@ -86,7 +89,7 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface * * @return Pays */ public function setCode(string $code): Pays public function setCode(?string $code): Pays { $this->code = $code; Loading Loading @@ -144,9 +147,9 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @return \DateTime|null * @return DateTime|null */ public function getValiditeDebut(): ?\DateTime public function getValiditeDebut(): ?DateTime { return $this->validiteDebut; } Loading @@ -154,11 +157,11 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @param \DateTime|null $validiteDebut * @param DateTime|null $validiteDebut * * @return Pays */ public function setValiditeDebut(?\DateTime $validiteDebut): Pays public function setValiditeDebut(?DateTime $validiteDebut): Pays { $this->validiteDebut = $validiteDebut; Loading @@ -168,9 +171,9 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @return \DateTime|null * @return DateTime|null */ public function getValiditeFin(): ?\DateTime public function getValiditeFin(): ?DateTime { return $this->validiteFin; } Loading @@ -178,11 +181,11 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @param \DateTime|null $validiteFin * @param DateTime|null $validiteFin * * @return Pays */ public function setValiditeFin(?\DateTime $validiteFin): Pays public function setValiditeFin(?DateTime $validiteFin): Pays { $this->validiteFin = $validiteFin; Loading Loading
data/privileges.php +4 Changes for data/privileges.php: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -342,6 +342,10 @@ return [ 'periodes-visualisation' => 'Périodes - Visualisation', 'etablissement-edition' => 'Établissement - Édition', 'etablissement-visualisation' => 'Établissement - Visualisation', 'Pays-visualisation' => 'Pays - Visualisation', 'Pays-edition' => 'Pays - Édition', 'Departement-visualisation' => 'Departement - Visualisation', 'Departement-edition' => 'Departement - Édition', ], ], Loading
module/Application/config/administration.config.php +19 Changes for module/Application/config/administration.config.php: 19 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -168,6 +168,22 @@ return [ 'order' => 86, 'border - color' => '#111', ], 'gestion-pays' => [ 'label' => 'Gestion des Pays', 'icon' => 'fas fa-table-list', 'route' => 'pays', 'resource' => PrivilegeController::getResourceId('Application\Controller\Pays', 'index'), 'order' => 87, 'border - color' => '#111', ], 'gestion-departement' => [ 'label' => 'Gestion des Pays', 'icon' => 'fas fa-table-list', 'route' => 'departement', 'resource' => PrivilegeController::getResourceId('Application\Controller\Departement', 'index'), 'order' => 88, 'border - color' => '#111', ], 'gestion-intervenant' => [ 'label' => 'Gestion intervenants (Statuts, PJ, etc...)', 'icon' => 'fas fa-table-list', Loading Loading @@ -254,6 +270,7 @@ return [ 'administration-nomenclature-rh', 'administration-periode', 'administration-etablissement', 'administration-pays', 'administration-type-formation',], 'privileges' => [ Privileges::IMPORT_ECARTS, Loading Loading @@ -287,6 +304,8 @@ return [ Privileges::ODF_TYPE_FORMATION_VISUALISATION, Privileges::STRUCTURES_ADMINISTRATION_VISUALISATION, Privileges::PARAMETRES_PERIODES_VISUALISATION, Privileges::PARAMETRES_PAYS_VISUALISATION, Privileges::PARAMETRES_DEPARTEMENT_VISUALISATION, Privileges::INTERVENANT_STATUT_VISUALISATION, ], 'assertion' => Assertion\GestionAssertion::class, Loading
module/Application/config/pays.config.php +x+85 Changes for module/Application/config/pays.config.php: 85 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application; use UnicaenAuth\Guard\PrivilegeController; use Application\Provider\Privilege\Privileges; return [ 'router' => [ 'routes' => [ 'pays' => [ 'type' => 'Literal', 'options' => [ 'route' => '/pays', 'defaults' => [ 'controller' => 'Application\Controller\Pays', 'action' => 'index', ], ], 'may_terminate' => true, 'child_routes' => [ 'modifier' => [ 'type' => 'Segment', 'options' => [ 'route' => '/modifier/:id', 'constraints' => [ 'id' => '[0-9]*', ], 'defaults' => [ 'action' => 'modifier', ], ], ], 'saisie' => [ 'type' => 'Segment', 'options' => [ 'route' => '/saisie[/:pays]', 'defaults' => [ 'action' => 'saisie', ], ], 'may_terminate' => true, ], 'supprimer' => [ 'type' => 'Segment', 'options' => [ 'route' => '/supprimer/:pays', 'defaults' => [ 'action' => 'supprimer', ], ], 'may_terminate' => true, ], ], ], ], ], 'bjyauthorize' => [ 'guards' => [ PrivilegeController::class => [ [ 'controller' => 'Application\Controller\Pays', 'action' => ['index'], 'privileges' => [Privileges::PARAMETRES_PAYS_VISUALISATION], ], [ 'controller' => 'Application\Controller\Pays', 'action' => ['saisie', 'supprimer'], 'privileges' => [Privileges::PARAMETRES_PAYS_EDITION], ], ], ], ], 'controllers' => [ 'invokables' => [ 'Application\Controller\Pays' => Controller\PaysController::class, ], ], 'service_manager' => [ 'invokables' => [ Service\PaysService::class => Service\PaysService::class, ], ], ];
module/Application/src/Controller/PaysController.php +x+69 Changes for module/Application/src/Controller/PaysController.php: 69 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Application\Controller; use Application\Form\Pays\Traits\PaysSaisieFormAwareTrait; use Application\Service\Traits\PaysServiceAwareTrait; use UnicaenApp\View\Model\MessengerViewModel; /** * Description of PaysController * * @author Florian Joriot <florian.joriot at unicaen.fr> */ class PaysController extends AbstractController { use \Application\Service\Traits\ContextServiceAwareTrait; use \Application\Service\Traits\PaysServiceAwareTrait; use PaysSaisieFormAwareTrait; use PaysServiceAwareTrait; public function indexAction() { $query = $this->em()->createQuery('SELECT p FROM Application\Entity\Db\Pays p WHERE p.histoDestruction is null'); $payss = $query->getResult(); return compact('payss'); } public function saisieAction() { $pays = $this->getEvent()->getParam('pays'); $form = $this->getFormPaysSaisie(); if (empty($pays)) { $title = "Création d'un nouveau pays"; $pays = $this->getServicePays()->newEntity(); } else { $title = "Edition d'un pays"; } $form->bindRequestSave($pays, $this->getRequest(), function () use ($pays, $form) { try { if ($pays->getSourceCode() == null) { $pays->setSourceCode($pays->getCode()); } $this->getServicePays()->save($pays); $this->flashMessenger()->addSuccessMessage( "Ajout réussis" ); } catch (Exception $e) { $this->flashMessenger()->addErrorMessage($this->translate($e)); } }); return compact('form', 'title'); } public function supprimerAction() { $pays = $this->getEvent()->getParam('pays'); $this->getServicePays()->delete($pays, true); return new MessengerViewModel(); } } No newline at end of file
module/Application/src/Entity/Db/Pays.php +22 −19 Changes for module/Application/src/Entity/Db/Pays.php: 22 added lines, 19 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Application\Entity\Db; use DateTime; use UnicaenApp\Entity\HistoriqueAwareInterface; use UnicaenApp\Entity\HistoriqueAwareTrait; use UnicaenImport\Entity\Db\Interfaces\ImportAwareInterface; Loading @@ -18,34 +19,34 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface use ImportAwareTrait; /** * @var int|null * @var integer */ protected $id; protected ?int $id = null; /** * @var string */ protected $code; protected ?string $code = null; /** * @var string|null */ protected $libelle; protected ?string $libelle = null; /** * @var bool|null */ protected $temoinUe; protected ?bool $temoinUe = false; /** * @var \DateTime|null * @var DateTime|null */ protected $validiteDebut; protected ?DateTime $validiteDebut = null; /** * @var \DateTime|null * @var DateTime|null */ protected $validiteFin; protected ?DateTime $validiteFin = null; Loading @@ -57,6 +58,8 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface return $this->id; } /** * @param int|null $id * Loading @@ -74,7 +77,7 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @return string */ public function getCode(): string public function getCode(): ?string { return $this->code; } Loading @@ -86,7 +89,7 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface * * @return Pays */ public function setCode(string $code): Pays public function setCode(?string $code): Pays { $this->code = $code; Loading Loading @@ -144,9 +147,9 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @return \DateTime|null * @return DateTime|null */ public function getValiditeDebut(): ?\DateTime public function getValiditeDebut(): ?DateTime { return $this->validiteDebut; } Loading @@ -154,11 +157,11 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @param \DateTime|null $validiteDebut * @param DateTime|null $validiteDebut * * @return Pays */ public function setValiditeDebut(?\DateTime $validiteDebut): Pays public function setValiditeDebut(?DateTime $validiteDebut): Pays { $this->validiteDebut = $validiteDebut; Loading @@ -168,9 +171,9 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @return \DateTime|null * @return DateTime|null */ public function getValiditeFin(): ?\DateTime public function getValiditeFin(): ?DateTime { return $this->validiteFin; } Loading @@ -178,11 +181,11 @@ class Pays implements HistoriqueAwareInterface, ImportAwareInterface /** * @param \DateTime|null $validiteFin * @param DateTime|null $validiteFin * * @return Pays */ public function setValiditeFin(?\DateTime $validiteFin): Pays public function setValiditeFin(?DateTime $validiteFin): Pays { $this->validiteFin = $validiteFin; Loading