Bug 13268 - biblioitems.size value not correctly displayed (more)
authorFridolin Somers <fridolin.somers@biblibre.com>
Mon, 17 Nov 2014 15:32:20 +0000 (16:32 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 5 Feb 2015 17:46:35 +0000 (14:46 -0300)
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 <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-topissues.tt

index 39d9937..5619816 100644 (file)
                         [% 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 ) %] <i>(modified on [% resultsloo.timestamp %])</i>[% END %]
                     </p>
                 [% END %]
index b247706..6dced76 100644 (file)
@@ -73,7 +73,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 %]</p>
+                                         [% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]</p>
                        </div>
                        </td>
             <td class="hq-collection">[% AuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) %]</td>
index 4b929d2..a7f982b 100644 (file)
                                                             [% 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 %]
                                                         </span>
                                                         <span class="results_summary">
                                                             <span class="label">Holdings:</span>
index 72f8abd..d705054 100644 (file)
@@ -72,7 +72,7 @@
                                                 [% results_loo.copyrightdate %]
                                             [% END %]
                                             [% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %]
-                                            [% IF ( results_loo.size ) %][% results_loo.size %][% END %]</p>
+                                            [% IF ( results_loo.item('size') ) %][% results_loo.item('size') %][% END %]</p>
                                             </td>
                                             <td>
                                                 [% IF ( results_loo.description ) %]