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

Retravail de la partie ressource

parent 900e23c7
Loading
Loading
Loading
Loading
+37
Changes for module/Application/config/merged/menu.config.php: 37 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Application\Provider\Privilege\ApplicationPrivileges;
use Application\Provider\Privilege\FicheMetierPrivileges;
use Application\Provider\Privilege\FonctionPrivileges;
use Application\Provider\Privilege\PostePrivileges;
use Application\Provider\Privilege\RessourceRhPrivileges;
use Application\Provider\Privilege\StructurePrivileges;

return [
@@ -24,6 +25,31 @@ return [
                        'roles' => [],
                        'pages' => [
                            [
                                'order' => 1,
                                'label' => 'Les corps, grades et status',
                                'route' => 'ressource-rh/index-corps-grade-status',
                                'privileges' => RessourceRhPrivileges::AFFICHER,
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],
                            [
                                'order' => 2,
                                'label' => 'Les correspondances',
                                'route' => 'ressource-rh/index-correspondance',
                                'privileges' => RessourceRhPrivileges::AFFICHER,
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],
                            [
                                'order' => 3,
                                'label' => 'Les domaines',
                                'route' => 'ressource-rh/index-domaine',
                                'privileges' => RessourceRhPrivileges::AFFICHER,
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],
                            [
                                'order' => 4,
                                'label' => 'Les fonctions',
                                'route' => 'fonction',
                                'privileges' => FonctionPrivileges::AFFICHER,
@@ -31,12 +57,23 @@ return [
                                'icon' => 'fas fa-angle-right'
                            ],
                            [
                                'order' => 5,
                                'label' => 'Les métiers et familles de métiers',
                                'route' => 'ressource-rh/index-metier-et-famille',
                                'privileges' => RessourceRhPrivileges::AFFICHER,
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],
                            [
                                'order' => 6,
                                'label' => 'Les structures',
                                'route' => 'structure',
                                'privileges' => StructurePrivileges::AFFICHER,
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],


                        ],
                    ],
                    'entretien' => [
+49 −5
Changes for module/Application/config/merged/ressource-rh.config.php: 49 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -8,9 +8,6 @@ use Application\Controller\RessourceRh\RessourceRhControllerFactory;
use Application\Form\RessourceRh\DomaineForm;
use Application\Form\RessourceRh\DomaineFormFactory;
use Application\Form\RessourceRh\DomaineHydrator;
use Application\Form\RessourceRh\FonctionForm;
use Application\Form\RessourceRh\FonctionFormFactory;
use Application\Form\RessourceRh\FonctionHydrator;
use Application\Form\RessourceRh\GradeForm;
use Application\Form\RessourceRh\GradeFormFactory;
use Application\Form\RessourceRh\GradeHydrator;
@@ -46,6 +43,11 @@ return [
                    'controller' => RessourceRhController::class,
                    'action' => [
                        'index',
                        'index-corps-grade-status',
                        'index-metier-et-famille',
                        'index-correspondance',
                        'index-domaine',
                        'index-metier-et-famille',
                        'get-grades-json',
                    ],
                    'privileges' => [
@@ -117,6 +119,50 @@ return [
                ],
                'may_terminate' => true,
                'child_routes' => [
                    'index-corps-grade-status' => [
                        'type' => Literal::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/index-corps-grade-status',
                            'defaults' => [
                                'controller' => RessourceRhController::class,
                                'action'     => 'index-corps-grade-status',
                            ],
                        ],
                    ],
                    'index-metier-et-famille' => [
                        'type' => Literal::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/index-metier-et-famille',
                            'defaults' => [
                                'controller' => RessourceRhController::class,
                                'action'     => 'index-metier-et-famille',
                            ],
                        ],
                    ],
                    'index-correspondance' => [
                        'type' => Literal::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/index-correspondance',
                            'defaults' => [
                                'controller' => RessourceRhController::class,
                                'action'     => 'index-correspondance',
                            ],
                        ],
                    ],
                    'index-domaine' => [
                        'type' => Literal::class,
                        'may_terminate' => true,
                        'options' => [
                            'route'    => '/index-domaine',
                            'defaults' => [
                                'controller' => RessourceRhController::class,
                                'action'     => 'index-domaine',
                            ],
                        ],
                    ],
                    'agent-status' => [
                        'type' => Literal::class,
                        'options' => [
@@ -468,7 +514,6 @@ return [
            MetierForm::class => MetierFormFactory::class,
            MetierFamilleForm::class => MetierFamilleFormFactory::class,
            DomaineForm::class => DomaineFormFactory::class,
            FonctionForm::class => FonctionFormFactory::class,
            GradeForm::class => GradeFormFactory::class,
        ],
    ],
@@ -479,7 +524,6 @@ return [
            CorrespondanceHydrator::class => CorrespondanceHydrator::class,
            MetierFamilleHydrator::class => MetierFamilleHydrator::class,
            DomaineHydrator::class => DomaineHydrator::class,
            FonctionHydrator::class => FonctionHydrator::class,
        ],
        'factories' => [
            MetierHydrator::class => MetierHydratorFactory::class,
+34 −7
Changes for module/Application/src/Application/Controller/RessourceRh/RessourceRhController.php: 34 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -44,22 +44,49 @@ class RessourceRhController extends AbstractActionController {

    public function indexAction()
    {
        $status = $this->getRessourceRhService()->getAgentStatusListe('libelle');
        return new ViewModel([]);
    }

    public function indexCorrespondanceAction()
    {
        $correspondances = $this->getRessourceRhService()->getCorrespondances('libelle');
        $metiers = $this->getRessourceRhService()->getMetiers('libelle');

        return new ViewModel([
            'correspondances' => $correspondances,
        ]);
    }

    /** Sub part */
    public function indexCorpsGradeStatusAction()
    {
        $status = $this->getRessourceRhService()->getAgentStatusListe('libelle');
        $corps = $this->getRessourceRhService()->getCorpsListe('libelle');
        $familles = $this->getRessourceRhService()->getMetiersFamilles('libelle');
        $domaines = $this->getRessourceRhService()->getDomaines('libelle');
        $grades = $this->getRessourceRhService()->getGrades();

        return new ViewModel([
            'status' => $status,
            'correspondances' => $correspondances,
            'corps'  => $corps,
            'grades' => $grades,
        ]);
    }

    public function indexMetierEtFamilleAction()
    {
        $metiers = $this->getRessourceRhService()->getMetiers('libelle');
        $familles = $this->getRessourceRhService()->getMetiersFamilles('libelle');

        return new ViewModel([
            'metiers' => $metiers,
            'familles' => $familles,
            'corps' => $corps,
        ]);
    }

    public function indexDomaineAction()
    {
        $domaines = $this->getRessourceRhService()->getDomaines('libelle');

        return new ViewModel([
            'domaines' => $domaines,
            'grades' => $grades,
        ]);
    }

+222
Changes for module/Application/view/application/ressource-rh/index-corps-grade-status.phtml: 222 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * @var \Application\Entity\Db\AgentStatus[] $status
 * @var \Application\Entity\Db\Corps[] $corps
 * @var \Application\Entity\Db\Grade[] $grades
 */

use Application\Provider\Privilege\RessourceRhPrivileges;

$this->headTitle('Index des corps, grades et status des agents');

$canAjouterRessource    = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER));
$canEditerRessource     = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER));
$canEffacerRessource    = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER));

?>

<h1 class="page-header">
    Index des corps, grades et status des agents
</h1>

<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'status']); ?>" class="btn btn-primary action">Status</a>
<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'corps']); ?>" class="btn btn-primary action">Corps</a>
<a href="<?php echo $this->url('ressource-rh', [], ['fragment' => 'grade']); ?>" class="btn btn-primary action">Grade</a>

<div class="main">

    <a name="status"></a>
    <div class="col-md-8">
        <h2>
            Status des agents
            <span class="badge">
                <?php echo count($status); ?>
            </span>
        </h2>
    </div>
    <div class="pull-right">
        <?php if ($canAjouterRessource) : ?>
            <a
                href="<?php echo $this->url('ressource-rh/agent-status/creer', [], [], true); ?>"
                class="btn btn-primary action ajax-modal"
                data-event="modification"
            >
                <span class="icon ajouter"></span>
                Ajouter un status
            </a>
        <?php endif; ?>
    </div>
    <?php if (count($status) > 0) : ?>
        <table class="table table-condensed">
            <thead>
            <tr>
                <th> Id </th>
                <th> Libelle </th>
                <th class="action"> Action </th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($status as $item) : ?>
                <tr>
                    <td> <?php echo $item->getId(); ?> </td>
                    <td> <?php echo $item->getLibelle(); ?> </td>
                    <td>
                        <?php if ($canEditerRessource) : ?>
                            <a href="<?php echo $this->url('ressource-rh/agent-status/modifier', ['id' => $item->getId()], [], true); ?>"
                               data-event="modification"
                               class="ajax-modal"
                            >
                                <span class="icon editer" title="Éditer le status"></span></a>
                        <?php else : ?>
                                <span class="icon editer" style="color:lightgrey;"></span>
                        <?php endif; ?>

                        <?php if ($canEffacerRessource) : ?>
                            <a href="<?php echo $this->url('ressource-rh/agent-status/effacer', ['id' => $item->getId()], [], true); ?>" >
                                <span class="icon detruire" title="Effacer le status"></span></a>
                        <?php else : ?>
                            <span class="icon detruire" style="color:lightgrey;"></span>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    <?php endif; ?>
