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

Merge branch 'hotfix_justificatif'

parents d12dd01c 0ad53fb3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Soutenance\Entity;

use Application\Entity\Db\NatureFichier;
use Application\Entity\Db\These;
use DateInterval;
use DateTime;
@@ -350,6 +351,11 @@ class Proposition implements HistoriqueAwareInterface {
        return $this->justificatifs->toArray();
    }

    /**
     * @param string $nature
     * @param null $membre
     * @return Justificatif|null
     */
    public function getJustificatif($nature, $membre = null) {
        /** @var Justificatif $justificatif */
        foreach ($this->justificatifs as $justificatif) {
+11 −0
Original line number Diff line number Diff line
@@ -262,8 +262,19 @@ class JustificatifService {
                    'justificatif' => $proposition->getJustificatif(NatureFichier::CODE_JUSTIFICATIF_ETRANGER, $membre),
                ];
            }


        }


        $listes = $proposition->getJustificatifs();
        $listes = array_filter($listes, function (Justificatif $a) { return $a->getFichier()->getFichier()->getNature()->getCode() === NatureFichier::CODE_AUTRES_JUSTIFICATIFS;});
        foreach ($listes as $element) {
            $justificatifs[] = [
                'type' => NatureFichier::CODE_AUTRES_JUSTIFICATIFS,
                'justificatif' => $element,
            ];
        }
        return $justificatifs;
    }

+4 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 */

use Application\Controller\Plugin\UrlFichierThese;
use Application\Entity\Db\NatureFichier;
use Soutenance\Entity\Justificatif;

$these = $justificatif->getProposition()->getThese();
@@ -30,6 +31,9 @@ $membre = $justificatif->getMembre();
        $label .= $membre->getDenomination();
        $label .= "</strong>";
    }
    if ($justificatif->getFichier()->getFichier()->getNature()->getCode() === NatureFichier::CODE_AUTRES_JUSTIFICATIFS) {
        $label .= "'".$justificatif->getFichier()->getFichier()->getNomOriginal()."'";
    }
?>

<a href="<?php echo $urlFichierThese->telechargerFichierThese($these, $fichierThese); ?>">