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

fusion + correction des vues des structures

parents 37e214d6 fec48fd5
Loading
Loading
Loading
Loading
Loading
+0 −10
Changes for module/Application/config/others/substitution.config.php: 0 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ return [
                        'detruire',
                        'generate-source-input',
                        'substitution-automatique',
                        'afficher-automatique',
                        'modifier-automatique',
                        'enregistrer-automatique',
                    ],
@@ -140,15 +139,6 @@ return [
                            ],
                        ],
                    ],
                    'afficher' => [
                        'type'          => Segment::class,
                        'options'       => [
                            'route'       => '/afficher/:type/:identifiant',
                            'defaults'    => [
                                'action' => 'afficher-automatique',
                            ],
                        ],
                    ],
                ],
            ],

+1 −1
Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ class EcoleDoctoraleController extends AbstractController

    public function indexAction()
    {
        $eds = $this->getStructureService()->getStructuresNonSubstitueesByType(TypeStructure::CODE_ECOLE_DOCTORALE, 'libelle');
        $eds = $this->getStructureService()->getAllStructuresAffichablesByType(TypeStructure::CODE_ECOLE_DOCTORALE, 'libelle');

        return new ViewModel([
            'ecoles'                         => $eds,
+7 −25
Changes for module/Application/src/Application/Controller/EtablissementController.php: 7 added lines, 25 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Application\Entity\Db\Role;
use Application\Entity\Db\SourceInterface;
use Application\Entity\Db\Structure;
use Application\Entity\Db\StructureConcreteInterface;
use Application\Entity\Db\TypeStructure;
use Application\Form\EtablissementForm;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Application\Service\Individu\IndividuServiceAwareTrait;
@@ -53,33 +54,14 @@ class EtablissementController extends AbstractController
     */
    public function indexAction()
    {
        $etablissements = $this->getEtablissementService()->getRepository()->findAll();

        $etablissementsSYGAL = $this->getEtablissementService()->getRepository()->findAllBySource(SourceInterface::CODE_SYGAL);
        $etablissementsPrincipaux = array_filter($etablissementsSYGAL, function (Etablissement $etablissement) { return count($etablissement->getStructure()->getStructuresSubstituees())==0; });
        $etablissementsSecondaires = array_diff($etablissements, $etablissementsPrincipaux);

        /** retrait des structures substituées */
        $structuresSub = array_filter($etablissementsSYGAL, function (StructureConcreteInterface $structure) { return count($structure->getStructure()->getStructuresSubstituees())!=0; });
        $toRemove = [];
        /** @var Etablissement $structure */
        foreach($structuresSub as $structure) {
            foreach ($structure->getStructure()->getStructuresSubstituees() as $sub) {
                $toRemove[] = $sub;
            }
        }
        $structures = [];
        foreach ($etablissementsSecondaires as $structure) {
            $found = false;
            foreach ($toRemove as $remove) {
                if($structure->getStructure()->getId() == $remove->getId()) $found = true;
            }
            if (!$found) $structures[] = $structure;
        }
        $etablissements = $this->getStructureService()->getAllStructuresAffichablesByType(TypeStructure::CODE_ETABLISSEMENT);

        $etablissementsPrincipaux = array_filter($etablissements, function(Etablissement $e) { return $e->estMembre(); });
        $etablissementsExternes = array_filter($etablissements, function(Etablissement $e) { return !$e->estMembre(); });

        return new ViewModel([
            'etablissementsSygal'          => $etablissementsPrincipaux,
            'etablissementsExternes'       => $structures,
            'etablissementsExternes'       => $etablissementsExternes,
        ]);
    }

@@ -321,7 +303,7 @@ class EtablissementController extends AbstractController
    {
        $chemin = "";
        if ($fullpath) $chemin .= Structure::PATH;
        if ($etablissement->getCode()) $chemin .= "/ressources/Logos/Etab/".$etablissement->getCode().".png";
        if ($etablissement->getStructure()->getCode()) $chemin .= "/ressources/Logos/Etab/".$etablissement->getStructure()->getCode().".png";
        else $chemin .= "/ressources/Logos/Etab/". uniqid().".png";
        return $chemin;
    }
+2 −2
Changes for module/Application/src/Application/Controller/ExportController.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ class ExportController extends AbstractController
            },
            //Structures
            'Etablissement'                         => function (These $these) { return $these->getEtablissement()->getLibelle(); },
            'Ecole Doctorale Code'                  => function (These $these) { if($these->getEcoleDoctorale() !== null)return $these->getEcoleDoctorale()->getCode(); else return null; },
            'Ecole Doctorale Code'                  => function (These $these) { if($these->getEcoleDoctorale() !== null)return $these->getEcoleDoctorale()->getStructure()->getCode(); else return null; },
            'Ecole Doctorale'                       => function (These $these) { if($these->getEcoleDoctorale() !== null)return $these->getEcoleDoctorale()->getLibelle(); else return null; },
            'Unité de Recherche Code'               => function (These $these) { if($these->getUniteRecherche() !== null) return $these->getUniteRecherche()->getCode(); else return null; },
            'Unité de Recherche Code'               => function (These $these) { if($these->getUniteRecherche() !== null) return $these->getUniteRecherche()->getStructure()->getCode(); else return null; },
            'Unité de Recherche'                    => function (These $these) { if($these->getUniteRecherche() !== null) return $these->getUniteRecherche()->getLibelle(); else return null; },
            'Etablissement Co-Tutelle'              => function (These $these) { return $these->getLibelleEtabCotutelle(); },
            'Pays Co-Tutelle'                       => function (These $these) { return $these->getLibellePaysCotutelle(); },
+1 −1
Changes for module/Application/src/Application/Controller/RoleController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ class RoleController extends AbstractController {
        $mappedRoles = [];
        foreach ($etablissementsMembres as $etablissement) {
            $roles = $this->getRoleService()->getRepository()->findAllRolesTheseDependantByEtablissement($etablissement);
            $mappedRoles[$etablissement->getCode()] = $roles;
            $mappedRoles[$etablissement->getStructure()->getCode()] = $roles;
        }
        return new ViewModel([
            'etablissements' => $etablissementsMembres,
Loading