Commit d30ccaea by Yvon Kerdoncuff

Merge branch '5647-show-prestataire-info' into 'ssa-gironde'

show presta extra data (products and conventionnement) if param activated

See merge request cooperatic/kohinos-tav!59
parents 95e2b8dd d05f4c3d
......@@ -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,9 +80,21 @@
{% 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></div>
<div class="card-header"><h2>{{ 'Questionnaire'|trans }}</h2></div>
<div class="card-body">
{% if presta.marketChannelFunction == 'distributor' %}
{% include '@kohinos/tav/prestaquiz/distributor_core.html.twig' %}
......
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