Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
d05f4c3d
Commit
d05f4c3d
authored
Mar 01, 2024
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show presta extra data (products and conventionnement) if param activated
parent
95e2b8dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
12 deletions
+32
-12
twig.yaml
config/packages/twig.yaml
+3
-2
PrestatairesController.php
src/Controller/PrestatairesController.php
+13
-9
show.html.twig
templates/themes/kohinos/presta/show.html.twig
+16
-1
No files found.
config/packages/twig.yaml
View file @
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
src/Controller/PrestatairesController.php
View file @
d05f4c3d
...
...
@@ -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
);
}
/**
...
...
templates/themes/kohinos/presta/show.html.twig
View file @
d05f4c3d
...
...
@@ -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'
%}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment