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

Ajout de l'affichage des rôles associés à une structure

parent a6a10eb1
Loading
Loading
Loading
Loading
+1
Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ class EcoleDoctoraleController extends AbstractController

        // récupération de la liste des individus de l'école doctorale séléctionnée
        $ecoleDoctoraleIndividus = null;
        $ecoleDoctoraleRoles = null;
        if ($selected) {
            /** @var EcoleDoctorale $ed */
            $ed = $this->ecoleDoctoraleService->getRepository()->find($selected);
+1
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.Structure.dcm.xml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
        <one-to-one field="etablissement" target-entity="Application\Entity\Db\Etablissement" mapped-by="structure"/>
        <one-to-one field="ecoleDoctorale" target-entity="Application\Entity\Db\EcoleDoctorale" mapped-by="structure"/>
        <one-to-one field="uniteRecherche" target-entity="Application\Entity\Db\UniteRecherche" mapped-by="structure"/>
        <one-to-many field="roles" target-entity="Application\Entity\Db\Role" mapped-by="structure"/>

    </entity>
</doctrine-mapping>
+28 −4
Changes for module/Application/src/Application/Entity/Db/Structure.php: 28 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -10,10 +10,10 @@ use UnicaenApp\Util;
class Structure
{
    /**
     * @var string id
     * @var string sigle
     * @var string libelle
     * @var string cheminLogo
     * @var string $id
     * @var string $sigle
     * @var string $libelle
     * @var string $cheminLogo
     */
    private     $id;
    protected   $sigle;
@@ -29,6 +29,11 @@ class Structure
    protected $ecoleDoctorale;
    protected $uniteRecherche;

    /**
     * @var Role[] $roles
     */
    protected $roles;

    /**
     * @return string
     */
@@ -85,6 +90,25 @@ class Structure
        $this->cheminLogo = $cheminLogo;
    }

    /**
     * @return Role[]
     */
    public function getRoles()
    {
        return $this->roles;
    }

    /**
     * @return Role[]
     */
    public function getStructureDependantRoles()
    {
        $roles = [];
        foreach($this->roles as $role) {
            if ($role->isStructureDependant()) $roles[] = $role;
        }
        return $roles;
    }


    public function __toString()
+16 −1
Changes for module/Application/view/application/ecole-doctorale/index.phtml: 16 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -76,6 +76,21 @@ $selectedEcole = null;
        <?php if ($isSelected): ?>
            <tr>
                <td colspan="3" class="bg-info">
                    <h2 class="first"><?php echo $this->translate("Rôles");?> <small><?php echo $selectedEcole ?></small></h2>

                    <?php
                            $roles = $ecole->getStructure()->getStructureDependantRoles();
                            echo "<table class='table table-condensed'>";
                            echo "<tr><th>";
                            echo $this->translate("Libellé");
                            echo "</th><th>";
                            echo $this->translate("Actions");
                            echo "</th></tr>";
                            foreach ($roles as $role) {
                                echo "<tr><td>". $role->getLibelle() ."</td><td></td></tr>";
                            }
                            echo "</table>";
                    ?>
                    <h2 class="first"><?php echo $this->translate("Membres");?> <small><?php echo $selectedEcole ?></small></h2>
                    <?php if (count($ecoleDoctoraleIndividus)): ?>
                        <table class="table table-condensed">
@@ -88,7 +103,7 @@ $selectedEcole = null;
                            foreach ($ecoleDoctoraleIndividus as $edi): ?>
                                <tr>
                                    <td><?php echo $edi->getIndividu() ?></td>
                                    <td><?php echo $edi->getRole() ?></td>
                                    <td><?php echo $edi->getRole()->getLibelle() ?></td>
                                    <td>
                                        <?php if ($this->isAllowed(EcoleDoctoralePrivileges::getResourceId(EcoleDoctoralePrivileges::ECOLE_DOCT_MODIFICATION))): ?>
                                            <?php $url = $this->url('ecole-doctorale/retirer-individu', ['ecoleDoctorale' => $ecole->getId(), 'edi' => $edi->getId()], [], true) ?>
+15
Changes for module/Application/view/application/etablissement/index.phtml: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -80,6 +80,21 @@ $selectedEcole = null;
                             src="data:image/png;base64,<?php echo base64_encode($etablissement->getLogoContent()); ?>"
                        />
                    </div>
                    <h2 class="first"><?php echo $this->translate("Rôles");?> <small><?php echo $selectedEcole ?></small></h2>

                    <?php
                    $roles = $etablissement->getStructure()->getStructureDependantRoles();
                    echo "<table class='table table-condensed'>";
                    echo "<tr><th>";
                    echo $this->translate("Libellé");
                    echo "</th><th>";
                    echo $this->translate("Actions");
                    echo "</th></tr>";
                    foreach ($roles as $role) {
                        echo "<tr><td>". $role->getLibelle() ."</td><td></td></tr>";
                    }
                    echo "</table>";
                    ?>
                    <h2 class="first"><?php echo $this->translate("Membres");?> <small><?php echo $selectedEtablissement ?></small></h2>
<!--  INDIVIDU                  -->
<!--                    --><?php //if (count($etablissementIndividus)): ?>
Loading