From 75c70d42a5df526c8bed8633d65721696a0fa176 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. Signed-off-by: Chris Cormack Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../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 01ceb8aaf9..646b3b4685 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.39.5