</div>

<div class="main">
    <a name="corps"></a>
    <div class="col-md-8">
        <h2>
            Liste des corps
            <span class="badge">
            <?php echo count($corps); ?>
        </span>
        </h2>
    </div>

    <div class="pull-right">
        <?php if ($canAjouterRessource) : ?>
            <a href="<?php echo $this->url('ressource-rh/corps/creer', [], [], true);?>"
               class="btn btn-primary action ajax-modal"
               data-event="modification"
            >
                <span class="icon ajouter"></span>
                Ajouter un corps
            </a>
        <?php endif;?>
    </div>

    <br/>

    <table class="table table-condensed">
        <thead>
        <tr>
            <th> Id</th>
            <th> Code</th>
            <th> Libelle</th>
            <th class="action"> Action </th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($corps as $corp): ?>
            <tr>
                <td> <?php echo $corp->getId(); ?> </td>
                <td> <?php echo $corp->getCode(); ?> </td>
                <td> <?php echo $corp->getLibelle(); ?> </td>
                <td>
                    <?php if ($canEditerRessource) : ?>
                        <a href="<?php echo $this->url('ressource-rh/corps/modifier', ['id' => $corp->getId()], [], true); ?>"  class="ajax-modal" data-event="modification">
                            <span class="icon editer" title="Éditer le corps"></span></a>
                    <?php else : ?>
                            <span class="icon editer" style="color: lightgrey;"></span>
                    <?php endif; ?>
                    <?php if ($canEffacerRessource) : ?>
                        <a href="<?php echo $this->url('ressource-rh/corps/effacer', ['id' => $corp->getId()], [], true); ?>">
                            <span class="icon detruire"  title="Supprimer le corps"></span></a>
                    <?php else : ?>
                            <span class="icon detruire" style="color: lightgrey;"></span>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>

</div>

