Commit 2b58e973 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Nettoyage de Element\Application

parent 1f3745ce
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -53,8 +53,25 @@ JOIN unicaen_privilege_categorie cp ON cp.CODE = 'metier';
-- TODO -- ajuster les privilèges en fonction de votre structure 
```

* Ajustement des privilèges du module `Element`
* Amélioration du module `Element`
```postgresql
alter table element_application_element alter column clef set default false;
update element_application_element set clef=false where clef IS NULL;
alter table element_application_element alter column clef set not null;

update unicaen_privilege_privilege set ordre = 40 where code='application_modifier';
update unicaen_privilege_privilege set ordre = 60 where code='application_effacer';

INSERT INTO unicaen_privilege_privilege(CATEGORIE_ID, CODE, LIBELLE, ORDRE)
WITH d(code, lib, ordre) AS (
    SELECT 'application_ajouter', 'Ajouter', 30 UNION
    SELECT 'application_historiser', 'Historiser/Restaurer', 50 UNION 
    SELECT 'application_cartographie', 'Cartographie des applications', 100
)
SELECT cp.id, d.code, d.lib, d.ordre
FROM d
JOIN unicaen_privilege_categorie cp ON cp.CODE = 'application';

update unicaen_privilege_privilege set ordre = 40 where code='niveau_modifier';
update unicaen_privilege_privilege set ordre = 60 where code='niveau_effacer';

@@ -66,4 +83,6 @@ WITH d(code, lib, ordre) AS (
SELECT cp.id, d.code, d.lib, d.ordre
FROM d
JOIN unicaen_privilege_categorie cp ON cp.CODE = 'niveau';

-- TODO -- ajuster les privilèges en fonction de votre structure
```
 No newline at end of file
+32 −5
Original line number Diff line number Diff line
@@ -40,11 +40,28 @@ return [
                    'controller' => ApplicationController::class,
                    'action' => [
                        'afficher',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_AFFICHER,
                    ],
                ],
                [
                    'controller' => ApplicationController::class,
                    'action' => [
                        'cartographie',
                        'exporter-cartographie',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_AFFICHER,
                        ApplicationPrivileges::APPLICATION_CARTOGRAPHIE,
                    ],
                ],
                [
                    'controller' => ApplicationController::class,
                    'action' => [
                        'creer',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_AJOUTER,
                    ],
                ],
                [
@@ -52,8 +69,6 @@ return [
                    'action' => [
                        'changer-status',
                        'editer',
                        'historiser',
                        'restaurer',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_MODIFIER,
@@ -62,12 +77,14 @@ return [
                [
                    'controller' => ApplicationController::class,
                    'action' => [
                        'creer',
                        'historiser',
                        'restaurer',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_MODIFIER,
                        ApplicationPrivileges::APPLICATION_HISTORISER,
                    ],
                ],

                [
                    'controller' => ApplicationController::class,
                    'action' => [
@@ -115,6 +132,7 @@ return [
                        'options' => [
                            'route' => '/application',
                            'defaults' => [
                                /** @see ApplicationController::indexAction() */
                                'controller' => ApplicationController::class,
                                'action' => 'index',
                            ],
@@ -127,6 +145,7 @@ return [
                                'options' => [
                                    'route' => '/cartographie',
                                    'defaults' => [
                                        /** @see ApplicationController::cartographieAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'cartographie'
                                    ],
@@ -138,6 +157,7 @@ return [
                                'options' => [
                                    'route' => '/exporter-cartographie',
                                    'defaults' => [
                                        /** @see ApplicationController::exporterCartographieAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'exporter-cartographie'
                                    ],
@@ -148,6 +168,7 @@ return [
                                'options' => [
                                    'route' => '/afficher/:id',
                                    'defaults' => [
                                        /** @see ApplicationController::afficherAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'afficher',
                                    ],
@@ -158,6 +179,7 @@ return [
                                'options' => [
                                    'route' => '/changer-status/:id',
                                    'defaults' => [
                                        /** @see ApplicationController::changerStatusAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'changer-status',
                                    ],
@@ -168,6 +190,7 @@ return [
                                'options' => [
                                    'route' => '/editer/:id',
                                    'defaults' => [
                                        /** @see ApplicationController::editerAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'editer',
                                    ],
@@ -178,6 +201,7 @@ return [
                                'options' => [
                                    'route' => '/historiser/:id',
                                    'defaults' => [
                                        /** @see ApplicationController::historiserAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'historiser',
                                    ],
@@ -188,6 +212,7 @@ return [
                                'options' => [
                                    'route' => '/restaurer/:id',
                                    'defaults' => [
                                        /** @see ApplicationController::restaurerAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'restaurer',
                                    ],
@@ -198,6 +223,7 @@ return [
                                'options' => [
                                    'route' => '/effacer/:id',
                                    'defaults' => [
                                        /** @see ApplicationController::effacerAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'effacer',
                                    ],
@@ -208,6 +234,7 @@ return [
                                'options' => [
                                    'route' => '/creer',
                                    'defaults' => [
                                        /** @see ApplicationController::creerAction() */
                                        'controller' => ApplicationController::class,
                                        'action' => 'creer',
                                    ],
+2 −2
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ class ApplicationController extends AbstractActionController {
        return $vm;
    }

    public function changerStatusAction()
    public function changerStatusAction() : Response
    {
        $application = $this->getApplicationService()->getRequestedApplication($this, 'id');

@@ -239,7 +239,7 @@ class ApplicationController extends AbstractActionController {
        }

        $date = (new DateTime())->format('Ymd-His');
        $filename="export_utilisateur_".$date.".csv";
        $filename="cartographie_application_".$date.".csv";
        $CSV = new CsvModel();
        $CSV->setDelimiter(';');
        $CSV->setEnclosure('"');
+8 −1
Original line number Diff line number Diff line
@@ -13,9 +13,17 @@ use FicheMetier\Service\FicheMetier\FicheMetierService;
use Interop\Container\ContainerInterface;
use Metier\Service\Domaine\DomaineService;
use Metier\Service\Metier\MetierService;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class ApplicationControllerFactory {

    /**
     * @param ContainerInterface $container
     * @return ApplicationController
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function __invoke(ContainerInterface $container) : ApplicationController
    {
        /**
@@ -43,7 +51,6 @@ class ApplicationControllerFactory {
        $applicationForm = $container->get('FormElementManager')->get(ApplicationForm::class);
        $applicationElementForm = $container->get('FormElementManager')->get(ApplicationElementForm::class);

        /** @var ApplicationController $controller */
        $controller = new ApplicationController();
        $controller->setApplicationService($applicationService);
        $controller->setApplicationThemeService($applicationGroupeService);
+2 −1
Original line number Diff line number Diff line
@@ -22,7 +22,8 @@ class ApplicationForm extends Form {
            'type' => Text::class,
            'name' => 'libelle',
            'options' => [
                'label' => "Libelle :",
                'label' => "Libelle <span class='icon icon-obligatoire' title='Champ obligatoire'></span>:",
                'label_options' => [ 'disable_html_escape' => true, ],
            ],
            'attributes' => [
                'id' => 'libelle',
Loading