Commit 01d672b0 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

adaptation admin aux multi-niveaux structures WIP

parent 809c7bee
Loading
Loading
Loading
Loading
+3 −1
Changes for data/ddl/view/V_RECONDUCTION_CENTRE_COUT.sql: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_RECONDUCTION_CENTRE_COUT AS
SELECT
  e.annee_id           annee_id,
    e.structure_id      structure_id,
  str.id               structure_id,
  str.ids              structure_ids,
  e.id                 etape_id,
  e.code               etape_code,
  e.libelle            etape_libelle,
@@ -15,6 +16,7 @@ FROM
       JOIN centre_cout_ep    ccep1 ON ccep1.element_pedagogique_id = ep1.id AND ccep1.HISTO_DESTRUCTION IS NULL
       JOIN centre_cout         cc1 ON ccep1.centre_cout_id = cc1.id AND cc1.HISTO_DESTRUCTION IS NULL
       JOIN source                s ON s.id = ccep1.source_id AND s.importable = 0
       JOIN structure           str ON str.id = e.structure_id
       JOIN element_pedagogique ep2 ON ep2.annee_id = ep1.annee_id+1  AND ep1.code = ep2.code AND ep2.HISTO_DESTRUCTION IS NULL
  LEFT JOIN centre_cout_ep    ccep2 ON ccep2.element_pedagogique_id = ep2.id AND ccep2.histo_destruction IS NULL AND ccep2.type_heures_id = ccep1.TYPE_HEURES_ID
WHERE
+3 −1
Changes for data/ddl/view/V_RECONDUCTION_MODULATEUR.sql: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_RECONDUCTION_MODULATEUR AS
SELECT
  e.annee_id        annee_id,
    e.structure_id      structure_id,
  str.id            structure_id,
  str.ids           structure_ids,
  e.id              etape_id,
  e.code            etape_code,
  e.libelle         etape_libelle,
@@ -10,6 +11,7 @@ SELECT
  ep2.id            new_ep_id
FROM
            etape                 e
       JOIN structure           str ON str.id = e.structure_id
       JOIN element_pedagogique ep1 ON ep1.etape_id = e.id AND ep1.HISTO_DESTRUCTION IS NULL
       JOIN element_modulateur  em1 ON em1.element_id = ep1.id AND em1.histo_destruction IS NULL
       JOIN element_pedagogique ep2 ON ep2.annee_id = ep1.annee_id+1  AND ep1.code = ep2.code AND ep2.HISTO_DESTRUCTION IS NULL
−5
Changes for module/Application/view/application/droits/affectations.phtml: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@ $head = [
    'source'      => '<abbr title="Source de données">Src</abbr>/Actions',
];

if ($structure) unset($head['structure']);

$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::DROIT_AFFECTATION_EDITION));
$ajoutUrl = $this->url('droits/affectations/edition');

@@ -39,8 +37,6 @@ $ajoutUrl = $this->url('droits/affectations/edition');
        $suppressionUrl = $this->url('droits/affectations/suppression', ['affectation' => $affectation->getId()]);
        ?>
        <tr>
            <?php if (!$structure): ?>

            <td><?php
                $str = (string)$affectation->getStructure();
                if ('' == $str) {
@@ -48,7 +44,6 @@ $ajoutUrl = $this->url('droits/affectations/edition');
                }
                echo $str;
                ?></td>
            <?php endif; ?>
            <td><?= $affectation->getRole() ?></td>
            <td><?= $affectation->getUtilisateur() ?></td>
            <td style="text-align: center;width:1%;white-space: nowrap"><?php
+23 −11
Changes for module/OffreFormation/src/Service/EtapeService.php: 23 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class EtapeService extends AbstractEntityService
     * @return string
     */

    public function getEtapeCentreCoutReconductible($structure)
    public function getEtapeCentreCoutReconductible(Structure $structure)
    {
        $annee = $this->getServiceContext()->getAnnee()->getId();

@@ -85,15 +85,21 @@ class EtapeService extends AbstractEntityService
          V_RECONDUCTION_CENTRE_COUT 
        WHERE
          annee_id = :annee
            AND structure_id = ' . $structure->getId();

        $sql .= 'GROUP BY
          AND structure_ids LIKE :structure
        GROUP BY
          etape_id,
          etape_code,
          etape_libelle
                ORDER BY etape_id ASC';
        ORDER BY 
          etape_id ASC
        ';

        $params = [
            'annee' => $annee,
            'structure' => $structure->idsFilter(),
        ];

        $result = $this->getEntityManager()->getConnection()->fetchAllAssociative($sql, ['annee' => $annee]);
        $result = $this->getEntityManager()->getConnection()->fetchAllAssociative($sql, $params);
        $etapes = [];
        foreach ($result as $etape) {
            $etapes[$etape['ETAPE_CODE']] = $etape;
@@ -126,15 +132,21 @@ class EtapeService extends AbstractEntityService
          V_RECONDUCTION_MODULATEUR 
        WHERE
          annee_id = :annee
            AND structure_id = ' . $structure->getId();

        $sql .= 'GROUP BY
          AND structure_ids LIKE :structure
        GROUP BY
          etape_id,
          etape_code,
          etape_libelle
                ORDER BY etape_id ASC';
        ORDER BY 
          etape_id ASC
        ';

        $params = [
            'annee' => $annee,
            'structure' => $structure->idsFilter(),
        ];

        $result = $this->getEntityManager()->getConnection()->fetchAllAssociative($sql, ['annee' => $annee]);
        $result = $this->getEntityManager()->getConnection()->fetchAllAssociative($sql, $params);
        $etapes = [];
        foreach ($result as $etape) {
            $etapes[$etape['ETAPE_CODE']] = $etape;
+5
Changes for module/Paiement/config/modulateur.config.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -104,6 +104,11 @@ return [
            'resources'  => ['TypeModulateur', 'Structure'],
            'assertion'  => Assertion\ModulateurAssertion::class,
        ],
        [
            'privileges' => Privileges::MODULATEUR_EDITION,
            'resources'  => ['TypeModulateurStructure'],
            'assertion'  => Assertion\ModulateurAssertion::class,
        ],
    ],

    'services' => [
Loading