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 de documents" %}

-
- {% if list['complete'] is not defined or not list['complete']%} + {% if (list['complete'] is not defined or not list['complete']) and list['count'] > 1%}

{% 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 @@ {% trans "document:: nom" %} {% trans "phrseanet:: sous definition" %} {% trans "poids" %} - {#thumbnail#} + @@ -37,7 +36,7 @@ {% for file in list["files"] %} {% set size = 0 %} - {{ app|sbas_fom_bas(file['base_id'])|sbas_names(app) }} {{ file['base_id']|bas_names(app) }} + {{ app|sbas_from_bas(file['base_id'])|sbas_names(app) }} {{ file['base_id']|bas_names(app) }} {{ file['original_name'] }} {% for subdef in file['subdefs'] %} @@ -47,17 +46,17 @@ {{ size|formatOctets }} - {% set key = app|sbas_from_bas(file['base_id']) ~'_'~ file['record_id']%} + {% set record_key = app|sbas_from_bas(file['base_id']) ~'_'~ file['record_id']%} - {% if key in records|keys %} - {% set record = attribute(records, key) %} - {% set thumbnail = record.getThumbnail() %} + {% if record_key in records|keys %} + {% set record = attribute(records, record_key) %} + {% set thumbnail = record.get_thumbnail() %} {% if thumbnail.is_paysage() %} {% set w = 140 %} - {% set h = (w / (thumbnail.get_widh() / thumbnail.get_height()))|round %} + {% set h = (w / (thumbnail.get_width() / thumbnail.get_height()))|round %} {% else %} {% set h = 105 %} - {% set w = (h * (thumbnail.get_widh() / thumbnail.get_height()))|round %} + {% set w = (h * (thumbnail.get_width() / thumbnail.get_height()))|round %} {% endif %} @@ -76,7 +75,7 @@