mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
First version of export person - 'rfs #400
This commit is contained in:
@@ -118,7 +118,7 @@ class PersonController extends Controller
|
||||
return $this->redirect($url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function searchAction()
|
||||
{
|
||||
$q = $this->getRequest()->query->getAlnum('q', '');
|
||||
@@ -176,6 +176,26 @@ class PersonController extends Controller
|
||||
'pattern' => $q
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a csv file with all the persons
|
||||
*
|
||||
* @return A csv file with all the persons
|
||||
*/
|
||||
public function exportAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$persons = $em->getRepository('ChillPersonBundle:Person')->findAll();
|
||||
|
||||
$response = $this->render('ChillPersonBundle:Person:export.csv.twig',
|
||||
array(
|
||||
'persons' => $persons,
|
||||
'cf_group' => $this->getCFGroup()));
|
||||
$response->headers->set('Content-Type', 'text/csv');
|
||||
$response->headers->set('Content-Disposition', 'attachment; filename="export.csv"');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function newAction()
|
||||
{
|
||||
|
Reference in New Issue
Block a user