Commit 3f343f40 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

UnicaenEtat V0

parent 2bc656ac
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+14 −0
Changes for .gitlab-ci.yml: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
image: registre.unicaen.fr:5000/unicaen-dev-php7.3-apache

stages:
- publish

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
  - vendor/

update-satis:
  stage: publish
  script:
    - curl https://gest.unicaen.fr/packagist/update

Module.php

0 → 100644
+47 −0
Changes for Module.php: 47 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php


namespace UnicaenEtat;

use Laminas\Config\Factory as ConfigFactory;
use Laminas\Mvc\ModuleRouteListener;
use Laminas\Mvc\MvcEvent;
use Laminas\Stdlib\ArrayUtils;
use Laminas\Stdlib\Glob;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $e->getApplication()->getServiceManager()->get('translator');
        $eventManager        = $e->getApplication()->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

    }

    public function getConfig()
    {
        $configInit = [
            __DIR__ . '/config/module.config.php'
        ];
        $configFiles = ArrayUtils::merge(
            $configInit,
            Glob::glob(__DIR__ . '/config/merged/{,*.}{config}.php', Glob::GLOB_BRACE)
        );

        return ConfigFactory::fromFiles($configFiles);
    }


    public function getAutoloaderConfig()
    {
        return array(
            'Laminas\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }
}

composer.json

0 → 100755
+23 −0
Changes for composer.json: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "name": "unicaen/etat",
  "description": "Module de gestion des etats et actions associés au passage d'état",
  "repositories": [
    {
      "type": "composer",
      "url": "https://gest.unicaen.fr/packagist"
    }
  ],
  "require": {
    "unicaen/app":                                  "^3.x",
    "unicaen/utilisateur":                          "dev-zf-3.x",
    "unicaen/privilege":                            "dev-zf-3.x"
  },
  "autoload": {
    "psr-0": {
      "UnicaenUtilisateurLdapAdapter":              "src/"
    },
    "classmap": [
      "./Module.php"
    ]
  }
}

config/example.php

0 → 100644
+36 −0
Changes for config/example.php: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace UnicaenEtat;

use UnicaenPrivilege\Guard\PrivilegeController;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [

            ],
        ],
    ],

    'router'          => [
        'routes' => [
        ],
    ],

    'service_manager' => [
        'factories' => [],
    ],
    'controllers'     => [
        'factories' => [],
    ],
    'form_elements' => [
        'factories' => [],
    ],
    'hydrators' => [
        'factories' => [],
    ]

];
 No newline at end of file
+168 −0
Changes for config/merged/etat-categorie.config.php: 168 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace UnicaenEtat;

use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;
use UnicaenEtat\Controller\EtatCategorieController;
use UnicaenEtat\Controller\EtatCategorieControllerFactory;
use UnicaenEtat\Form\EtatCategorie\EtatCategorieForm;
use UnicaenEtat\Form\EtatCategorie\EtatCategorieFormFactory;
use UnicaenEtat\Form\EtatCategorie\EtatCategorieHydrator;
use UnicaenEtat\Form\EtatCategorie\EtatCategorieHydratorFactory;
use UnicaenEtat\Provider\Privilege\EtatPrivileges;
use UnicaenEtat\Service\EtatCategorie\EtatCategorieService;
use UnicaenEtat\Service\EtatCategorie\EtatCategorieServiceFactory;
use UnicaenEtat\View\Helper\EtatCategorieViewHelper;
use UnicaenPrivilege\Guard\PrivilegeController;

return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => EtatCategorieController::class,
                    'action' => [
                        'index',
                    ],
                    'privileges' => [
                        EtatPrivileges::ETAT_INDEX,
                    ],
                ],
                [
                    'controller' => EtatCategorieController::class,
                    'action' => [
                        'ajouter',
                    ],
                    'privileges' => [
                        EtatPrivileges::ETAT_AJOUTER,
                    ],
                ],
                [
                    'controller' => EtatCategorieController::class,
                    'action' => [
                        'modifier',
                    ],
                    'privileges' => [
                        EtatPrivileges::ETAT_MODIFIER,
                    ],
                ],
                [
                    'controller' => EtatCategorieController::class,
                    'action' => [
                        'supprimer',
                    ],
                    'privileges' => [
                        EtatPrivileges::ETAT_DETRUIRE,
                    ],
                ],
            ],
        ],
    ],

    'navigation' => [
        'default' => [
            'home' => [
                'pages' => [
                    'administration' => [
//                        'pages' => [
//                            'unicaen-etat' => [
//                                'pages' => [
//                                    'etat-type' => [
//                                        'label' => 'État type',
//                                        'route' => 'unicaen-etat/etat-type',
//                                        'resource' => PrivilegeController::getResourceId(EtatCategorieController::class, 'index'),
//                                        'order'    => 10001,
//                                    ],
//                                ],
//                            ],
//                        ],
                    ],
                ],
            ],
        ],
    ],

    'router' => [
        'routes' => [
            'unicaen-etat' => [
                'child_routes' => [
                    'etat-categorie' => [
                        'type' => Literal::class,
                        'options' => [
                            'route' => '/etat-categorie',
                            'defaults' => [
                                'controller' => EtatCategorieController::class,
                                'action' => 'index',
                            ],
                        ],
                        'may_terminate' => true,
                        'child_routes' => [
                            'ajouter' => [
                                'type' => Literal::class,
                                'options' => [
                                    'route' => '/ajouter',
                                    'defaults' => [
                                        'controller' => EtatCategorieController::class,
                                        'action' => 'ajouter',
                                    ],
                                ],
                                'may_terminate' => true,
                            ],
                            'modifier' => [
                                'type' => Segment::class,
                                'options' => [
                                    'route' => '/modifier/:categorie',
                                    'defaults' => [
                                        'controller' => EtatCategorieController::class,
                                        'action' => 'modifier',
                                    ],
                                ],
                                'may_terminate' => true,
                            ],
                            'supprimer' => [
                                'type' => Segment::class,
                                'options' => [
                                    'route' => '/supprimer/:categorie',
                                    'defaults' => [
                                        'controller' => EtatCategorieController::class,
                                        'action' => 'supprimer',
                                    ],
                                ],
                                'may_terminate' => true,
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            EtatCategorieService::class => EtatCategorieServiceFactory::class,
        ],
    ],
    'controllers'     => [
        'factories' => [
            EtatCategorieController::class => EtatCategorieControllerFactory::class,
        ],
    ],
    'form_elements' => [
        'factories' => [
            EtatCategorieForm::class => EtatCategorieFormFactory::class,
        ],
    ],
    'hydrators' => [
        'factories' => [
            EtatCategorieHydrator::class => EtatCategorieHydratorFactory::class
        ],
    ],
    'view_helpers' => [
        'invokables' => [
            'etatcategorie'  => EtatCategorieViewHelper::class,
        ],
    ],


];
 No newline at end of file
Loading