<div class="main">
    <a name="grade"></a>
    <div class="col-md-8">
        <h2>
            Liste des grades
            <span class="badge">
            <?php echo count($grades); ?>
        </span>
        </h2>
    </div>

    <div class="pull-right">
        <?php if ($canAjouterRessource) : ?>
            <a href="<?php echo $this->url('ressource-rh/grade/ajouter', [], [], true);?>"
               class="btn btn-primary action ajax-modal"
               data-event="modification"
            >
                <span class="icon ajouter"></span>
                Ajouter un grade
            </a>
        <?php endif;?>
    </div>

    <br/>

    <table class="table table-condensed">
        <thead>
        <tr>
            <th> Id</th>
            <th> Corps</th>
            <th> Libelle</th>
            <th> Progression</th>
            <th class="action"> Action </th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($grades as $grade): ?>
            <tr>
                <td> <?php echo $grade->getId(); ?> </td>
                <td> <?php echo $grade->getCorps()->getLibelle(); ?> </td>
                <td> <?php echo $grade->getLibelle(); ?> </td>
                <td> <?php echo $grade->getRang(); ?> </td>
                <td>
                    <?php if ($canEditerRessource) : ?>
                        <a href="<?php echo $this->url('ressource-rh/grade/modifier', ['grade' => $grade->getId()], [], true); ?>"  class="ajax-modal" data-event="modification">
                            <span class="icon editer" title="Éditer le grade"></span></a>
                    <?php else : ?>
                            <span class="icon editer" style="color: lightgrey;"></span>
                    <?php endif; ?>
                    <?php if ($canEffacerRessource) : ?>
                        <a href="<?php echo $this->url('ressource-rh/grade/supprimer', ['grade' => $grade->getId()], [], true); ?>">
                            <span class="icon detruire"  title="Supprimer le grade"></span></a>
                    <?php else : ?>
                        <span class="icon detruire" style="color: lightgrey;"></span>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>

</div>



<script>
    $(function() {
        $("body").on("modification", function (event) {
            event.div.modal('hide');
            window.location.reload();
        });
    });
</script>
+92
Changes for module/Application/view/application/ressource-rh/index-correspondance.phtml: 92 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * @var \Application\Entity\Db\Correspondance[] $correspondances
 */

use Application\Provider\Privilege\RessourceRhPrivileges;

$this->headTitle('Index des correpondances');

$canAjouterRessource    = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AJOUTER));
$canEditerRessource     = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::MODIFIER));
$canEffacerRessource    = $this->isAllowed(RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::EFFACER));

?>

<h1 class="page-header">
    Index des correspondances
</h1>

<div class="main">
    <div class="col-md-8">
        <h2>
            Liste des catégorie
            <span class="badge">
            <?php echo count($correspondances); ?>
        </span>
        </h2>
    </div>
    <div class="pull-right">
        <?php if ($canAjouterRessource) : ?>
            <a href="<?php echo $this->url('ressource-rh/correspondance/creer', [], [], true);?>"
               class="btn btn-primary action ajax-modal"
               data-event="modification"
            >
                <span class="icon ajouter"></span>
                Ajouter une catégorie
            </a>
        <?php endif;?>
    </div>
    <?php if (count($correspondances) > 0) : ?>
        <table class="table table-condensed">
            <thead>
            <tr>
                <th> Id </th>
                <th> Référence </th>
                <th> Libelle </th>
                <th> Description </th>
                <th class="action"> Action </th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($correspondances as $correspondance) : ?>
                <tr>
                    <td> <?php echo $correspondance->getId(); ?> </td>
                    <td> <?php echo $correspondance->getReference(); ?> </td>
                    <td> <?php echo $correspondance->getLibelle(); ?> </td>
                    <td> <?php echo $correspondance->getDescription(); ?> </td>
                    <td>
                        <?php if ($canEditerRessource) : ?>
                            <a href="<?php echo $this->url('ressource-rh/correspondance/modifier', ['id' => $correspondance->getId()], [], true); ?>"
                               data-event="modification"
                               class="ajax-modal"
                            >
                                <span class="icon editer" title="Éditer la correspondance"></span></a>
                        <?php else : ?>
                                <span class="icon editer" style="color: lightgrey;"></span>
                        <?php endif; ?>
                        <?php if ($canEffacerRessource) : ?>
                            <a href="<?php echo $this->url('ressource-rh/correspondance/effacer', ['id' => $correspondance->getId()], [], true); ?>" >
                                <span class="icon detruire" title="Effacer le status"></span></a>
                        <?php else : ?>
                                <span class="icon detruire" style="color: lightgrey;"></span>
                        <?php endif; ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    <?php endif; ?>
</div>



<script>
    $(function() {
        $("body").on("modification", function (event) {
            event.div.modal('hide');
            window.location.reload();
        });
    });
</script>
Loading