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,11 +48,14 @@ class PrestatairesController extends FrontController
// If feature activated, display self evaluation form
if ($this->getParameter('presta_self_init_and_eval') == true) {
$quiz = $prestataire->getSelfEvalPrestaQuiz();
$formClass = Prestataire::DISTRIBUTOR === $prestataire->getMarketChannelFunction() ?
DistributorSelfEvalPrestaQuizType::class : ProducerSelfEvalPrestaQuizType::class;
$form = $this->createForm($formClass, $quiz, ["mode" => SelfEvalPrestaQuizType::READONLY]);
$templateData['form'] = $form->createView();
if ($quiz->isSubmitted) {
$formClass = Prestataire::DISTRIBUTOR === $prestataire->getMarketChannelFunction() ?
DistributorSelfEvalPrestaQuizType::class : ProducerSelfEvalPrestaQuizType::class;
$form = $this->createForm($formClass, $quiz, ["mode" => SelfEvalPrestaQuizType::READONLY]);
$templateData['form'] = $form->createView();
}
}
return $this->render('@kohinos/presta/show.html.twig', $templateData);
......
......@@ -92,7 +92,7 @@
{% endfor %}
</ul>
{% 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 %}
<div class="card-header">
<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