From 04c2acffa3bccd2f2ac573dc86e1359a840c8ccb Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Wed, 3 Oct 2012 12:26:39 +0200 Subject: [PATCH] Fix #915 Strip html tags from caption values when caption is printed out update #922 escape js value fix alignment --- lib/Alchemy/Phrasea/Out/Module/PDF.php | 2 +- templates/web/common/dialog_export.twig | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/Alchemy/Phrasea/Out/Module/PDF.php b/lib/Alchemy/Phrasea/Out/Module/PDF.php index 0588718620..4ec1b368b3 100644 --- a/lib/Alchemy/Phrasea/Out/Module/PDF.php +++ b/lib/Alchemy/Phrasea/Out/Module/PDF.php @@ -469,7 +469,7 @@ class PDF $t = str_replace( array("<", ">", "&") , array("<", ">", "&") - , $field->get_serialized_values() + , strip_tags($field->get_serialized_values()) ); $this->pdf->Write(5, $t); diff --git a/templates/web/common/dialog_export.twig b/templates/web/common/dialog_export.twig index 4d3780324d..4fc7309291 100644 --- a/templates/web/common/dialog_export.twig +++ b/templates/web/common/dialog_export.twig @@ -516,18 +516,20 @@ } }); - {% spaceless %} - {% set max_download = registry.get('GV_download_max', 120) %} - {% set alert_too_big%} - "{% trans %} You can not directly download more than {{max_download}} Mo ; time to package all documents is too long{% endtrans %}"+ - "{% trans 'You can alternatively receive an email when the download is ready.' %}"+ - "{% trans 'Would you like to receive an e-mail when your download is ready ?' %}" - {% endset %} - {% endspaceless %} - + {% set max_download = registry.get('GV_download_max', 120) %} + {% set alert_too_big_one %} + {% trans %} You can not directly download more than {{max_download}} Mo ; time to package all documents is too long{% endtrans %} + {% endset %} + {% set alert_too_big_two %} + {% trans 'You can alternatively receive an email when the download is ready.' %} + {% endset %} + {% set alert_too_big_three %} + {% trans 'Would you like to receive an e-mail when your download is ready ?' %} + {% endset %} + if(count>1 && total/1024/1024 > {{max_download}}) { - if(confirm("{{alert_too_big|escape("js")}}")) + if(confirm("{{alert_too_big_one|e('js') ~ "\\n" ~ alert_too_big_two ~ "\\n" ~ alert_too_big_three}}")) { $('input[name="obj[]"]:checked', $('#download')).each(function(i,n){ $('input[name="obj[]"][value="'+$(n).val()+'"]', $('#sendmail')).attr('checked', true);