Bug 11663: fix display of holding tab in Bootstap OPAC when opacbookbag syspref is...
authorFrédéric Demians <f.demians@tamil.fr>
Sat, 1 Feb 2014 08:49:38 +0000 (09:49 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 4 Feb 2014 18:02:25 +0000 (18:02 +0000)
Bootstap theme opac holding tab is improperly displayed when opacbookbag
syspref is disabled, and virtualshelf is enabled. This is due to the
fact that in this situation basket.js is loaded (for virtual shelves),
but some JS variables are not defined in template since opacbookbag is
disabled.

To reproduce this bug:

- Choose bootstrap OPAC theme
- Enable virtualsheves syspref
- Disable opacbookbag syspref
- Open a biblio record in OPAC detail page
- You will observe that items holding tabs are not displayed as tabs but
  as a bulleted list

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script and all tests.
Confirmed display problem exists without the patch and is solved by it.
Ideally we would avoid having the cart messages in the template when
the feature is deactivated, but this is ok for now.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc

index c3ce588..8bb4ccd 100644 (file)
     //<![CDATA[
     var MSG_CONFIRM_AGAIN = _("Warning: Cannot be undone. Please confirm once again")
     var MSG_DELETE_SEARCH_HISTORY = _("Are you sure you want to delete your search history?");
-    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
+    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
         var MSG_BASKET_EMPTY = _("Your cart is currently empty");
         var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
         var MSG_RECORD_ADDED = _("The item has been added to your cart");
         var MSG_ITEM_IN_CART = _("In your cart");
         var MSG_IN_YOUR_CART = _("Items in your cart: ");
         var MSG_ITEM_NOT_IN_CART = _("Add to your cart");
-    [% ELSE %]
-        [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
-            var MSG_NO_RECORD_SELECTED = _("No item was selected");
-        [% END %]
+        var MSG_NO_RECORD_SELECTED = _("No item was selected");
     [% END %]
     [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
         var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");