Commit b4a32fe7 by Yvon Kerdoncuff

Merge branch '5869-presta-quizz-global-comments-required' into 'ssa-gironde'

prestataire self eval quizz: make global comments required

See merge request cooperatic/kohinos-tav!57
parents 1ac5109e 5ed283bf
......@@ -51,7 +51,7 @@ class DistributorSelfEvalPrestaQuizType extends SelfEvalPrestaQuizType
$this->opts['label'] = "Transparence et juste rémunération : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('transpar_global', ChoiceType::class, $this->opts);
$builder->add('transpar_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('transpar_global_comment', TextareaType::class, $this->globalCmtOpts);
/* PARTIE 4 : PRATIQUES AGRICOLES DURABLES */
$this->opts['label'] = "Détenez-vous des labels ou des certifications (AB, Bio, Nature et Progrès, système de garantie
......@@ -75,7 +75,7 @@ class DistributorSelfEvalPrestaQuizType extends SelfEvalPrestaQuizType
$this->opts['label'] = "Pratiques agricoles durables : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('disagdur_global', ChoiceType::class, $this->opts);
$builder->add('disagdur_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('disagdur_global_comment', TextareaType::class, $this->globalCmtOpts);
/* PARTIE 5 : LOCALITE DES PRODUITS */
$this->opts['label'] = "Quelle est la provenance de l'offre alimentaire globale en produits bruts ?";
......@@ -97,7 +97,7 @@ class DistributorSelfEvalPrestaQuizType extends SelfEvalPrestaQuizType
$this->opts['label'] = "Localité des produits : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('localite_global', ChoiceType::class, $this->opts);
$builder->add('localite_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('localite_global_comment', TextareaType::class, $this->globalCmtOpts);
//Review
if($options['mode'] !== self::PRESTA_EDIT) {
......
......@@ -56,7 +56,7 @@ class ProducerSelfEvalPrestaQuizType extends SelfEvalPrestaQuizType
$this->opts['label'] = "Pratiques agricoles durables : " . $this->labelEvalGlob . " (cochez vert si vous détenez un label ou une certification)";
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('proagdur_global', ChoiceType::class, $this->opts);
$builder->add('proagdur_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('proagdur_global_comment', TextareaType::class, $this->globalCmtOpts);
//Review
if($options['mode'] !== self::PRESTA_EDIT) {
......
......@@ -30,6 +30,7 @@ class SelfEvalPrestaQuizType extends AbstractType
protected array $opts;
protected array $reviewOpts;
protected array $cmtOpts;
protected array $globalCmtOpts;
protected array $reviewCmtOpts;
protected string $labelEvalGlob;
protected string $reviewLabel;
......@@ -80,10 +81,15 @@ class SelfEvalPrestaQuizType extends AbstractType
'required' => false,
'disabled' => $options['mode'] === self::READONLY
];
$this->cmtOpts = $this->reviewCmtOpts;
$this->cmtOpts['disabled'] = $options['mode'] !== self::PRESTA_EDIT;
$this->cmtOpts['attr']['placeholder'] = $options['mode'] !== self::PRESTA_EDIT ? '' : 'Commentaires';
$this->globalCmtOpts = $this->cmtOpts;
$this->globalCmtOpts['required'] = true;
$this->globalCmtOpts['attr']['placeholder'] = $options['mode'] !== self::PRESTA_EDIT ? '' : 'Commentaires (obligatoire)';
/* PARTIE 1 : ACCESSIBILITE ET INCLUSIVITE */
$this->opts['label'] = "Géographique et physique : le lieu est-il accessible par différents modes de transport ?";
$this->opts['choices'] = [
......@@ -117,7 +123,7 @@ class SelfEvalPrestaQuizType extends AbstractType
$this->opts['label'] = "Accessibilité et inclusivité : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('accessib_global', ChoiceType::class, $this->opts);
$builder->add('accessib_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('accessib_global_comment', TextareaType::class, $this->globalCmtOpts);
/* PARTIE 2 : BIEN-ETRE AU TRAVAIL */
$this->opts['label'] = "Le lieu met-il en place des actions pour faciliter l'accueil, l'intégration et la formation des personnes qui y travaillent ?";
......@@ -139,7 +145,7 @@ class SelfEvalPrestaQuizType extends AbstractType
$this->opts['label'] = "Bien-être au travail : " . $this->labelEvalGlob;
$this->opts['choices'] = $this->stdGlobalChoices;
$builder->add('bienetre_global', ChoiceType::class, $this->opts);
$builder->add('bienetre_global_comment', TextareaType::class, $this->cmtOpts);
$builder->add('bienetre_global_comment', TextareaType::class, $this->globalCmtOpts);
//Review
if($options['mode'] !== self::PRESTA_EDIT) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment