Commit 230ce048 by Yvon

Merge branch 'ssa-gironde' into 5767-late-autoevaluation-presta-edit

parents 55b9e57b d30ccaea
......@@ -12,4 +12,5 @@ twig:
'%kernel.project_dir%/templates/themes/kohinos': kohinos
globals:
tav_env: '%env(TAV_ENV)%'
presta_self_init_and_eval: '%env(PRESTA_SELF_INIT_AND_EVAL)%'
\ No newline at end of file
presta_self_init_and_eval: '%env(PRESTA_SELF_INIT_AND_EVAL)%'
presta_extra_data: '%env(PRESTA_EXTRA_DATA)%'
\ No newline at end of file
......@@ -43,15 +43,19 @@ class PrestatairesController extends FrontController
return new RedirectResponse($this->router->generate('index'));
}
$quiz = $prestataire->getSelfEvalPrestaQuiz();
$formClass = Prestataire::DISTRIBUTOR === $prestataire->getMarketChannelFunction() ?
DistributorSelfEvalPrestaQuizType::class : ProducerSelfEvalPrestaQuizType::class;
$form = $this->createForm($formClass, $quiz, ["mode" => SelfEvalPrestaQuizType::READONLY]);
return $this->render('@kohinos/presta/show.html.twig', [
'presta' => $prestataire,
'form' => $form->createView()
]);
$templateData = ['presta' => $prestataire];
// 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();
}
return $this->render('@kohinos/presta/show.html.twig', $templateData);
}
/**
......
......@@ -50,6 +50,9 @@
{% if presta.web != null %}
<h6 class="card-subtitle mb-3">{{'Site web'|trans}} : <a href='{{ presta.web }}' target='_blank' rel='noopener noreferrer'>{{ presta.web }}</a></h6>
{% endif %}
{% if presta_extra_data and presta.conventionnement != null and presta.conventionnement > 0 %}
<h6 class="card-subtitle mb-3">{{'Pourcentage de conventionnement'|trans}} : {{ presta.conventionnement * 100 }}%</h6>
{% endif %}
{# {% if presta.responsable != null and presta.metier != null %}
<h6 class="card-title my-3">Responsable : {{ presta.responsable }} ({{ presta.metier }})</h6>
{% endif %} #}
......@@ -77,10 +80,22 @@
{% endfor %}
</ul>
{% endif %}
{% if presta_extra_data and presta.prestataireProductFamilies|length > 0%}
<div class="card-header"><h2>{{ 'Produits vendus'|trans }}</h2></div>
<ul class="list-group list-group-flush">
{% for prestataireProductFamily in presta.prestataireProductFamilies %}
{% if prestataireProductFamily.products|length > 0%}
<li class="list-group-item">
{{ prestataireProductFamily.productFamily.name }}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% if app.user and presta_self_init_and_eval and presta.selfEvalPrestaQuiz %}
{% set prestataire = presta %}
<div class="card-header">
<h2>Questionnaire</h2>
<h2>{{ 'Questionnaire'|trans }}</h2>
{% if app.user in prestataire.users and is_granted("ROLE_PRESTATAIRE") %}
<a class='btn btn-primary float-right' href="{{ path('quiz-presta-edit') }}">Corriger</a>
{% endif %}
......
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