diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index 5dcd158f6..a7404b879 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -86,6 +86,9 @@ class ExportController extends AbstractController { /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ $exportManager = $this->exportManager; + + $export = $exportManager->getExport($alias); + $key = $request->query->get('key', null); [$dataCenters, $dataExport, $dataFormatter] = $this->rebuildData($key); @@ -100,7 +103,8 @@ class ExportController extends AbstractController $viewVariables = [ 'alias' => $alias, - 'export' => $exportManager->getExport($alias), + 'export' => $export, + 'export_group' => $this->getExportGroup($export), ]; if ($formater instanceof \Chill\MainBundle\Export\Formatter\CSVListFormatter) { @@ -316,6 +320,7 @@ class ExportController extends AbstractController 'form' => $form->createView(), 'export_alias' => $alias, 'export' => $export, + 'export_group' => $this->getExportGroup($export), ]); } @@ -371,6 +376,7 @@ class ExportController extends AbstractController [ 'form' => $form->createView(), 'export' => $export, + 'export_group' => $this->getExportGroup($export), ] ); } @@ -514,6 +520,7 @@ class ExportController extends AbstractController [ 'form' => $form->createView(), 'export' => $export, + 'export_group' => $this->getExportGroup($export), ] ); } @@ -565,4 +572,19 @@ class ExportController extends AbstractController throw new LogicException("the step {$step} is not defined."); } } + + private function getExportGroup($target): string + { + $exportManager = $this->exportManager; + + $groups = $exportManager->getExportsGrouped(true); + + foreach ($groups as $group => $array) { + foreach ($array as $alias => $export) { + if ($export === $target) { + return $group; + } + } + } + } } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/download.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/download.html.twig index 505c22ab4..fa568d857 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/download.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/download.html.twig @@ -36,6 +36,11 @@ window.addEventListener("DOMContentLoaded", function(e) { {% block content %}
+
+ + {{ export_group|trans }} +
+

{{ export.title|trans }}

{{ "Download export"|trans }}

diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/new.html.twig index 4ee857f00..8aac6c253 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/new.html.twig @@ -27,6 +27,11 @@ {% block content %}
+
+ + {{ export_group|trans }} +
+

{{ export.title|trans }}

{{ export.description|trans }}

diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig index 9adad67df..4a2d9ab9e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/new_centers_step.html.twig @@ -23,6 +23,11 @@ {% block content %}
+
+ + {{ export_group|trans }} +
+

{{ export.title|trans }}

{{ export.description|trans }}

diff --git a/src/Bundle/ChillMainBundle/Resources/views/Export/new_formatter_step.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Export/new_formatter_step.html.twig index 4854b1c9d..443816611 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Export/new_formatter_step.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Export/new_formatter_step.html.twig @@ -22,6 +22,11 @@ {% block content %}
+ +
+ + {{ export_group|trans }} +

{{ export.title|trans }}