Bugzilla – Attachment 23132 Details for
Bug 11296
Browse selected biblios - bootstrap
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11296: Browse selected biblios - bootstrap
Bug-11296-Browse-selected-biblios---bootstrap.patch (text/plain), 18.91 KB, created by
Jonathan Druart
on 2013-11-25 12:33:51 UTC
(
hide
)
Description:
Bug 11296: Browse selected biblios - bootstrap
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-11-25 12:33:51 UTC
Size:
18.91 KB
patch
obsolete
>From c1796c36f1fb3109257e669e309e1c97004ac3ef Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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 @@ > <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/jquery-ui.js"></script> > <script type="text/javascript" src="[% interface %]/[% theme %]/lib/bootstrap/js/bootstrap.min.js"></script> > <script type="text/javascript" src="[% interface %]/[% theme %]/js/global.js"></script> >+<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/jquery.js"></script> >+<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.json.js"></script> >+<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/commons.js"></script> > <script type="text/javascript"> > Modernizr.load([ > // Test need for polyfill >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >index 1c113d8..6cc5c08 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >@@ -8,11 +8,11 @@ > [% IF ( PAGE_NUMBER.highlight ) %] > <li class="active"><a href="#">[% PAGE_NUMBER.pg %]</a></li> > [% ELSE %] >- <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a></li> >+ <li><a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a></li> > [% END %] > [% END %] > [% IF ( next_page_offset ) %] >- <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% next_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">Next »</a></li> >+ <li><a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% next_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">Next »</a></li> > [% END %] > </ul> > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 8b7cfdd..676fb2d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1027,7 +1027,7 @@ > <span>Previous</span> > [% END %] > </li> >- <li class="back_results"><a href="opac-search.pl?[% busc |url %]" title="Back to the results search list">Back to results</a></li> >+ <li class="back_results"><a href="opac-search.pl?[% busc |url %]" title="Back to the results search list" class="searchwithcontext">Back to results</a></li> > <li class="right_results"> > [% IF ( next ) %]<a href="[% next %]" title="See: [% IF ( nextTitle ) %][% nextTitle |html %][% ELSE %]next biblio[% END %]">Next »</a> > [% ELSE %] >@@ -1049,33 +1049,35 @@ > </div> > [% END # / IF OpacBrowseResults && busc %] > >- [% INCLUDE 'opac-detail-sidebar.inc' %] >- >- [% IF ( NovelistSelectProfile && NovelistSelectView == 'right') %] >- <div id="NovelistSelect"> >- <h4>Novelist Select</h4> >- <div data-novelist-novelistselect=[% normalized_isbn %]></div> >- </div> >- [% END %] >- >- [% IF ( Babeltheque ) %] >- <div class="babeltheque_adds"> >- <div id="BW_critiques_aj"></div> >- <div id="BW_citations_aj"></div> >- </div> >- [% END %] >- >- [% IF ( SocialNetworks ) %] >- <div id="social_networks" class="clearfix"> >- <span>Share</span> >- <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&t=[% title |url %]" title="Share on Facebook">Facebook</a></div> >- <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&url=[% current_url |url %]&title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div> >- <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&title=[% title |url %]" title="Share on Delicious">Delicious</a></div> >- <div><a id="email" href="mailto:?subject=[% title |url %]&body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div> >- <div><div class="g-plusone" data-size="small" data-count="false"></div></div> >- <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-lang="[% lang %]">Tweet</a></div> >- </div> >- [% END %] >+ <div id="sidebar"> >+ [% INCLUDE 'opac-detail-sidebar.inc' %] >+ >+ [% IF ( NovelistSelectProfile && NovelistSelectView == 'right') %] >+ <div id="NovelistSelect"> >+ <h4>Novelist Select</h4> >+ <div data-novelist-novelistselect=[% normalized_isbn %]></div> >+ </div> >+ [% END %] >+ >+ [% IF ( Babeltheque ) %] >+ <div class="babeltheque_adds"> >+ <div id="BW_critiques_aj"></div> >+ <div id="BW_citations_aj"></div> >+ </div> >+ [% END %] >+ >+ [% IF ( SocialNetworks ) %] >+ <div id="social_networks" class="clearfix"> >+ <span>Share</span> >+ <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&t=[% title |url %]" title="Share on Facebook">Facebook</a></div> >+ <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&url=[% current_url |url %]&title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div> >+ <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&title=[% title |url %]" title="Share on Delicious">Delicious</a></div> >+ <div><a id="email" href="mailto:?subject=[% title |url %]&body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div> >+ <div><div class="g-plusone" data-size="small" data-count="false"></div></div> >+ <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-lang="[% lang %]">Tweet</a></div> >+ </div> >+ [% END %] >+ </div> > </div> <!-- / .ulactioncontainer --> > </div> <!-- / .span4 --> > </div> <!-- / .row-fluid --> >@@ -1364,6 +1366,7 @@ > renderPagIndexList(pag_index_ini, $("#listResults")); > } > $("#a_listResults").click(function(e) { >+ $("#sidebar").toggle(); > if (arrPagination.length > 0) { > e.preventDefault(); > var navigation = $(".results-pagination"); >@@ -1383,6 +1386,7 @@ > e.preventDefault(); > var navigation = $(".results-pagination"); > navigation.hide(); >+ $("#sidebar").toggle(); > }); > [% END %] > [% IF ( OPACShelfBrowser ) %] >@@ -1547,8 +1551,9 @@ > var timeoutRFW; > var totalPagItemList = 10; > >- function rewindList() >+ function rewindList(e) > { >+ e.preventDefault(); > var ul = $("#listResults"); > var li_ini = ul.children(':first').next(); > var index_ini = pag_index_ini; >@@ -1566,8 +1571,9 @@ > } > }//rewindList > >- function forwardList() >+ function forwardList(e) > { >+ e.preventDefault(); > var ul = $("#listResults"); > var li_ini = ul.children(':first').next(); > var index_ini = pag_index_ini; >@@ -1598,7 +1604,7 @@ > var ini = index - 1; > var end = ini + totalPagItemList - 1; > li = $("<li />"); >- html = (index > pag_index_ini)?"<a href='#' id='rew_list_index' onclick='rewindList()' title='" + _("Click to rewind the list to") + " " + ini + " - " + end + "'>«</a>":"«"; >+ html = (index > pag_index_ini)?"<a href='#' id='rew_list_index' onclick='rewindList(event)' title='" + _("Click to rewind the list to") + " " + ini + " - " + end + "'>«</a>":"«"; > li.html(html); > ul.append(li); > var title = ""; >@@ -1620,7 +1626,7 @@ > li = $("<li />"); > ini = index + 1; > end = (arrPagination.length > index + totalPagItemList)?index + totalPagItemList:arrPagination.length - 1; >- html = (end <= arrPagination.length - 1 && (end - index) >= totalPagItemList)?"<a href='#' id='fw_list_index' onclick='forwardList()' title='" + _("Click to forward the list to") + " " + ini + " - " + end + "'>»</a>":"»"; >+ html = (end <= arrPagination.length - 1 && (end - index) >= totalPagItemList)?"<a href='#' id='fw_list_index' onclick='forwardList(event)' title='" + _("Click to forward the list to") + " " + ini + " - " + end + "'>»</a>":"»"; > li.html(html); > ul.append(li); > }//renderPagIndexList >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 2ad3029..7e8af9f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -162,6 +162,7 @@ > Tag status here. > </div> > [% END %] >+ <span class="details_link"><a href="#">Browse selected records</a></span> > </span> <!-- / .links --> > </div> <!-- / #selections-toolbar --> > >@@ -626,11 +627,14 @@ function tagAdded() { > > function enableCheckboxActions(){ > // Enable/disable controls if checkboxes are checked >- var checkedBoxes = $(".checkboxed input:checkbox:checked"); >+ var bibnums = getContextBiblioNumbers(); > var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, , #selections-toolbar .links label") >- if ($(checkedBoxes).size()) { >+ if ( bibnums.length > 0 ) { > $("#selections").html(_("With selected titles: ")); > $(controls).removeClass("disabled"); >+ // Hide or show details link >+ // Update with first biblionumber in queue >+ $(".details_link a").attr("href", "/cgi-bin/koha/opac-detail.pl?biblionumber=" + bibnums[0]); > } else { > $("#selections").html(_("Select titles to: ")); > $(controls).addClass("disabled"); >@@ -657,6 +661,7 @@ function highlightOn() { > $(".highlight_toggle").toggle(); > } > [% END %] >+ > $(document).ready(function(){ > [% IF ( OpacHighlightedWords ) %] > $('a.title').each(function() { >@@ -665,9 +670,27 @@ $(document).ready(function(){ > [% END %] > > $(".cb").click(function(){ >+ if ( $(this).is(':checked') == true ) { >+ addBibToContext( $(this).val() ); >+ } else { >+ delBibToContext( $(this).val() ); >+ } > enableCheckboxActions(); > }); >- enableCheckboxActions(); >+ >+ >+ $("#bookbag_form").ready(function(){ >+ $("#bookbag_form").unCheckCheckboxes(); >+ var bibnums = getContextBiblioNumbers(); >+ if (bibnums) { >+ for (var i=0; i < bibnums.length; i++) { >+ var id = ('#bib' + bibnums[i]); >+ if ($(id)) { >+ $(id).attr('checked', true); >+ } >+ } >+ } >+ }); > > [% IF ( IDreamBooksResults ) %] > $('.idbresult').each(function() { >@@ -806,11 +829,17 @@ $(document).ready(function(){ > $("#CheckAll").click(function(){ > $("#bookbag_form").checkCheckboxes(); > enableCheckboxActions(); >+ $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){ >+ $(this).change(); >+ } ); > return false; > }); > $("#CheckNone").click(function(){ > $("#bookbag_form").unCheckCheckboxes(); > enableCheckboxActions(); >+ $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){ >+ $(this).change(); >+ } ); > return false; > }); > >@@ -912,7 +941,6 @@ $(document).ready(function(){ > }); > }); > [% END %] >- > }); > //]]> > </script> >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11296
:
23132
|
23184