Commit 21c5b758 authored by Florian Joriot's avatar Florian Joriot
Browse files

btn group pour admin pieces justificatives

parent cf93a865
Loading
Loading
Loading
Loading
+30 −2
Changes for module/Application/src/Controller/PieceJointeController.php: 30 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ use Application\Service\Traits\TypePieceJointeServiceAwareTrait;
use Application\Service\Traits\TypePieceJointeStatutServiceAwareTrait;
use Application\Form\PieceJointe\Traits\TypePieceJointeSaisieFormAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait;
use phpDocumentor\Reflection\Types\Array_;
use UnicaenApp\View\Model\MessengerViewModel;
use Laminas\View\Model\ViewModel;
use Laminas\View\Model\JsonModel;
@@ -64,6 +65,7 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -105,6 +107,7 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -125,6 +128,7 @@ class PieceJointeController extends AbstractController
    }



    /**
     * @param TblPieceJointeDemande[] $demandees
     * @param TblPieceJointeFournie[] $fournies
@@ -172,6 +176,7 @@ class PieceJointeController extends AbstractController
    }



    public function validationAction()
    {
        $this->initFilters();
@@ -184,6 +189,7 @@ class PieceJointeController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -201,6 +207,7 @@ class PieceJointeController extends AbstractController
    }



    public function archiverAction()
    {
        $this->initFilters();
@@ -222,6 +229,7 @@ class PieceJointeController extends AbstractController
    }



    public function devaliderAction()
    {
        $this->initFilters();
@@ -239,6 +247,7 @@ class PieceJointeController extends AbstractController
    }



    public function listerAction()
    {
        $this->initFilters();
@@ -259,6 +268,7 @@ class PieceJointeController extends AbstractController
    }



    public function televerserAction()
    {
        $intervenant     = $this->getEvent()->getParam('intervenant');
@@ -282,6 +292,7 @@ class PieceJointeController extends AbstractController
    }



    public function telechargerAction()
    {
        /** @var Fichier $fichier */
