Commit 6e0157a8 by Yvon Kerdoncuff

Merge branch '5952-dont-display-selfeval-if-not-submitted' into 'ssa-gironde'

dont display presta self eval form if not submitted, in public page

See merge request cooperatic/kohinos-tav!61
parents ac735522 0e997568
...@@ -48,12 +48,15 @@ class PrestatairesController extends FrontController ...@@ -48,12 +48,15 @@ class PrestatairesController extends FrontController
// If feature activated, display self evaluation form // If feature activated, display self evaluation form
if ($this->getParameter('presta_self_init_and_eval') == true) { if ($this->getParameter('presta_self_init_and_eval') == true) {
$quiz = $prestataire->getSelfEvalPrestaQuiz(); $quiz = $prestataire->getSelfEvalPrestaQuiz();
if ($quiz->isSubmitted) {
$formClass = Prestataire::DISTRIBUTOR === $prestataire->getMarketChannelFunction() ? $formClass = Prestataire::DISTRIBUTOR === $prestataire->getMarketChannelFunction() ?
DistributorSelfEvalPrestaQuizType::class : ProducerSelfEvalPrestaQuizType::class; DistributorSelfEvalPrestaQuizType::class : ProducerSelfEvalPrestaQuizType::class;
$form = $this->createForm($formClass, $quiz, ["mode" => SelfEvalPrestaQuizType::READONLY]); $form = $this->createForm($formClass, $quiz, ["mode" => SelfEvalPrestaQuizType::READONLY]);
$templateData['form'] = $form->createView(); $templateData['form'] = $form->createView();
} }
}
return $this->render('@kohinos/presta/show.html.twig', $templateData); return $this->render('@kohinos/presta/show.html.twig', $templateData);
} }
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% if app.user and presta_self_init_and_eval and presta.selfEvalPrestaQuiz %} {% if app.user and presta_self_init_and_eval and presta.selfEvalPrestaQuiz and presta.selfEvalPrestaQuiz.isSubmitted %}
{% set prestataire = presta %} {% set prestataire = presta %}
<div class="card-header"> <div class="card-header">
<h2>{{ 'Questionnaire'|trans }}</h2> <h2>{{ 'Questionnaire'|trans }}</h2>
......
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