mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
handle DirectExport in controller and export manager
This commit is contained in:
@@ -410,7 +410,7 @@ class ExportController extends Controller
|
||||
$dataFormatter = $this->session->get('formatter_step_raw', null);
|
||||
$dataExport = $this->session->get('export_step_raw', null);
|
||||
|
||||
if ($dataFormatter === NULL) {
|
||||
if ($dataFormatter === NULL and $export instanceof \Chill\MainBundle\Export\ExportInterface) {
|
||||
return $this->redirectToRoute('chill_main_export_new', array(
|
||||
'alias' => $alias, 'step' => $this->getNextStep('generate', $export, true)
|
||||
));
|
||||
@@ -423,9 +423,9 @@ class ExportController extends Controller
|
||||
$this->session->remove('formatter_step');
|
||||
|
||||
$redirectParameters = array_merge(
|
||||
$dataFormatter,
|
||||
$dataExport,
|
||||
$dataCenters,
|
||||
$dataFormatter ?? [],
|
||||
$dataExport ?? [],
|
||||
$dataCenters ?? [],
|
||||
array('alias' => $alias)
|
||||
);
|
||||
unset($redirectParameters['_token']);
|
||||
@@ -447,6 +447,7 @@ class ExportController extends Controller
|
||||
{
|
||||
/* @var $exportManager \Chill\MainBundle\Export\ExportManager */
|
||||
$exportManager = $this->exportManager;
|
||||
$export = $exportManager->getExport($alias);
|
||||
|
||||
$formCenters = $this->createCreateFormExport($alias, 'generate_centers');
|
||||
$formCenters->handleRequest($request);
|
||||
@@ -456,13 +457,19 @@ class ExportController extends Controller
|
||||
$formExport->handleRequest($request);
|
||||
$dataExport = $formExport->getData();
|
||||
|
||||
$formFormatter = $this->createCreateFormExport($alias, 'generate_formatter',
|
||||
$dataExport);
|
||||
$formFormatter->handleRequest($request);
|
||||
$dataFormatter = $formFormatter->getData();
|
||||
if ($export instanceof \Chill\MainBundle\Export\ExportInterface) {
|
||||
$formFormatter = $this->createCreateFormExport($alias, 'generate_formatter',
|
||||
$dataExport);
|
||||
$formFormatter->handleRequest($request);
|
||||
$dataFormatter = $formFormatter->getData();
|
||||
}
|
||||
|
||||
$r = $exportManager->generate($alias, $dataCenters['centers'],
|
||||
$dataExport['export'], $dataFormatter['formatter']);
|
||||
$r = $exportManager->generate(
|
||||
$alias,
|
||||
$dataCenters['centers'],
|
||||
$dataExport['export'],
|
||||
isset($dataFormatter) ? $dataFormatter['formatter'] : []
|
||||
);
|
||||
|
||||
return $r;
|
||||
}
|
||||
@@ -480,7 +487,11 @@ class ExportController extends Controller
|
||||
$dataExport = $formExport->getData();
|
||||
|
||||
$formatterAlias = $exportManager->getFormatterAlias($dataExport['export']);
|
||||
$formater = $exportManager->getFormatter($formatterAlias);
|
||||
if ($formatterAlias !== null) {
|
||||
$formater = $exportManager->getFormatter($formatterAlias);
|
||||
} else {
|
||||
$formater = null;
|
||||
}
|
||||
|
||||
$viewVariables = [
|
||||
'alias' => $alias
|
||||
|
Reference in New Issue
Block a user