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

Substitution Changement visuelle

parent 16964f20
Loading
Loading
Loading
Loading
Loading
+27 −8
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ use Application\Entity\Db\Etablissement;
use Application\Entity\Db\EcoleDoctorale;
use Application\Entity\Db\UniteRecherche;
use Application\Entity\Db\TypeStructure;
use Application\Entity\Db\Structure;
use Application\Entity\Db\StructureConcreteInterface;

/**
 * @var Etablissement[] $etablissementsSubstitues
@@ -20,8 +22,12 @@ use Application\Entity\Db\TypeStructure;
        <span class="badge"><?php echo count($etablissementsSubstitues) + count($ecolesSubstituees) + count($unitesSubstituees); ?></span>
</h1>

<div class="col-md-4" >
    <h3> Établissements </h3>
<div class="box panel panel-info" >
    <div class="panel-heading">
        <h2 class="first"> Établissements </h2>
    </div>

    <div class="panel-body">

    <p>
    <a href="<?php echo $this->url('substitution-creer', ['type' => TypeStructure::CODE_ETABLISSEMENT], [], true);?>" title="Création d'un nouvel établissement de substitution">
@@ -33,9 +39,13 @@ use Application\Entity\Db\TypeStructure;
        <?php echo generateInfos($etablissementsSubstitues, "établissement", "établissements", $this); ?>
    </p>
    </div>
</div>

<div class="col-md-4" >
    <h3> Écoles doctorales </h3>
<div class="box panel panel-info" >
    <div class="panel-heading">
        <h2 class="first"> Écoles doctorales </h2>
    </div>
    <div class="panel-body">

    <p>
        <a href="<?php echo $this->url('substitution-creer', ['type' => TypeStructure::CODE_ECOLE_DOCTORALE], [], true);?>" title="Création d'un nouvel établissement de substitution">
@@ -47,13 +57,18 @@ use Application\Entity\Db\TypeStructure;
        <?php echo generateInfos($ecolesSubstituees, "école doctorale", "écoles doctorales", $this); ?>
    </p>
    </div>
</div>

<div class="box panel panel-info" >
    <div class="panel-heading">
        <h2 class="first"> Unités de recherche </h2>
    </div>
    <div class="panel-body">

<div class="col-md-4" >
    <h3> Unités de recherche </h3>

    <p>
        <a href="<?php echo $this->url('substitution-creer', ['type' => TypeStructure::CODE_UNITE_RECHERCHE], [], true);?>" title="Création d'un nouvel établissement de substitution">
            <button class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Créer une substitution </button>
            <button class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Créer une structure de substitution </button>
        </a>
    </p>

@@ -61,6 +76,7 @@ use Application\Entity\Db\TypeStructure;
        <?php echo generateInfos($unitesSubstituees, "unité de recherche", "unités de recherche", $this); ?>
    </p>
    </div>
</div>

<?php
    function generateInfos($structuresSubstituees, $singulier, $pluriel, $view) {
@@ -73,17 +89,20 @@ use Application\Entity\Db\TypeStructure;
            $texte .= count($structuresSubstituees) . " " . $singulier . ".";
        }
        if ($count > 0) {
            $texte .= '<table class="table-bordered" style="width:100%">';
            $texte .= '<table class="table table-bordered">';
            $texte .= '<thead>';
            $texte .= '<tr>';
            $texte .= '    <th> Libellé </th>';
            $texte .= '    <th> #Structures </th>';
            $texte .= '    <th> Actions </th>';
            $texte .= '</tr>';
            $texte .= '</thead>';
            $texte .= '<tbody>';
            foreach ($structuresSubstituees as $structureSubstituee) {
                /** @var StructureConcreteInterface $structureSubstituee */
                $texte .= '<tr>';
                $texte .= '    <td>' . $structureSubstituee->getLibelle() . '</td>';
                $texte .= '    <td>' . count($structureSubstituee->getStructure()->getStructuresSubstituees()) . '</td>';
                $texte .= '    <td style="text-align:center;">';
                $texte .= '      <a href="' . $view->url('substitution-modifier', ['cible' => $structureSubstituee->getStructure()->getId()], [], true) . '"><span class="glyphicon glyphicon-pencil"></span></a>';
                $texte .= "&nbsp;";