Commit 5cd8164c authored by Thibaut Vallee's avatar Thibaut Vallee
Browse files

possibilite de ne pas afficher le type de validation

parent 91c77e11
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ class ValidationInstance implements HistoriqueAwareInterface {

    public function toStringJustification() : string
    {
        if ($this->getJustification() === null) return "Aucune justification associée à la validation";
        if ($this->getJustification() === null || $this->getJustification()==="") return "Aucune justification associée à la validation";
        return $this->getJustification();
    }

+4 −0
Original line number Diff line number Diff line
@@ -13,6 +13,10 @@ class ValidationAfficherViewHelper extends AbstractHelper
    /**
     * @param ValidationInstance $validation
     * @param array $options
     * @desc Options possible :
     * 'afficher-code' default false : affiche le code du type de validation
     * 'afficher-type' default true : affiche le libellé du type de validation
     * 'afficher-justification' default true : affiche la justification
     * @return string|Partial
     */
    public function __invoke(ValidationInstance $validation, array $options = [])
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use UnicaenValidation\Entity\Db\ValidationInstance;
$type = $instance->getType();

$afficherCode = isset($options['afficher-code']) && $options['afficher-code'] === true ;
$afficherType = ($options['afficher-type']) ?? true ;
$afficherJustificatif = isset($options['afficher-justificatif']) && $options['afficher-justificatif'] === true ;

?>
@@ -20,8 +21,10 @@ $afficherJustificatif = isset($options['afficher-justificatif']) && $options['af
            <code><?php echo $type->getCode(); ?></code>
        <?php endif; ?>

        <?php if ($afficherCode) : ?>
        <strong><?php echo $type->getLibelle(); ?></strong>
        <br>
        <?php endif; ?>

        <?php echo $instance->toStringRefus() ?>