diff --git a/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php b/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php index 6456d1a58c..8d6ae605ee 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php @@ -51,13 +51,13 @@ class DoDownload implements ControllerProviderInterface * * description : Prepare a set of documents for download * - * method : POST + * method : GET * * parameters : none * * return : HTML Response */ - $controllers->post('/{token}/prepare/', $this->call('prepareDownload')) + $controllers->get('/{token}/prepare/', $this->call('prepareDownload')) ->bind('prepare_download') ->assert('token', '^[a-zA-Z0-9]{8,16}$'); @@ -128,12 +128,14 @@ class DoDownload implements ControllerProviderInterface $records[sprintf('%s_%s', $sbasId, $file['record_id'])] = new \record_adapter($app, $sbasId, $file['record_id']); } - return new Reponse($app['twig']->render( + return $app['twig']->render( '/prod/actions/Download/prepare.html.twig', array( - 'datas' => $list, - 'records' => $records, - 'token' => $token - ))); + 'module_name' => _('Export download'), + 'module' => _('Export'), + 'list' => $list, + 'records' => $records, + 'token' => $token + )); } /** @@ -168,7 +170,7 @@ class DoDownload implements ControllerProviderInterface $mime = 'application/zip'; } - if(!$app['file-system']->exists($exportFile)) { + if(!$app['filesystem']->exists($exportFile)) { $app->abort(404); } @@ -184,7 +186,7 @@ class DoDownload implements ControllerProviderInterface 'attachment' ); - return $response; + $response->send(); } diff --git a/templates/web/prod/actions/Download/prepare.html.twig b/templates/web/prod/actions/Download/prepare.html.twig index 62484d3c4f..6c3274ef58 100644 --- a/templates/web/prod/actions/Download/prepare.html.twig +++ b/templates/web/prod/actions/Download/prepare.html.twig @@ -2,13 +2,12 @@ {% block content %}
{% trans "telechargement::Veuillez patienter, vos fichiers sont en train d\'etre rassembles pour le telechargement, cette operation peut prendre quelques minutes." %}
- {% else list['complete'] %} + {% elseif list['complete'] is defined and list['complete'] %}{% set url = "/download/"~ token ~"/get/" %} {% trans %} @@ -29,7 +28,7 @@