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

Merge branch 'Sigle_Etablissement' into 'master'

Sigle etablissement

See merge request dsi/sygal!10
parents 958f85c3 0608c379
Loading
Loading
Loading
Loading
Loading
+17 −1
Changes for module/Application/src/Application/Entity/Db/Etablissement.php: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -102,6 +102,22 @@ class Etablissement implements HistoriqueAwareInterface, SourceAwareInterface
        $this->getStructure()->setLibelle($libelle);
    }

    /**
     * @return string
     */
    public function getSigle()
    {
        return $this->getStructure()->getSigle();
    }

    /**
     * @param string $sigle
     */
    public function setSigle($sigle)
    {
        $this->getStructure()->setSigle($sigle);
    }

    /**
     * @return string
     */
@@ -124,7 +140,7 @@ class Etablissement implements HistoriqueAwareInterface, SourceAwareInterface
    public function getLogoContent()
    {
        if ($this->getCheminLogo() === null) {
            $image = Util::createImageWithText("Aucun logo pour l'Etab|" . $this->getCode() . "|" . $this->getLibelle(), 200, 200);
            $image = Util::createImageWithText("Aucun logo pour l'Etab|" . $this->getSigle(), 200, 200);
            return $image;
        }
        return file_get_contents(APPLICATION_DIR . $this->getCheminLogo()) ?: null;
+4 −4
Changes for module/Application/src/Application/Form/EtablissementForm.php: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ class EtablissementForm extends Form
            ->add(new Hidden('id'));

        $this->add((
            new Text('code'))
                ->setLabel("Code :")
            new Text('sigle'))
                ->setLabel("Sigle :")
        );

        $this
@@ -54,8 +54,8 @@ class EtablissementForm extends Form


        $this->setInputFilter((new Factory())->createInputFilter([
            'code' => [
                'name' => 'code',
            'sigle' => [
                'name' => 'Sigle',
                'required' => true,
            ],
            'libelle' => [
+2 −0
Changes for module/Application/src/Application/Form/Hydrator/EtablissementHydrator.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ class EtablissementHydrator extends DoctrineObject
    {
        $data = parent::extract($etablissement);
        $data['libelle'] = $etablissement->getLibelle();
        $data['sigle'] = $etablissement->getSigle();
        $data['cheminLogo'] = $etablissement->getCheminLogo();

        return $data;
@@ -35,6 +36,7 @@ class EtablissementHydrator extends DoctrineObject
        $object = parent::hydrate($data, $etablissement);

        $object->setLibelle($data['libelle']);
        $object->setSigle($data['sigle']);
        $object->setCheminLogo($data['cheminLogo']);

        return $object;
+2 −2
Changes for module/Application/view/application/etablissement/index.phtml: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ $selectedEcole = null;
    <thead>
    <tr>
        <th><?php echo $this->translate("Libellé") ?></th>
        <th><?php echo $this->translate("Code") ?></th>
        <th><?php echo $this->translate("Sigle") ?></th>
        <th><?php echo $this->translate("Actions") ?></th>
    </tr>
    </thead>
@@ -45,7 +45,7 @@ $selectedEcole = null;
                    <?php echo $this->etab($etablissement)->getLibelle() ?>
                </a>
            </td>
            <td><?php echo $etablissement->getCode() ?></td>
            <td><?php echo $etablissement->getSigle() ?></td>
            <td>
                <?php if ($this->isAllowed(EcoleDoctoralePrivileges::getResourceId(EcoleDoctoralePrivileges::ECOLE_DOCT_MODIFICATION))): ?>
                    <?php if ($etablissement->estNonHistorise()): ?>
+1 −1
Changes for module/Application/view/application/etablissement/modifier.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ $fcg = $this->formControlGroup();
<?php echo $this->form()->openTag($form->prepare()->setAttribute('class', 'etablissement')) ?>
<?php echo $this->formHidden($form->get('id')) ?>
<?php echo $fcg($form->get('libelle')) ?>
<?php echo $fcg($form->get('code')) ?>
<?php echo $fcg($form->get('sigle')) ?>

    <div id="logo-div">
        <?php