Commit 2c5d0cc2 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Suppression de l'accès à l'admin des TBLS : inutile

MAJ de l'IHM des statuts
parent f0ff3784
Loading
Loading
Loading
Loading
+0 −41
Changes for config/autoload/unicaen-tbl.global.php: 0 added lines, 41 removed lines.
Original line number Diff line number Diff line
<?php

namespace UnicaenTbl;

use UnicaenAuth\Guard\PrivilegeController;
use UnicaenTbl\Controller\AdminController;

return [
    'unicaen-tbl' => [
    ],

    'navigation' => [
        'default' => [
            'home' => [
                'pages' => [
                    'administration' => [
                        'pages' => [
                            'unicaen-tbl' => [
                                'label'    => 'Tableaux de bord internes de calcul intermédiaire',
                                'order'    => 1,
                                'route'    => 'unicaen-tbl',
                                'resource' => PrivilegeController::getResourceId(AdminController::class, 'index'),
                                /*'pages'    => [
                                    'showDiff'               => [
                                        'label'       => "Écarts entre les données de l'application et ses sources",
                                        'description' => "Affiche, table par table, la liste des données différentes entre l'application et ses sources de données",
                                        'route'       => 'import',
                                        'resource'    => PrivilegeController::getResourceId('Import\Controller\Import', 'show-diff'),
                                        'params'      => [
                                            'action' => 'show-diff',
                                        ],
                                    ],
                                ],*/
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
];
 No newline at end of file
+19 −3
Changes for module/Intervenant/src/Controller/StatutController.php: 19 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Intervenant\Controller;

use Application\Cache\Traits\CacheContainerTrait;
use Application\Controller\AbstractController;
use Application\Service\Traits\ContextServiceAwareTrait;
use Intervenant\Entity\Db\Statut;
use Application\Provider\Privilege\Privileges;
use Intervenant\Form\StatutSaisieFormAwareTrait;
@@ -22,23 +23,38 @@ class StatutController extends AbstractController
    use TypeIntervenantServiceAwareTrait;
    use CacheContainerTrait;
    use DossierAutreServiceAwareTrait;
    use ContextServiceAwareTrait;

    public function indexAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
            Statut::class,
        ]);
        $this->em()->getFilters()->enable('annee')->init([
            Statut::class,
        ]);

        $statuts           = $this->getServiceStatut()->getList();
        $typesIntervenants = $this->getServiceTypeIntervenant()->getList();
        $statuts           = $this->getServiceStatut()->getList();

        return compact('statuts');
        return compact('typesIntervenants', 'statuts');
    }



    public function saisieAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
            Statut::class,
        ]);
        $this->em()->getFilters()->enable('annee')->init([
            Statut::class,
        ]);

        $typesIntervenants = $this->getServiceTypeIntervenant()->getList();
        $statuts           = $this->getServiceStatut()->getList();


        /** @var Statut $statut */
        $statut = $this->getEvent()->getParam('statut');

@@ -68,7 +84,7 @@ class StatutController extends AbstractController
            $form->readOnly();
        }

        return compact('form', 'title');
        return compact('typesIntervenants', 'statuts', 'form', 'title');
    }


+10 −7
Changes for module/Intervenant/view/intervenant/statut/index.phtml: 10 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,9 @@ use Application\Provider\Privilege\Privileges;

/**
 * @var $this              \Application\View\Renderer\PhpRenderer
 * @var $typesIntervenants \Intervenant\Entity\Db\TypeIntervenant[]
 * @var $statuts           \Intervenant\Entity\Db\Statut[]
 *
 */

$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::INTERVENANT_STATUT_EDITION));
@@ -16,21 +18,21 @@ $this->headTitle()->append($title = "Statuts des intervenants");
?>
<h1 class="page-header"><?php echo $title ?></h1>

<?php foreach ($typesIntervenants as $typeIntervenant): ?>
    <h3><?= $typeIntervenant ?></h3>
    <table class="table table-bordered table-hover table-condensed">
        <head>
            <tr>
            <th>Type d'intervenant</th>
            <th>Code</th>
            <th>Libellé</th>
                <th style="width:25%">Code</th>
                <th style="width:65%">Libellé</th>
                <?php if ($canEdit): ?>
                <th>Actions</th>
                    <th style="width:1%">Actions</th>
                <?php endif; ?>
            </tr>
        </head>
        <body>
    <?php foreach ($statuts as $statut): ?>
        <?php foreach ($statuts as $statut): if ($statut->getTypeIntervenant() == $typeIntervenant): ?>
            <tr class="statut" data-id="<?= $statut->getId() ?>">
            <td><?= $statut->getTypeIntervenant() ?></td>
                <td><?= $statut->getCode() ?></td>
                <td><?= $statut->getLibelle() ?></td>
                <?php if ($canEdit): ?>
@@ -57,9 +59,10 @@ $this->headTitle()->append($title = "Statuts des intervenants");
                    </th>
                <?php endif; ?>
            </tr>
    <?php endforeach; ?>
        <?php endif; endforeach; ?>
        </body>
    </table>
<?php endforeach; ?>

<?php if ($canEdit): ?>
    <a class="btn btn-primary" href="<?= $this->url('statut/saisie') ?>" title="Ajouter un statut">
+26 −1
Changes for module/Intervenant/view/intervenant/statut/saisie.phtml: 26 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ use Application\Provider\Privilege\Privileges;

/**
 * @var $this              \Application\View\Renderer\PhpRenderer
 * @var $typesIntervenants \Intervenant\Entity\Db\TypeIntervenant[]
 * @var $statuts           \Intervenant\Entity\Db\Statut[]
 * @var $form              \Intervenant\Form\StatutSaisieForm
 */

@@ -20,6 +22,24 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger();

?>

<div class="row">
    <div class="col-md-3">
        <?php
        foreach ($typesIntervenants as $typeIntervenant) {
            echo $this->tag('h3')->text($typeIntervenant);
            echo $this->tag('div', ['class' => 'list-group']);
            foreach ($statuts as $statut) {
                if ($statut->getTypeIntervenant() == $typeIntervenant) {
                    $url    = $this->url('statut/saisie', ['statut' => $statut?->getId()]);
                    $active = $statut == $form->getObject() ? ' active' : '';
                    echo $this->tag('a', ['class' => 'list-group-item' . $active, 'href' => $url])->text($statut) . "\n";
                }
            }
            echo '</div>';
        }
        ?>
    </div>
    <div class="col-md-9">
        <!-- Informations générales -->
        <div class="panel panel-default">
            <div class="panel-heading">Informations générales</div>
@@ -131,7 +151,8 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger();
                <div class="row">
                    <div class="col-md-12">
                        <?= $this->formControlGroup($form->get('pieceJustificative')); ?>
                <a target="_blank" href="<?= $this->url('piece-jointe/type-piece-jointe-statut'); ?>">Page d'administration des pièces justificatives</a>
                        <a target="_blank" href="<?= $this->url('piece-jointe/type-piece-jointe-statut'); ?>">Page d'administration des pièces
                            justificatives</a>
                    </div>
                </div>
            </div>
@@ -282,6 +303,10 @@ echo $this->messenger()->addCurrentMessagesFromFlashMessenger();

        <?= $this->form()->closeTag(); ?>

    </div>

</div>

<script type="text/javascript">
    $(function () {
        WidgetInitializer.add('statut', {