From 09f2ca6d44b4c49e48935b48528f1bba19f7d236 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 17 Nov 2014 16:32:20 +0100 Subject: [PATCH] Bug 13268 - biblioitems.size value not correctly displayed (more) Bug partially corrected by Bug 11357. The size column in biblioitems is a bit problematic when used in TT, because instead of the size value from the biblio column it will give you the size of the variable or current loop. It's currently used in the templates like opac-topissues.tt : [% IF results_loo.size %][% results_loo.size %][% END %] This patch corrects by using item() TT method. See http://stackoverflow.com/questions/2311303/how-can-i-handle-hash-keys-containing-illegal-identifier-characters-in-template. Test plan : - Be sure there is a mapping between a MARC field and biblioitems.size - Create a record A with biblioitems.size defined : like "10x12" - Create a record B with no value in biblioitems.size - Check each modified page : => Without this patch : you see a number (loop size) for both records => With this patch : you only see the correct value for A and nothing for B Signed-off-by: Jonathan Druart Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt index 4134cd36fe..4a4125b623 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -117,7 +117,7 @@ [% IF ( resultsloo.edition ) %]Edition: [% resultsloo.edition %][% END %] [% IF ( resultsloo.place ) %] ; [% resultsloo.place %][% END %] [% IF ( resultsloo.pages ) %] - [% resultsloo.pages %][% END %] - [% IF ( resultsloo.size ) %] ; [% resultsloo.size %][% END %] + [% IF ( resultsloo.item('size') ) %] ; [% resultsloo.item('size') %][% END %] [% IF ( resultsloo.timestamp ) %] (modified on [% resultsloo.timestamp %])[% END %]

[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt index e9f94be47c..6d234d7b46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -72,7 +72,7 @@ $(document).ready(function() { [% IF ( itemsloo.publicationyear ) %], [% itemsloo.publicationyear %] [% ELSIF ( itemsloo.copyrightdate ) %], [% itemsloo.copyrightdate %][% END %] [% IF ( itemsloo.pages ) %]: [% itemsloo.pages %] [% END %] - [% IF ( itemsloo.size ) %][% itemsloo.size %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]

+ [% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]

[% AuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index d5ee6dce08..b671860cf2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -381,7 +381,7 @@ [% END %] [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %] [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %] - [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %] + [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') %][% END %] Holdings: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt index 950a4d9c73..d7823c8ae1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt @@ -72,7 +72,7 @@ [% results_loo.copyrightdate %] [% END %] [% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %] - [% IF ( results_loo.size ) %][% results_loo.size %][% END %]

+ [% IF ( results_loo.item('size') ) %][% results_loo.item('size') %][% END %]

[% IF ( results_loo.description ) %] -- 2.39.5