Commit 9a538fa4 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

COrrection requête d'obtention de la photo auprès du SGC

parent e1e34507
Loading
Loading
Loading
Loading
+17 −3
Changes for module/Application/src/Application/Entity/Db/Doctorant.php: 17 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -38,10 +38,14 @@ class Doctorant implements DoctorantInterface, HistoriqueAwareInterface, Resourc
     * @var Collection
     */
    private $complements;

    /**
     * @var Etablissement
     */
    protected $etablissement;

    /**
     * @return mixed
     * @return Etablissement
     */
    public function getEtablissement()
    {
@@ -49,9 +53,9 @@ class Doctorant implements DoctorantInterface, HistoriqueAwareInterface, Resourc
    }

    /**
     * @param mixed $etablissement
     * @param Etablissement $etablissement
     */
    public function setEtablissement($etablissement)
    public function setEtablissement(Etablissement $etablissement)
    {
        $this->etablissement = $etablissement;
    }
@@ -88,6 +92,16 @@ class Doctorant implements DoctorantInterface, HistoriqueAwareInterface, Resourc
        return $this->sourceCode;
    }

    /**
     * Get sourceCode
     *
     * @return string
     */
    public function getSourceCodeSansPrefix()
    {
        return $this->getEtablissement()->removePrefixFrom($this->sourceCode);
    }

    /**
     * Get id
     *
+15 −1
Changes for module/Application/src/Application/Entity/Db/Etablissement.php: 15 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class Etablissement implements HistoriqueAwareInterface, SourceAwareInterface
    protected $structure;

    /**
     * Ajoute le préfixe établissement à la chaîne de caractères sépecifiée.
     * Ajoute le préfixe établissement à la chaîne de caractères spécifiée.
     *
     * @param string $string
     * @return string
@@ -43,6 +43,20 @@ class Etablissement implements HistoriqueAwareInterface, SourceAwareInterface
        return $this->getCode() . self::ETAB_PREFIX_SEP . $string;
    }

    /**
     * Supprime le préfixe établissement à la chaîne de caractères spécifiée.
     *
     * @param string $string
     * @return string
     */
    public function removePrefixFrom($string)
    {
        return substr(
            $string,
            stripos($string, self::ETAB_PREFIX_SEP) + strlen(self::ETAB_PREFIX_SEP)
        );
    }

    /**
     * Etablissement constructor.
     */
+3 −1
Changes for module/Application/view/application/these/identite.phtml: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -52,7 +52,8 @@ $persopassModifiedEvent = 'persopass-modified-event';
    <div class="panel-body">

        <div id="photo-div" class="pull-right">
            <div class="photo-placeholder loading" data-src="<?php echo $this->url('leocarte/photo', ['id' => $these->getDoctorant()->getSourceCode()]) ?>"></div>
            <div class="photo-placeholder loading"
                 data-src="<?php echo $this->url('leocarte/photo', ['id' => $these->getDoctorant()->getSourceCodeSansPrefix()]) ?>"></div>
        </div>

        <dl class="dl-horizontal">
@@ -399,6 +400,7 @@ $persopassModifiedEvent = 'persopass-modified-event';

    function loadPhoto(photoPlaceholder)
    {
        debugger;
        var photoUrl = $(photoPlaceholder).data('src');

        //create image to preload: