From c1796c36f1fb3109257e669e309e1c97004ac3ef Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 25 Nov 2013 12:47:14 +0100 Subject: [PATCH] Bug 11296: Browse selected biblios - bootstrap Add the changes from bug 10858 to the bootstrap theme. Test plan: - Launch a search at the OPAC - Check some biblios - Go on another page - Check some biblios - Come back to the first page and check that already checked biblio is automatically checked. - Click on the "Browse selected biblios >>" link - Check that you are able to browse results you had checked. In addition to prog and ccsr templates, this patch allows to add selected biblios (from multiple pages) to the cart or a list. To test: - check some biblios from several pages - add them to the cart - add them to a list --- .../bootstrap/en/includes/opac-bottom.inc | 4 ++ .../bootstrap/en/includes/page-numbers.inc | 4 +- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 70 +++++++++++--------- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 36 ++++++++-- koha-tmpl/opac-tmpl/bootstrap/js/basket.js | 42 ++++++++---- .../opac-tmpl/{prog/en => bootstrap}/js/commons.js | 0 .../lib/jquery/plugins/jquery.cookie.min.js | 0 .../lib/jquery/plugins/jquery.json.js | 0 8 files changed, 105 insertions(+), 51 deletions(-) rename koha-tmpl/opac-tmpl/{prog/en => bootstrap}/js/commons.js (100%) rename koha-tmpl/opac-tmpl/{prog/en => bootstrap}/lib/jquery/plugins/jquery.cookie.min.js (100%) rename koha-tmpl/opac-tmpl/{prog/en => bootstrap}/lib/jquery/plugins/jquery.json.js (100%) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index c3ce588..9ec8e83 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -79,6 +79,10 @@ + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js index 675dc0a..d3a1c9b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js @@ -157,17 +157,25 @@ function SelectAll(){ } function addMultiple(){ + var bibnums = getContextBiblioNumbers(); var c_value = ""; - if(document.bookbag_form.biblionumber.length > 0) { - for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { - if (document.bookbag_form.biblionumber[i].checked) { - c_value = c_value + document.bookbag_form.biblionumber[i].value + "/"; - } + if ( bibnums.length > 0 ) { + for ( var i = 0 ; i < bibnums.length ; i++ ) { + c_value = c_value + bibnums[i] + "/"; } addSelRecords(c_value); } else { - c_value = c_value + document.bookbag_form.biblionumber.value + "/"; - addSelRecords(c_value); + if(document.bookbag_form.biblionumber.length > 0) { + for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { + if (document.bookbag_form.biblionumber[i].checked) { + c_value = c_value + document.bookbag_form.biblionumber[i].value + "/"; + } + } + addSelRecords(c_value); + } else { + c_value = c_value + document.bookbag_form.biblionumber.value + "/"; + addSelRecords(c_value); + } } } @@ -433,20 +441,28 @@ function addSelToShelf() { /// vShelfAdd() builds url string for multiple-biblio adds. function vShelfAdd() { - bibs= new Array; + var bibnums = getContextBiblioNumbers(); + bibs = new Array; + if ( bibnums.length > 0 ) { + for ( var i = 0 ; i < bibnums.length ; i++ ) { + bibs.push("biblionumber=" + bibnums[i]); + } + return bibs.join("&"); + } else { if(document.bookbag_form.biblionumber.length > 0) { - for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { - if (document.bookbag_form.biblionumber[i].checked) { - bibs.push("biblionumber=" + document.bookbag_form.biblionumber[i].value); - } + for (var i=0; i < document.bookbag_form.biblionumber.length; i++) { + if (document.bookbag_form.biblionumber[i].checked) { + bibs.push("biblionumber=" + document.bookbag_form.biblionumber[i].value); } - if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); } + } + if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); } return bibs.join("&"); } else { if (document.bookbag_form.biblionumber.checked) { return "biblionumber=" + document.bookbag_form.biblionumber.value; } } + } } function showCart(){ diff --git a/koha-tmpl/opac-tmpl/prog/en/js/commons.js b/koha-tmpl/opac-tmpl/bootstrap/js/commons.js similarity index 100% rename from koha-tmpl/opac-tmpl/prog/en/js/commons.js rename to koha-tmpl/opac-tmpl/bootstrap/js/commons.js diff --git a/koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.cookie.min.js similarity index 100% rename from koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js rename to koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.cookie.min.js diff --git a/koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.json.js b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.json.js similarity index 100% rename from koha-tmpl/opac-tmpl/prog/en/lib/jquery/plugins/jquery.json.js rename to koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.json.js -- 1.7.10.4