Skip to content

Commit

Permalink
save user filename choice when export (#4577)
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix authored Jan 22, 2025
1 parent 7b32ccd commit b33bcd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/Alchemy/Phrasea/Controller/Prod/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public function checkDownload(Request $request)
$this->app->abort(403);
}

if (!empty($request->request->get('type'))) {
$this->app['session']->set('download_name_type', $request->request->get('type'));
}

$lst = $request->request->get('lst');
$ssttid = $request->request->get('ssttid', '');
$subdefs = $request->request->get('obj', []);
Expand Down
12 changes: 10 additions & 2 deletions templates/web/common/dialog_export.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@
<p>{{ 'Nom des fichiers a l\'export' | trans }}</p>
<div class="well-small">
<label for="type_{{id}}_original" class="radio">
<input type="radio" name="type" id="type_{{id}}_original" {% if default_export_title == "title" %}checked{% endif %} value="title" />
<input type="radio" name="type" id="type_{{id}}_original"
{% if (app['session'].has('download_name_type') and app['session'].get('download_name_type') == "title") or (not app['session'].has('download_name_type') and default_export_title == "title" ) %}
checked
{% endif %}
value="title" />
{{ 'export::titre: titre du documument' | trans }}
</label>
<label for="type_{{id}}_title" class="radio">
<input type="radio" name="type" id="type_{{id}}_title" {% if default_export_title == "original" %}checked{% endif %} value="originalname" />
<input type="radio" name="type" id="type_{{id}}_title"
{% if (app['session'].has('download_name_type') and app['session'].get('download_name_type') == "originalname") or (not app['session'].has('download_name_type') and default_export_title == "original" ) %}
checked
{% endif %}
value="originalname" />
{{ 'export::titre: nom original du document' | trans }}
</label>
</div>
Expand Down

0 comments on commit b33bcd9

Please sign in to comment.