Skip to content
Snippets Groups Projects
Commit 5cd8164c authored by Thibaut Vallee's avatar Thibaut Vallee
Browse files

possibilite de ne pas afficher le type de validation

parent 91c77e11
No related branches found
No related tags found
No related merge requests found
Pipeline #26834 passed
......@@ -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();
}
......
......@@ -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 = [])
......
......@@ -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() ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment