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

Début d'exploitation sur la page de la proposition

parent 5ec5a79a
Loading
Loading
Loading
Loading
+16 −0
Changes for module/Application/config/others/ecole-doctorale.config.php: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,13 @@ return [
    'bjyauthorize'    => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => EcoleDoctoraleController::class,
                    'action'     => [
                        'rechercher'
                    ],
                    'role' => [],
                ],
                [
                    'controller' => EcoleDoctoraleController::class,
                    'action'     => [
@@ -69,6 +76,15 @@ return [
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'rechercher' => [
                        'type'          => Literal::class,
                        'options'       => [
                            'route'       => '/rechercher',
                            'defaults'    => [
                                'action' => 'rechercher',
                            ],
                        ],
                    ],
                    'information' => [
                        'type'          => Segment::class,
                        'options'       => [
+16 −0
Changes for module/Application/config/others/etablissement.config.php: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,13 @@ return [
    'bjyauthorize'    => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => EtablissementController::class,
                    'action'     => [
                        'rechercher',
                    ],
                    'role' => [],
                ],
                [
                    'controller' => EtablissementController::class,
                    'action'     => [
@@ -69,6 +76,15 @@ return [
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'rechercher' => [
                        'type'          => Literal::class,
                        'options'       => [
                            'route'       => '/rechercher',
                            'defaults'    => [
                                'action' => 'rechercher',
                            ],
                        ],
                    ],
                    'information' => [
                        'type'          => Segment::class,
                        'options'       => [
+11 −0
Changes for module/Application/config/others/individu-compl.config.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ return [
                    'action'     => [
                        'index',
                        'afficher',
                        'gerer',
                        'ajouter',
                        'modifier',
                        'historiser',
@@ -79,6 +80,16 @@ return [
                            ],
                        ],
                    ],
                    'gerer' => [
                        'type'          => Segment::class,
                        'options'       => [
                            'route'    => '/gerer/:individu',
                            'defaults' => [
                                'controller'    => IndividuComplController::class,
                                'action'        => 'gerer',
                            ],
                        ],
                    ],
                    'ajouter' => [
                        'type'          => Literal::class,
                        'options'       => [
+16 −0
Changes for module/Application/config/others/unite-recherche.config.php: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,13 @@ return [
    'bjyauthorize'    => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => UniteRechercheController::class,
                    'action'     => [
                        'rechercher',
                    ],
                    'role' => [],
                ],
                [
                    'controller' => UniteRechercheController::class,
                    'action'     => [
@@ -73,6 +80,15 @@ return [
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'rechercher' => [
                        'type'          => Literal::class,
                        'options'       => [
                            'route'       => '/rechercher',
                            'defaults'    => [
                                'action' => 'rechercher',
                            ],
                        ],
                    ],
                    'information' => [
                        'type'          => Segment::class,
                        'options'       => [
+22 −0
Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Application\Service\EcoleDoctorale\EcoleDoctoraleService;
use Application\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait;
use Application\Service\StructureDocument\StructureDocumentServiceAwareTrait;
use Laminas\Http\Response;
use Laminas\View\Model\JsonModel;
use Laminas\View\Model\ViewModel;

class EcoleDoctoraleController extends StructureConcreteController
@@ -95,4 +96,25 @@ class EcoleDoctoraleController extends StructureConcreteController

        return $viewModel;
    }

    public function rechercherAction()
    {
        if (($term = $this->params()->fromQuery('term'))) {
            $unites = $this->getEcoleDoctoraleService()->getRepository()->findByText($term);
            $result = [];
            foreach ($unites as $unite) {
                $result[] = array(
                    'id' => $unite->getId(),            // identifiant unique de l'item
                    'label' => $unite->getLibelle(),    // libellé de l'item
                    'extra' => $unite->getSigle(),      // infos complémentaires (facultatives) sur l'item
                );
            }
            usort($result, function ($a, $b) {
                return strcmp($a['label'], $b['label']);
            });

            return new JsonModel($result);
        }
        exit;
    }
}
 No newline at end of file
Loading