Commit 5858f087 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Finalisation CRUD administration des grades

parent aedc3a0e
Loading
Loading
Loading
Loading
+1 −1
Changes for data/privileges.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -409,7 +409,7 @@ return [
    'nomencalture-rh'    => [
        'libelle'    => 'Nomenclature RH',
        'privileges' => [
            'grade-visualisation' => 'Visualiastion grades',
            'grade-visualisation' => 'Visualisation grades',
            'grade-edition'       => 'Édition grades',
        ],
    ],
+6 −1
Changes for module/Application/config/administration.config.php: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -211,7 +211,12 @@ return [
            PrivilegeController::class => [
                [
                    'controller' => 'Application\Controller\Administration',
                    'action'     => ['index', 'administration-types', 'administration-financiere', 'administration-intervenant', 'administration-referentiel-commun', 'administration-nomenclature-rh'],
                    'action'     => ['index',
                                     'administration-types',
                                     'administration-financiere',
                                     'administration-intervenant',
                                     'administration-referentiel-commun',
                                     'administration-nomenclature-rh'],
                    'privileges' => [
                        Privileges::IMPORT_ECARTS,
                        Privileges::IMPORT_MAJ,
+11 −7
Changes for module/Application/src/Application/Controller/GradeController.php: 11 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class GradeController extends AbstractController

        if (empty($grade)) {
            $title = "Création d'un nouveau grade";
            $voirie = $this->getServiceGrade()->newEntity();
            $grade = $this->getServiceGrade()->newEntity();
        } else {
            $title = "Edition d'un grade";
        }
@@ -52,16 +52,20 @@ class GradeController extends AbstractController
        return compact('form', 'title');
    }

    /* public function deleteAction()


    public function deleteAction()
    {
         $voirie = $this->getEvent()->getParam('voirie');

        $grade = $this->getEvent()->getParam('grade');
        try {
             $this->getServiceVoirie()->delete($voirie);
             $this->flashMessenger()->addSuccessMessage("Voirie supprimée avec succés");
            $this->getServiceGrade()->delete($grade);

            $this->flashMessenger()->addSuccessMessage("Grade supprimé avec succés");
        } catch (\Exception $e) {
            $this->flasheMessenger()->addErrorMessage($this->translate($e));
        }

         return new MessengerViewModel(compact('voirie'));
     }*/
        return new MessengerViewModel(compact('grade'));
    }
}
 No newline at end of file
+3 −2
Changes for module/Application/src/Application/Form/Grade/GradeSaisieForm.php: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Application\Form\Grade;


use Application\Entity\Db\Corps;
use Application\Form\AbstractForm;
use Application\Hydrator\GenericHydrator;
use Application\Service\Traits\CorpsServiceAwareTrait;
@@ -24,7 +25,7 @@ class GradeSaisieForm extends AbstractForm
        'id'           => ['type' => 'int'],
        'libelleCourt' => ['type' => 'string'],
        'libelleLong'  => ['type' => 'string'],
        'corps'        => ['type' => 'string'],
        'corps'        => ['type' => Corps::class],
        'source'       => ['type' => Source::class],
        'sourceCode'   => ['type' => 'string'],
    ];
@@ -123,7 +124,7 @@ class GradeSaisieForm extends AbstractForm
            'libelleLong'  => [
                'required' => true,
            ],
            'code'         => [
            'sourceCode'   => [
                'required' => true,
            ],
        ];
+26 −0
Changes for module/Application/view/application/grade/index.phtml: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -44,6 +44,17 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::NOMENCLATURE_R
                           href="<?= $this->url('grades/saisie', ['grade' => $grade->getId()]) ?>"
                           title="Modifier le grade">
                            <span class="glyphicon glyphicon-edit"></span></a>
                        <a class="pop-ajax"
                           href="<?= $this->url('grades/delete', ['grade' => $grade->getId()]) ?>"
                           title="Supprimer le grade"
                           data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette suppression ?</p>"
                           data-confirm="true"
                           data-confirm-button="Oui"
                           data-cancel-button="Non"
                           data-submit-reload="true"
                        >
                            <span class="glyphicon glyphicon-trash"></span>
                        </a>
                    <?php else: ?>
                        Non modifiable
                    <?php endif; ?>
@@ -53,3 +64,18 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::NOMENCLATURE_R
    <?php endforeach; ?>
    </tbody>
</table>
<?php if ($canEdit): ?>
    <a class="btn btn-primary ajax-modal" data-event="grade-saisie"
       href="<?= $this->url('grades/saisie') ?>"
       title="Ajouter un grade">
        <span class="glyphicon glyphicon-edit"></span>
        Ajouter un grade</a>

    <script type="text/javascript">
        $(function () {
            $("body").on("grade-saisie", function (event, data) {
                window.location.reload();
            });
        });
    </script>
<?php endif ?>