"entrypoints": { | "entrypoints": { | ||||
"adminlte-plugins": { | "adminlte-plugins": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | "/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | ||||
"/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | "/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js", | "/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js", | ||||
"/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-57a6be.35767fac.js", | "/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-57a6be.35767fac.js", | ||||
"/build/adminlte-plugins.12a6c89b.js" | |||||
"/build/adminlte-plugins.a206a66e.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-57a6be.fa890b12.css" | "/build/vendors-node_modules_admin-lte_dist_js_adminlte_min_js-node_modules_bootstrap-autocomplete_di-57a6be.fa890b12.css" | ||||
}, | }, | ||||
"adminlte-index": { | "adminlte-index": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | "/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-f7c72f.c0107d2e.js", | "/build/vendors-node_modules_core-js_modules_es_array_filter_js-node_modules_core-js_modules_es_array-f7c72f.c0107d2e.js", | ||||
"/build/adminlte-index.848d15a8.js" | |||||
"/build/adminlte-index.3de48d32.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/adminlte-index.e4548695.css" | "/build/adminlte-index.e4548695.css" | ||||
}, | }, | ||||
"adminlte-form": { | "adminlte-form": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | "/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | ||||
"/build/adminlte-form.66bf23e9.js" | |||||
"/build/adminlte-form.4079807b.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/adminlte-form.59862983.css" | "/build/adminlte-form.59862983.css" | ||||
}, | }, | ||||
"adminlte-sort": { | "adminlte-sort": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | "/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | ||||
"/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | "/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | ||||
"/build/vendors-node_modules_jquery-ui-dist_jquery-ui_js.d62744d3.js", | "/build/vendors-node_modules_jquery-ui-dist_jquery-ui_js.d62744d3.js", | ||||
"/build/adminlte-sort.b528cdf7.js" | |||||
"/build/adminlte-sort.72f3a9ea.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/adminlte-sort.8d9ca659.css" | "/build/adminlte-sort.8d9ca659.css" | ||||
}, | }, | ||||
"adminlte-field-filemanager": { | "adminlte-field-filemanager": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/adminlte-field-filemanager.a2c5059a.js" | |||||
"/build/adminlte-field-filemanager.d8302fb7.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/adminlte-field-filemanager.aacd1c4c.css" | "/build/adminlte-field-filemanager.aacd1c4c.css" | ||||
}, | }, | ||||
"adminlte-field-collection": { | "adminlte-field-collection": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | "/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | ||||
"/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | "/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | ||||
"/build/vendors-node_modules_jquery-ui-dist_jquery-ui_js.d62744d3.js", | "/build/vendors-node_modules_jquery-ui-dist_jquery-ui_js.d62744d3.js", | ||||
"/build/adminlte-field-collection.764e7e37.js" | |||||
"/build/adminlte-field-collection.db18b61c.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/adminlte-field-collection.55dda2c2.css" | "/build/adminlte-field-collection.55dda2c2.css" | ||||
}, | }, | ||||
"adminlte-main": { | "adminlte-main": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | ||||
"/build/adminlte-main.9b6dba80.js" | |||||
"/build/adminlte-main.e8feeffc.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/adminlte-main.bbf0afa0.css" | |||||
"/build/adminlte-main.87244ec8.css" | |||||
] | ] | ||||
}, | }, | ||||
"sov-reminder": { | "sov-reminder": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/sov-reminder.05b85c23.js" | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/sov-reminder.27580486.js" | |||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/sov-reminder.05d9ff45.css" | "/build/sov-reminder.05d9ff45.css" | ||||
}, | }, | ||||
"sov-ticket": { | "sov-ticket": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/sov-ticket.da296284.js" | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/sov-ticket.df76c7a0.js" | |||||
] | ] | ||||
}, | }, | ||||
"app-backend": { | "app-backend": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | "/build/vendors-node_modules_core-js_modules_es_array_find_js.5b9cb885.js", | ||||
"/build/app-backend.9246973d.js" | "/build/app-backend.9246973d.js" | ||||
}, | }, | ||||
"app-frontend": { | "app-frontend": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | ||||
"/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | "/build/vendors-node_modules_jquery_src_jquery_js.2a8ff255.js", | ||||
"/build/app-frontend.0eab0ec9.js" | "/build/app-frontend.0eab0ec9.js" | ||||
], | ], | ||||
"css": [ | "css": [ | ||||
"/build/app-frontend.0ae7c1c8.css" | |||||
"/build/app-frontend.1e476ca5.css" | |||||
] | ] | ||||
}, | }, | ||||
"app-bulle": { | "app-bulle": { | ||||
"js": [ | "js": [ | ||||
"/build/runtime.061a64b9.js", | |||||
"/build/runtime.cbcc88f9.js", | |||||
"/build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-e7c189.7a170faa.js", | "/build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-e7c189.7a170faa.js", | ||||
"/build/app-bulle.522340dc.js" | "/build/app-bulle.522340dc.js" | ||||
] | ] |
{ | { | ||||
"build/adminlte-plugins.js": "/build/adminlte-plugins.12a6c89b.js", | |||||
"build/adminlte-plugins.js": "/build/adminlte-plugins.a206a66e.js", | |||||
"build/adminlte-index.css": "/build/adminlte-index.e4548695.css", | "build/adminlte-index.css": "/build/adminlte-index.e4548695.css", | ||||
"build/adminlte-index.js": "/build/adminlte-index.848d15a8.js", | |||||
"build/adminlte-index.js": "/build/adminlte-index.3de48d32.js", | |||||
"build/adminlte-form.css": "/build/adminlte-form.59862983.css", | "build/adminlte-form.css": "/build/adminlte-form.59862983.css", | ||||
"build/adminlte-form.js": "/build/adminlte-form.66bf23e9.js", | |||||
"build/adminlte-form.js": "/build/adminlte-form.4079807b.js", | |||||
"build/adminlte-sort.css": "/build/adminlte-sort.8d9ca659.css", | "build/adminlte-sort.css": "/build/adminlte-sort.8d9ca659.css", | ||||
"build/adminlte-sort.js": "/build/adminlte-sort.b528cdf7.js", | |||||
"build/adminlte-sort.js": "/build/adminlte-sort.72f3a9ea.js", | |||||
"build/adminlte-field-filemanager.css": "/build/adminlte-field-filemanager.aacd1c4c.css", | "build/adminlte-field-filemanager.css": "/build/adminlte-field-filemanager.aacd1c4c.css", | ||||
"build/adminlte-field-filemanager.js": "/build/adminlte-field-filemanager.a2c5059a.js", | |||||
"build/adminlte-field-filemanager.js": "/build/adminlte-field-filemanager.d8302fb7.js", | |||||
"build/adminlte-field-collection.css": "/build/adminlte-field-collection.55dda2c2.css", | "build/adminlte-field-collection.css": "/build/adminlte-field-collection.55dda2c2.css", | ||||
"build/adminlte-field-collection.js": "/build/adminlte-field-collection.764e7e37.js", | |||||
"build/adminlte-main.css": "/build/adminlte-main.bbf0afa0.css", | |||||
"build/adminlte-main.js": "/build/adminlte-main.9b6dba80.js", | |||||
"build/adminlte-field-collection.js": "/build/adminlte-field-collection.db18b61c.js", | |||||
"build/adminlte-main.css": "/build/adminlte-main.87244ec8.css", | |||||
"build/adminlte-main.js": "/build/adminlte-main.e8feeffc.js", | |||||
"build/sov-reminder.css": "/build/sov-reminder.05d9ff45.css", | "build/sov-reminder.css": "/build/sov-reminder.05d9ff45.css", | ||||
"build/sov-reminder.js": "/build/sov-reminder.05b85c23.js", | |||||
"build/sov-ticket.js": "/build/sov-ticket.da296284.js", | |||||
"build/sov-reminder.js": "/build/sov-reminder.27580486.js", | |||||
"build/sov-ticket.js": "/build/sov-ticket.df76c7a0.js", | |||||
"build/app-backend.css": "/build/app-backend.3d882954.css", | "build/app-backend.css": "/build/app-backend.3d882954.css", | ||||
"build/app-backend.js": "/build/app-backend.9246973d.js", | "build/app-backend.js": "/build/app-backend.9246973d.js", | ||||
"build/app-frontend.css": "/build/app-frontend.0ae7c1c8.css", | |||||
"build/app-frontend.css": "/build/app-frontend.1e476ca5.css", | |||||
"build/app-frontend.js": "/build/app-frontend.0eab0ec9.js", | "build/app-frontend.js": "/build/app-frontend.0eab0ec9.js", | ||||
"build/app-bulle.js": "/build/app-bulle.522340dc.js", | "build/app-bulle.js": "/build/app-bulle.522340dc.js", | ||||
"build/runtime.js": "/build/runtime.061a64b9.js", | |||||
"build/runtime.js": "/build/runtime.cbcc88f9.js", | |||||
"build/pdfmake.js": "/build/pdfmake.fbf70324.js", | "build/pdfmake.js": "/build/pdfmake.fbf70324.js", | ||||
"build/canvg.js": "/build/canvg.5e04b23d.js", | |||||
"build/canvg.js": "/build/canvg.23051f37.js", | |||||
"build/xlsx.js": "/build/xlsx.05855660.js", | "build/xlsx.js": "/build/xlsx.05855660.js", | ||||
"build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js": "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | "build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js": "/build/vendors-node_modules_core-js_internals_export_js.a0c0cb57.js", | ||||
"build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js": "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", | "build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js": "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js", |
use App\Entity\Configuration; | use App\Entity\Configuration; | ||||
use App\Entity\IndividualData; | use App\Entity\IndividualData; | ||||
use App\Repository\DreamStore; | |||||
use App\Repository\ProjectBoostStore; | |||||
use App\Repository\ProjectInspiringStore; | |||||
use App\Repository\RevoltStore; | |||||
use App\Type\DreamType; | use App\Type\DreamType; | ||||
use App\Type\ProjectBoostType; | use App\Type\ProjectBoostType; | ||||
use App\Type\ProjectInspiringType; | use App\Type\ProjectInspiringType; | ||||
use Doctrine\ORM\QueryBuilder; | use Doctrine\ORM\QueryBuilder; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; | use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto; | use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\HiddenField; | use EasyCorp\Bundle\EasyAdminBundle\Field\HiddenField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | ||||
use Symfony\Component\HttpFoundation\Request; | |||||
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField; | use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use Lc\SovBundle\Field\CollectionField; | use Lc\SovBundle\Field\CollectionField; | ||||
use Lc\SovBundle\Field\StatusField; | use Lc\SovBundle\Field\StatusField; | ||||
use Lc\SovBundle\Generator\CsvGenerator; | |||||
class IndividualDataCrudController extends AbstractCrudController | class IndividualDataCrudController extends AbstractCrudController | ||||
{ | { | ||||
protected DreamStore $dreamStore; | |||||
protected RevoltStore $revoltStore; | |||||
protected ProjectBoostStore $projectBoostStore; | |||||
protected ProjectInspiringStore $projectInspiringStore; | |||||
public function __construct( | |||||
DreamStore $dreamStore, | |||||
RevoltStore $revoltStore, | |||||
ProjectBoostStore $projectBoostStore, | |||||
ProjectInspiringStore $projectInspiringStore | |||||
) { | |||||
$this->dreamStore = $dreamStore; | |||||
$this->revoltStore = $revoltStore; | |||||
$this->projectBoostStore = $projectBoostStore; | |||||
$this->projectInspiringStore = $projectInspiringStore; | |||||
} | |||||
public static function getEntityFqcn(): string | public static function getEntityFqcn(): string | ||||
{ | { | ||||
return IndividualData::class; | return IndividualData::class; | ||||
EntityDto $entityDto, | EntityDto $entityDto, | ||||
FieldCollection $fields, | FieldCollection $fields, | ||||
FilterCollection $filters | FilterCollection $filters | ||||
): QueryBuilder | |||||
{ | |||||
): QueryBuilder { | |||||
$queryBuilder = parent::createIndexQueryBuilder( | $queryBuilder = parent::createIndexQueryBuilder( | ||||
$searchDto, | $searchDto, | ||||
$entityDto, | $entityDto, | ||||
return $queryBuilder; | return $queryBuilder; | ||||
} | } | ||||
public function configureActions(Actions $actions): Actions | |||||
{ | |||||
parent::configureActions($actions); | |||||
$export = Action::new('export', 'actions.export') | |||||
->setIcon('fa fa-download') | |||||
->linkToCrudAction('exportCsv') | |||||
->setCssClass('btn btn-primary') | |||||
->createAsGlobalAction(); | |||||
return $actions->add(Crud::PAGE_INDEX, $export); | |||||
} | |||||
public function exportCsv(Request $request) | |||||
{ | |||||
$csv = new CsvGenerator(); | |||||
$csv->enableConvertEncoding('ISO-8859-1'); | |||||
$csv->setTitle('Export_Liste', true); | |||||
$columns = [ | |||||
'category' => 'Catégorie', | |||||
'thematic' => 'Thématique', | |||||
'subthematic' => 'Contribution', | |||||
'territory' => 'Lieu', | |||||
'description' => 'Description' | |||||
]; | |||||
$csv->setColumns($columns); | |||||
$resultArray = $this->generateAllResultArray(); | |||||
$csv = $this->generateCsvData($csv, $resultArray); | |||||
return $csv->getReponse(); | |||||
} | |||||
private function generateAllResultArray(): array | |||||
{ | |||||
$dreamArray = $this->dreamStore->get(); | |||||
$revoltArray = $this->revoltStore->get(); | |||||
$projectBoostArray = $this->projectBoostStore->get(); | |||||
$projectInspiringArray = $this->projectInspiringStore->get(); | |||||
return array_merge($dreamArray, $revoltArray, $projectBoostArray, $projectInspiringArray); | |||||
} | |||||
private function generateCsvData($csv, $resultArray) | |||||
{ | |||||
foreach ($resultArray as $result) { | |||||
$territory = $subthematic = $thematic = ""; | |||||
if ($result->getIndividualData()) { | |||||
$territory = $result->getIndividualData()->getTerritory()->getName(); | |||||
if ($result->getSubthematic()) { | |||||
$subthematic = $result->getSubthematic()->getName(); | |||||
} | |||||
if ($result->getThematic()) { | |||||
$thematic = $result->getThematic()->getName(); | |||||
} | |||||
$data = [ | |||||
'category' => $result->__toString(), | |||||
'thematic' => $thematic, | |||||
'subthematic' => $subthematic, | |||||
'territory' => $territory, | |||||
'description' => $result->getDescription() | |||||
]; | |||||
$csv->row($data); | |||||
} | |||||
} | |||||
return $csv; | |||||
} | |||||
} | } |
revolt: | revolt: | ||||
description: Description | description: Description | ||||
thematic: Thématique | thematic: Thématique | ||||
subthematic: Sous-thème | |||||
subthematic: Sous-thème | |||||
actions: | |||||
export: Export CSV |