mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
handling form for exportInterface
This commit is contained in:
parent
5dd98945f8
commit
e57b421aec
@ -402,7 +402,7 @@ class ExportManager
|
||||
'class' => self::class, 'function' => __FUNCTION__
|
||||
));
|
||||
|
||||
$result = $export->getResult($qb, array());
|
||||
$result = $export->getResult($qb, $data[ExportType::EXPORT_KEY]);
|
||||
|
||||
/* @var $formatter Formatter\CSVFormatter */
|
||||
$formatter = $this->getFormatter($this->getFormatterAlias($data));
|
||||
@ -414,8 +414,13 @@ class ExportManager
|
||||
$aggregatorsData[$alias] = $data[ExportType::AGGREGATOR_KEY][$alias]['form'];
|
||||
}
|
||||
|
||||
return $formatter->getResponse($result, $formatterData, $exportAlias, $data,
|
||||
$filters, $aggregatorsData);
|
||||
return $formatter->getResponse(
|
||||
$result,
|
||||
$formatterData,
|
||||
$exportAlias,
|
||||
$data[ExportType::EXPORT_KEY],
|
||||
$filters,
|
||||
$aggregatorsData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -141,9 +141,14 @@ class CSVFormatter implements FormatterInterface
|
||||
* @param \Chill\MainBundle\Export\FilterInterface[] $filters
|
||||
* @param \Chill\MainBundle\Export\AggregatorInterface[] $aggregators
|
||||
*/
|
||||
public function getResponse($result, $formatterData, $exportAlias, array $exportData, array $filtersData,
|
||||
array $aggregatorsData)
|
||||
{
|
||||
public function getResponse(
|
||||
$result,
|
||||
$formatterData,
|
||||
$exportAlias,
|
||||
array $exportData,
|
||||
array $filtersData,
|
||||
array $aggregatorsData
|
||||
) {
|
||||
$this->result = $result;
|
||||
$this->orderingHeaders($formatterData);
|
||||
$this->export = $this->exportManager->getExport($exportAlias);
|
||||
|
@ -28,6 +28,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Chill\MainBundle\Export\ExportManager;
|
||||
use Chill\MainBundle\Form\Type\Export\FilterType;
|
||||
use Chill\MainBundle\Form\Type\Export\AggregatorType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FormType;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -90,6 +91,12 @@ class ExportType extends AbstractType
|
||||
|
||||
$builder->add($aggregatorBuilder);
|
||||
|
||||
// add export form
|
||||
$exportBuilder = $builder->create(self::EXPORT_KEY, FormType::class, array('compound' => true));
|
||||
$this->exportManager->getExport($options['export_alias'])
|
||||
->buildForm($exportBuilder);
|
||||
$builder->add($exportBuilder);
|
||||
|
||||
$builder->add(self::PICK_FORMATTER_KEY, PickFormatterType::class, array(
|
||||
'export_alias' => $options['export_alias']
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user