@@ -302,6 +313,7 @@ class PieceJointeController extends AbstractController
    }



    public function supprimerAction()
    {
        if (!$this->getRequest()->isPost()) {
@@ -328,6 +340,7 @@ class PieceJointeController extends AbstractController
    }



    /* Actions liées à la configuration des PJ */

    public function configurationAction()
@@ -336,6 +349,7 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeStatutAction()
    {
        $codeIntervenant = $this->params()->fromRoute('codeTypeIntervenant', TypeIntervenant::CODE_EXTERIEUR);
@@ -353,8 +367,15 @@ class PieceJointeController extends AbstractController

        $typesPiecesJointes  = $this->getServiceTypePieceJointe()->getList();
        $statuts             = $this->getServiceStatut()->getList();
        $typesIntervenants = [];
        foreach ($statuts as $intervenant) {
            if (!in_array($intervenant->getTypeIntervenant(), $typesIntervenants)) {
                $typesIntervenants[] = $intervenant->getTypeIntervenant();
            }
        }

        $statutsIntervenants = [];

        $statutsIntervenants = null;
        foreach ($statuts as $statut) {
            if ($statut->getTypeIntervenant()->getCode() == $codeIntervenant) {
                $statutsIntervenants[$statut->getTypeIntervenant()->getId()][] = $statut;
@@ -387,10 +408,11 @@ class PieceJointeController extends AbstractController
            $typesPiecesJointesStatuts[$tpjID][$siId][] = $tpjs;
        }

        return compact('typesPiecesJointes', 'statutsIntervenants', 'typesPiecesJointesStatuts', 'codeIntervenant');
        return compact('typesPiecesJointes', 'statutsIntervenants', 'typesPiecesJointesStatuts', 'codeIntervenant', 'typesIntervenants');
    }



    public function typePieceJointeDeleteAction()
    {
        $typePieceJointe = $this->getEvent()->getParam('typePieceJointe');
@@ -406,6 +428,7 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeSaisieAction()
    {
        /* @var $typePieceJointe TypePieceJointe */
@@ -425,6 +448,7 @@ class PieceJointeController extends AbstractController
    }



    public function modifierTypePieceJointeStatutAction()
    {
        /* @var $tpjs TypePieceJointeStatut */
@@ -450,6 +474,7 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeTrierAction()
    {
        /* @var $tpj TypePieceJointe */
@@ -475,6 +500,7 @@ class PieceJointeController extends AbstractController
    }



    public function deleteTypePieceJointeStatutAction()
    {
        $typePieceJointeStatut = $this->getEvent()->getParam('typePieceJointeStatut');
@@ -490,6 +516,7 @@ class PieceJointeController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant, $validation = false)
    {
        $this->getServiceWorkflow()->calculerTableauxBord([
@@ -510,6 +537,7 @@ class PieceJointeController extends AbstractController
    }



    public function refuserAction()
    {
        /** @var PieceJointe $pj */
+15 −20
Changes for module/Application/view/application/piece-jointe/type-piece-jointe-statut.phtml: 15 added lines, 20 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use Intervenant\Entity\Db\TypeIntervenant;
 * @var $statutsIntervenants       Statut[][]
 * @var $typesPiecesJointesStatuts TypePieceJointeStatut[][][]
 * @var $codeIntervenant           string
 * @var $typesIntervenants         TypeIntervenant[]
 */

$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::PIECE_JUSTIFICATIVE_GESTION_EDITION));
@@ -134,30 +135,24 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::PIECE_JUSTIFIC
    </script>

<?php $this->headTitle()->append($title = "Pièces justificatives attendues par statut d'intervenant") ?>

<h1 class="page-header"><?= $title ?></h1>
    <ul class="type-intervenant">
        <?php if ($codeIntervenant == TypeIntervenant::CODE_PERMANENT): ?>
            <li>
                <a href="<?= $this->url('piece-jointe/type-piece-jointe-statut', ['codeTypeIntervenant' => TypeIntervenant::CODE_EXTERIEUR]); ?>"
                   data-placement="bottom"><i class="fas fa-eye"></i> Vacataires</a>
            </li>
            <li class="active">
                <a href="<?= $this->url('piece-jointe/type-piece-jointe-statut', ['codeTypeIntervenant' => TypeIntervenant::CODE_PERMANENT]); ?>"
                   data-placement="bottom"><i class="fas fa-eye"></i> Permanents</a>
            </li>
        <?php else: ?>
            <li class="active">
                <a href="<?= $this->url('piece-jointe/type-piece-jointe-statut', ['codeTypeIntervenant' => TypeIntervenant::CODE_EXTERIEUR]); ?>"
                   data-placement="bottom"><i class="fas fa-eye"></i> Vacataires</a>
            </li>
            <li>
                <a href="<?= $this->url('piece-jointe/type-piece-jointe-statut', ['codeTypeIntervenant' => TypeIntervenant::CODE_PERMANENT]); ?>"
                   data-placement="bottom"><i class="fas fa-eye"></i> Permanents</a>
            </li>

<div class="nav-local">
    <ul>
        <?php foreach ($typesIntervenants as $intervenant):
            if ($codeIntervenant == $intervenant->getCode()):?>
                <li class="nav-item active">
            <?php else: ?>
                <li class="nav-item">
            <?php endif; ?>
            <a class="nav-link"
               href="<?= $this->url('piece-jointe/type-piece-jointe-statut', ['codeTypeIntervenant' => $intervenant->getCode()]); ?>"
               data-placement="bottom"><i class="fas fa-eye"></i> <?php echo $intervenant->getLibelle() ?></a>
            </li>
        <?php endforeach; ?>
    </ul>
    <div style="clear:both"></div>
</div>

    <table id="tblTpjs" class="table-bordered table-sm table-header table-header-rotated" style="width:1121px">
        <thead>