From 78fe26ae38de60ce17ecff1be3c1d1c723df7d9b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Jul 2015 16:26:36 +0100 Subject: [PATCH] Bug 14517: List shelves list is broken for translated interfaces The translation script adds quotes ("") around translated string (Edit for instance). Which breaks the json structure. Example: "dt_action": "
" Test plan: 1/ On the staff interface create a private list 2/ Go to More > Lists ('Your lists' tab) 3/ Translate the templates to any language like: $ cd misc/translator/ $ perl translate install es-ES 4/ Enable the translated templates on the sysprefs 5/ Switch to the translated language 6/ Go to the lists page (Mas > Listas in es-ES) The list should be displayed correctly. Note: There is a limitation. If a translated string contains a simple quote ('), it will also break the json. --- .../virtualshelves/tables/shelves_results.tt | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt index 01ceb8a..646b3b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt @@ -1,4 +1,5 @@ [% USE KohaDates %] +[% USE To %] { "sEcho": [% sEcho %], "iTotalRecords": [% iTotalRecords %], @@ -28,9 +29,31 @@ } [% BLOCK action_form -%] - [%- IF can_manage_shelf OR can_delete_shelf-%] -[% IF can_manage_shelf %]
[% END %][% IF can_manage_shelf OR can_delete_shelf %]
[% IF type == 1 %][% ELSE %][% END %]
[% END %] - [%- ELSE -%] - None - [%- END -%] -[%- END %] +[%~ SET action_block = '' ~%] +[%~ IF can_manage_shelf OR can_delete_shelf ~%] + [%~ IF can_manage_shelf ~%] + [%~ action_block = '
' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '
' ~%] + [%~ END ~%] + [%~ IF can_manage_shelf OR can_delete_shelf ~%] + [%~ action_block = action_block _ '
' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '' ~%] + [%~ IF type == 1 ~%] + [%~ action_block = action_block _ '' ~%] + [%~ ELSE ~%] + [%~ action_block = action_block _ '' ~%] + [%~ END ~%] + [%~ action_block = action_block _ '' ~%] + [%~ action_block = action_block _ '
' ~%] + [%~ END ~%] +[%~ ELSE ~%] + [%~ SET action_block = 'None' ~%] +[%~ END ~%] +[%~ To.json(action_block) ~%] +[%~ END ~%] -- 2.1.0