Commit 1a0a58aa authored by Florian Joriot's avatar Florian Joriot
Browse files

Merge remote-tracking branch 'origin/master'

parents 139528f6 9b2b5e2e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ class AppConfig
            'Plafond',
            'Indicateur',
            'ExportRh',
            'Dossier',
        ];

        if (!self::inConsole()) {
+170 −0
Original line number Diff line number Diff line
<template>
    <h3>Saisissez le nom suivi éventuellement du prénom (2 lettres minimum)</h3>

    <div class="intervenant-recherche">
        <div class="critere">
            <div>
                <input id="term" v-on:keyup="rechercher" class="form-control input" type="text"
                       placeholder="votre recherche..."/><br/>
            </div>
            <div>
                <span class="fw-bold">Types d'intervenant : </span>
                <input v-on:change="reload()" type="checkbox" name="type[]" value="permanent" checked="checked" v-model="checkedTypes"> Permanent
                <input v-on:change="reload()" type="checkbox" name="type[]" value="vacataire" checked="checked" v-model="checkedTypes"> Vacataire
                <input v-on:change="reload()" type="checkbox" name="type[]" value="etudiant" checked="checked" v-model="checkedTypes"> Etudiant

            </div>
            <br/>
        </div>
    </div>


    <table v-if="intervenants.length > 0" class="table table-bordered table-hover">
        <thead>
        <tr>
            <th style="width:90px"></th>
            <th>Civilité</th>
            <th>Nom</th>
            <th>Prenom</th>
            <th>Structure</th>
            <th>Statut</th>
            <th>Date de naissance</th>
            <th>N° Personnel</th>
        </tr>
        </thead>
        <tbody>
        <tr :class="{'bg-danger': intervenant.destruction!==null}" :title="(intervenant.destruction!==null) ? 'Fiche historisé' : ''"
            v-for="(intervenant,code) in intervenants">
            <td style="">
                <a :href="urlFiche(intervenant['code'])"><i class="fas fa-eye"></i> Fiche</a>
            </td>
            <td>{{ intervenant['civilite'] }}</td>
            <td>{{ intervenant['nom'] }}</td>
            <td>{{ intervenant['prenom'] }}</td>
            <td>{{ intervenant['structure'] }}</td>
            <td>{{ intervenant['statut'] }}</td>
            <td>{{ intervenant['date-naissance'] }}</td>
            <td>{{ intervenant['numero-personnel'] }}</td>
        </tr>

        </tbody>
    </table>

    <table v-if="intervenants.length == 0 && noResult == 1" class="table table-bordered table-hover">
        <thead>
        <tr>
            <th style="width:90px"></th>
            <th>Civilité</th>
            <th>Nom</th>
            <th>Prenom</th>
            <th>Structure</th>
            <th>Statut</th>
            <th>Date de naissance</th>
            <th>N° Personnel</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td style="text-align:center" colspan="8">Aucun intervenant trouvé</td>
        </tr>

        </tbody>
    </table>
</template>


<script>


export default {
    name: 'Recherche',

    data()
    {
        return {
            searchTerm: '',
            noResult: 0,
            intervenants: [],
            checkedTypes: ['vacataire', 'permanent', 'etudiant'],
        };
    },

    methods: {
        rechercher: function (event)
        {
            this.searchTerm = event.currentTarget.value;
            if (this.searchTerm == '') {
                this.noResult = 0;
            }
            if (this.searchTerm != '') {
                this.reload();
            }
        },

        urlFiche(code)
        {
            return '/intervenant/code:'+code+'/voir';
        },

        reload()
        {

            if (this.timer) {
                clearTimeout(this.timer);
                this.timer = null;
            }
            this.timer = setTimeout(() => {

                axios.post(
                    Util.url("intervenant/recherche-json"), {
                        term: this.searchTerm
                    }
                )
                    .then(response => {
                        let datas = response.data;
                        let datasFiltered = [];

                        for (const intervenant in datas) {
                            if (datas[intervenant].typeIntervenantCode == 'E' && this.checkedTypes.includes('vacataire')) {
                                datasFiltered.push(datas[intervenant]);
                                continue;
                            }
                            if (datas[intervenant].typeIntervenantCode == 'P' && this.checkedTypes.includes('permanent')) {
                                datasFiltered.push(datas[intervenant]);
                                continue;
                            }
                            if (datas[intervenant].typeIntervenantCode == 'S' && this.checkedTypes.includes('etudiant')) {
                                datasFiltered.push(datas[intervenant]);
                                continue;
                            }

                        }
                        this.intervenants = datasFiltered;

                        if (this.intervenants.length == 0) {
                            this.noResult = 1;
                        } else {
                            this.noResult = 0;
                        }



                    })
                    .catch(response => {
                        console.log(response.message);
                    });
            }, 800);

        }



    }


}
</script>

<style scoped>

</style>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ $config = [
    ],
    'service_manager'    => [
        'invokables' => [
            Service\AdresseNumeroComplService::class               => Service\AdresseNumeroComplService::class,
            Service\AnneeService::class                            => Service\AnneeService::class,
            Service\LocalContextService::class                     => Service\LocalContextService::class,
            Service\ParametresService::class                       => Service\ParametresService::class,
+0 −75
Original line number Diff line number Diff line
<?php

namespace Application;

use Application\Form\Intervenant\AutresForm;
use Application\Provider\Privilege\Privileges;
use Application\Service\DossierAutreService;
use Application\Service\DossierAutreTypeService;
use UnicaenAuth\Guard\PrivilegeController;

return [
    'router' => [
        'routes' => [
            'autres-infos' => [
                'type'          => 'Literal',
                'options'       => [
                    'route'    => '/autres',
                    'defaults' => [
                        'controller' => 'Application\Controller\Autres',
                        'action'     => 'index',
                    ],
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'saisie' => [
                        'type'          => 'Segment',
                        'options'       => [
                            'route'       => '/saisie[/:dossierAutre]',
                            'constraints' => [
                                'dossierAutre' => '[0-9]*',
                            ],
                            'defaults'    => [
                                'action' => 'saisie',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
        ],
    ],

    'bjyauthorize'    => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => 'Application\Controller\Autres',
                    'action'     => ['index'],
                    'privileges' => Privileges::INTERVENANT_AUTRES_VISUALISATION,
                ],
                [
                    'controller' => 'Application\Controller\Autres',
                    'action'     => ['saisie'],
                    'privileges' => Privileges::INTERVENANT_AUTRES_EDITION,
                ],
            ],
        ],
    ],
    'controllers'     => [
        'invokables' => [
            'Application\Controller\Autres' => Controller\AutresController::class,
        ],
    ],
    'service_manager' => [
        'invokables' => [
            DossierAutreService::class     => DossierAutreService::class,
            DossierAutreTypeService::class => DossierAutreTypeService::class,
        ],
    ],
    'form_elements'   => [
        'invokables' => [
            AutresForm::class => AutresForm::class,
        ],
    ],
];
+0 −163
Original line number Diff line number Diff line
<?php

namespace Application;


use Application\Provider\Privilege\Privileges;
use UnicaenAuth\Guard\PrivilegeController;
use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider;

return [
    'router' => [
        'routes' => [
            'employeur'        => [
                'type'          => 'Literal',
                'options'       => [
                    'route'    => '/employeur',
                    'defaults' => [
                        'controller' => 'Application\Controller\Employeur',
                        'action'     => 'index',
                    ],
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'saisie'    => [
                        'type'          => 'Segment',
                        'options'       => [
                            'route'       => '/saisie[/:employeur]',
                            'constraints' => [
                                'employeur' => '[0-9]*',
                            ],
                            'defaults'    => [
                                'action' => 'saisie',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'supprimer' => [
                        'type'          => 'Segment',
                        'options'       => [
                            'route'       => '/supprimer/:employeur',
                            'constraints' => [
                                'employeur' => '[0-9]*',
                            ],
                            'defaults'    => [
                                'action' => 'supprimer',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
            'employeur-search' => [
                'type'          => 'Literal',
                'options'       => [
                    'route'    => '/employeur-search',
                    'defaults' => [
                        'controller' => 'Application\Controller\Employeur',
                        'action'     => 'recherche',
                    ],
                ],
                'may_terminate' => true,
            ],
            'employeur-json'   => [
                'type'          => 'Literal',
                'options'       => [
                    'route'    => '/employeur/json',
                    'defaults' => [
                        'controller' => 'Application\Controller\Employeur',
                        'action'     => 'recherche-json',
                    ],
                ],
                'may_terminate' => true,
            ],

        ],
    ],


    'console' => [
        'router' => [
            'routes' => [
                'console-update-employeur' => [
                    'options' => [
                        'route'    => 'update-employeur',
                        'defaults' => [
                            'controller' => 'Application\Controller\Employeur',
                            'action'     => 'update-employeur',
                        ],
                    ],
                ],
            ],
        ],
    ],

    'navigation' => [
        'default' => [
            'home' => [
                'pages' => [
                    'administration' => [
                        'pages' => [
                            'rh' => [
                                'pages' => [
                                    'Employeurs' => [
                                        'color' => '#9F491F',
                                        'label'        => "Employeurs",
                                        'title'        => "Gestion des employeurs",
                                        'route'        => 'employeur',
                                        'resource'     => PrivilegeController::getResourceId('Application\Controller\Employeur', 'index'),
                                        'order'        => 20,
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'controllers' => [
        'factories'  => [
            'Application\Controller\Employeur' => Controller\Factory\EmployeurControllerFactory::class,
        ],
        'invokables' => [
            'Application\Controller\Employeur' => Controller\EmployeurController::class,
        ],
    ],

    'bjyauthorize' => [
        'guards'         => [
            PrivilegeController::class      => [
                [
                    'controller' => 'Application\Controller\Employeur',
                    'action'     => ['index', 'recherche-json', 'saisie'],
                    'privileges' => Privileges::REFERENTIEL_COMMUN_EMPLOYEUR_VISUALISATION,
                ],
            ],
            'BjyAuthorize\Guard\Controller' => [
                [
                    'controller' => 'Application\Controller\Employeur',
                    'roles'      => ['user']],
            ],
        ],
        'rule_providers' => [
            PrivilegeRuleProvider::class => [
                'allow' => [
                    [
                        'privileges' => [
                            Privileges::REFERENTIEL_COMMUN_EMPLOYEUR_VISUALISATION,
                        ],
                        'resources'  => 'Contrat',
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'invokables' => [
            Service\EmployeurService::class => Service\EmployeurService::class,
        ],
    ],
];
 No newline at end of file
Loading