From 857bc3e1794a1453bf917cd1685050a9d2f0e153 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 19 Jun 2014 14:47:15 +0200 Subject: [PATCH] [SIGNED-OFF] Bug 11357 - biblioitems.size value not correctly displayed in list emails sent from OPAC and intranet 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. It's currently used in the templates for sending shelves from OPAC and intranet and maybe also in other places: [% END %] [% IF BIBLIO_RESULT.size %] , [% BIBLIO_RESULT.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 : In each display : => Without this patch you see biblioitems.pages and then a number => With this patch you only see biblioitems.pages - Create a record with biblioitems.pages defined (like "12p") but without biblioitems.size defined Same for OPAC and intranet : - Add it to the cart - Open the cart - Check the "Title" column - Click on "More Details" - Check the "Details" row - Send the basket via email and check the result - Add to a list - Send the list via email and check the result Signed-off-by: Bernardo Gonzalez Kriegel Works well!! Tested on staff & opac, cart & list. No koha-qa errors --- .../intranet-tmpl/prog/en/modules/basket/basket.tt | 8 ++++---- .../prog/en/modules/basket/sendbasket.tt | 4 ++-- .../prog/en/modules/virtualshelves/sendshelf.tt | 6 +++--- .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 6 +++--- .../bootstrap/en/modules/opac-sendbasket.tt | 4 ++-- .../bootstrap/en/modules/opac-sendshelf.tt | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 897a9d2..5a3d22e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -136,7 +136,7 @@ function placeHold () { [% END %] - + [% IF ( BIBLIO_RESULT.isbn ) %] @@ -175,7 +175,7 @@ function placeHold () { [% IF ( BIBLIO_RESULT.pages ) %] - + [% END %] [% IF ( BIBLIO_RESULT.seriestitle ) %] @@ -311,14 +311,14 @@ function placeHold () { [% BIBLIO_RESULT.author %]

[% IF ( BIBLIO_RESULT.publishercode ) %]- [% BIBLIO_RESULT.publishercode %] [% IF ( BIBLIO_RESULT.place ) %] [% BIBLIO_RESULT.place %][% END %][% END %] - [% IF ( BIBLIO_RESULT.pages ) %] - [% BIBLIO_RESULT.pages %][% IF ( BIBLIO_RESULT.size ) %] [% BIBLIO_RESULT.size %] + [% IF ( BIBLIO_RESULT.pages ) %] - [% BIBLIO_RESULT.pages %][% IF ( BIBLIO_RESULT.item('size') ) %] [% BIBLIO_RESULT.item('size') %] [% END %] [% END %]

[% IF ( BIBLIO_RESULT.notes ) %]

[% BIBLIO_RESULT.notes %]

[% END %] - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt index 09ce7dd..0514bc1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt @@ -66,8 +66,8 @@ Your cart [% IF ( BIBLIO_RESULT.pages ) %] , [% BIBLIO_RESULT.pages %] [% END %] - [% IF BIBLIO_RESULT.size %] - , [% BIBLIO_RESULT.size %] + [% IF BIBLIO_RESULT.item('size') %] + , [% BIBLIO_RESULT.item('size') %] [% END %]
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt index 062b5da..f3738f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt @@ -55,7 +55,7 @@ Your list: [% shelfname %]
[% END %] - [% IF ( BIBLIO_RESULT.ISBN && BIBLIO_RESULT.size > 0 ) %] + [% IF ( BIBLIO_RESULT.ISBN ) %] ISBN: [% FOREACH isbn IN BIBLIO_RESULT.ISBN %] [% isbn.marcisbn %] @@ -73,8 +73,8 @@ Your list: [% shelfname %] [% IF ( BIBLIO_RESULT.pages ) %] , [% BIBLIO_RESULT.pages %] [% END %] - [% IF BIBLIO_RESULT.size %] - , [% BIBLIO_RESULT.size %] + [% IF BIBLIO_RESULT.item('size') %] + , [% BIBLIO_RESULT.item('size') %] [% END %]
[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index 1a21dbd..29b2279 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -76,7 +76,7 @@ [% END # / IF print_basket %] - +
Details[% BIBLIO_RESULT.pages %] [% BIBLIO_RESULT.illus %] [% BIBLIO_RESULT.size %][% BIBLIO_RESULT.pages %] [% BIBLIO_RESULT.illus %] [% BIBLIO_RESULT.item('size') %]
[% BIBLIO_RESULT.description %]
[% IF ( BIBLIO_RESULT.isbn ) %] @@ -117,7 +117,7 @@ [% IF ( BIBLIO_RESULT.pages ) %] - + [% END %] @@ -256,7 +256,7 @@
Details[% BIBLIO_RESULT.pages %] [% BIBLIO_RESULT.illus %] [% BIBLIO_RESULT.size %][% BIBLIO_RESULT.pages %] [% BIBLIO_RESULT.illus %] [% BIBLIO_RESULT.item('size') %]
[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %] - + [% IF ( TagsInputEnabled && loggedinusername ) %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt index dc6929d..29c4cbb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt @@ -66,8 +66,8 @@ Your cart [% IF ( BIBLIO_RESULT.pages ) %] , [% BIBLIO_RESULT.pages %] [% END %] - [% IF BIBLIO_RESULT.size %] - , [% BIBLIO_RESULT.size %] + [% IF BIBLIO_RESULT.item('size') %] + , [% BIBLIO_RESULT.item('size') %] [% END %]
[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt index f3c7ed7..91041bb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt @@ -56,7 +56,7 @@ Your list : [% shelfname %]
[% END %] - [% IF ( BIBLIO_RESULT.ISBN && BIBLIO_RESULT.size > 0 ) %] + [% IF ( BIBLIO_RESULT.ISBN ) %] ISBN: [% FOREACH isbn IN BIBLIO_RESULT.ISBN %] [% isbn %] @@ -74,8 +74,8 @@ Your list : [% shelfname %] [% IF ( BIBLIO_RESULT.pages ) %] , [% BIBLIO_RESULT.pages %] [% END %] - [% IF BIBLIO_RESULT.size %] - , [% BIBLIO_RESULT.size %] + [% IF BIBLIO_RESULT.item('size') %] + , [% BIBLIO_RESULT.item('size') %] [% END %]
[% END %] -- 1.7.9.5