View | Details | Raw Unified | Return to bug 10858
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (+3 lines)
Lines 90-95 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
90
[% Asset.js("lib/bootstrap/js/bootstrap.min.js") | $raw %]
90
[% Asset.js("lib/bootstrap/js/bootstrap.min.js") | $raw %]
91
[% Asset.js("lib/fontfaceobserver.min.js") | $raw %]
91
[% Asset.js("lib/fontfaceobserver.min.js") | $raw %]
92
[% Asset.js("js/global.js") | $raw %]
92
[% Asset.js("js/global.js") | $raw %]
93
[% Asset.js('lib/jquery/plugins/jquery.cookie.min.js') | $raw %]
94
[% Asset.js('js/commons.js') | $raw %]
93
<script>
95
<script>
94
    Modernizr.load([
96
    Modernizr.load([
95
        // Test need for polyfill
97
        // Test need for polyfill
Lines 159-164 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
159
        var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
161
        var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
160
        var MSG_ITEM_IN_CART = _("In your cart");
162
        var MSG_ITEM_IN_CART = _("In your cart");
161
        var MSG_ITEM_NOT_IN_CART = _("Add to your cart");
163
        var MSG_ITEM_NOT_IN_CART = _("Add to your cart");
164
        var MSG_NEED_COOKIE_ENABLED = _("Your browser does not accept cookies, you must accept them to browse selected results.");
162
    [% END %]
165
    [% END %]
163
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
166
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
164
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
167
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc (-3 / +3 lines)
Lines 10-21 Link Here
10
                [% IF ( PAGE_NUMBER.highlight ) %]
10
                [% IF ( PAGE_NUMBER.highlight ) %]
11
                    <li class="active"><a clas="page-num current" href="#">[% PAGE_NUMBER.pg | html %]</a></li>
11
                    <li class="active"><a clas="page-num current" href="#">[% PAGE_NUMBER.pg | html %]</a></li>
12
                [% ELSE %]
12
                [% ELSE %]
13
                    <li class="page-num"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% PAGE_NUMBER.offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">[% PAGE_NUMBER.pg | html %]</a></li>
13
                    <li class="page-num"><a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% PAGE_NUMBER.offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">[% PAGE_NUMBER.pg | html %]</a></li>
14
                [% END %]
14
                [% END %]
15
            [% END %]
15
            [% END %]
16
            [% IF ( next_page_offset ) %]
16
            [% IF ( next_page_offset ) %]
17
                <li class="page-next"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% next_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Next <i class="fa fa-fw fa-angle-double-right"></i></a></li>
17
                <li class="page-next"><a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% next_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Next <i class="fa fa-fw fa-angle-double-right"></i></a></li>
18
                <li class="page-last"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% last_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Last <i class="fa fa-fw fa-angle-double-right"></i></a></li>
18
                <li class="page-last"><a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;offset=[% last_page_offset | uri %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Last <i class="fa fa-fw fa-angle-double-right"></i></a></li>
19
            [% END %]
19
            [% END %]
20
        </ul>
20
        </ul>
21
    </div>
21
    </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-23 / +27 lines)
Lines 1094-1100 Link Here
1094
                                [% END %]
1094
                                [% END %]
1095
                            </li>
1095
                            </li>
1096
                            [%# busc is already URI encoded %]
1096
                            [%# busc is already URI encoded %]
1097
                            <li class="back_results"><a href="opac-search.pl?[% busc | $raw %]" title="Back to the results search list">Back to results</a></li>
1097
                            <li class="back_results"><a href="opac-search.pl?[% busc | $raw %]" title="Back to the results search list" class="searchwithcontext">Back to results</a></li>
1098
                            <li class="right_results">
1098
                            <li class="right_results">
1099
                                [% IF ( nextBiblionumber ) %]
1099
                                [% IF ( nextBiblionumber ) %]
1100
                                    <a href="opac-detail.pl?biblionumber=[% nextBiblionumber | uri %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( nextTitle ) %][% nextTitle | html %][% ELSE %]next biblio[% END %]">Next <i class="fa fa-angle-double-right"></i></a>
1100
                                    <a href="opac-detail.pl?biblionumber=[% nextBiblionumber | uri %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( nextTitle ) %][% nextTitle | html %][% ELSE %]next biblio[% END %]">Next <i class="fa fa-angle-double-right"></i></a>
Lines 1136-1166 Link Here
1136
                    </div>
1136
                    </div>
1137
                [% END # / IF OpacBrowseResults && busc %]
1137
                [% END # / IF OpacBrowseResults && busc %]
1138
1138
1139
                [% INCLUDE 'opac-detail-sidebar.inc' %]
1139
                <div id="sidebar">
1140
                    [% INCLUDE 'opac-detail-sidebar.inc' %]
1140
1141
1141
                [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && ( normalized_isbn || normalized_upc ) ) %]
1142
                    [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && ( normalized_isbn || normalized_upc ) ) %]
1142
                    <div id="NovelistSelect">
1143
                        <div id="NovelistSelect">
1143
                        <h4>Novelist Select</h4>
1144
                            <h4>Novelist Select</h4>
1144
                        <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]></div>
1145
                            <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]></div>
1145
                    </div>
1146
                        </div>
1146
                [% END %]
1147
                    [% END %]
1147
1148
1148
                [% IF ( Babeltheque ) %]
1149
                    [% IF ( Babeltheque ) %]
1149
                    <div class="babeltheque_adds">
1150
                        <div class="babeltheque_adds">
1150
                        <div id="BW_critiques_aj"></div>
1151
                            <div id="BW_critiques_aj"></div>
1151
                        <div id="BW_citations_aj"></div>
1152
                            <div id="BW_citations_aj"></div>
1152
                    </div>
1153
                        </div>
1153
                [% END %]
1154
                    [% END %]
1154
1155
1155
                [% IF ( SocialNetworks ) %]
1156
                    [% IF ( SocialNetworks ) %]
1156
                    <div id="social_networks" class="clearfix">
1157
                        <div id="social_networks" class="clearfix">
1157
                        <span>Share</span>
1158
                            <span>Share</span>
1158
                        <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1159
                            <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1159
                        <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1160
                            <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1160
                        <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div>
1161
                            <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div>
1161
                        <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title |url %]" data-lang="[% lang | html %]">Tweet</a></div>
1162
                            <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title |url %]" data-lang="[% lang | html %]">Tweet</a></div>
1162
                    </div>
1163
                        </div>
1163
                [% END %]
1164
                    [% END %]
1165
                </div>
1164
            </div> <!-- / .ulactioncontainer -->
1166
            </div> <!-- / .ulactioncontainer -->
1165
        </div> <!-- / .span4 -->
1167
        </div> <!-- / .span4 -->
1166
    </div> <!-- / .row-fluid -->
1168
    </div> <!-- / .row-fluid -->
Lines 1435-1445 Link Here
1435
            $(".l_Results").show();
1437
            $(".l_Results").show();
1436
            $("#a_listResults").on("click", function(e){
1438
            $("#a_listResults").on("click", function(e){
1437
                e.preventDefault();
1439
                e.preventDefault();
1440
                $("#sidebar").toggle();
1438
                $(".results-pagination, .close_pagination, .pg_menu").toggle();
1441
                $(".results-pagination, .close_pagination, .pg_menu").toggle();
1439
            });
1442
            });
1440
1443
1441
            $(".close_pagination").on("click", function(e){
1444
            $(".close_pagination").on("click", function(e){
1442
                e.preventDefault();
1445
                e.preventDefault();
1446
                $("#sidebar").toggle();
1443
                $(".results-pagination, .close_pagination, .pg_menu").toggle();
1447
                $(".results-pagination, .close_pagination, .pg_menu").toggle();
1444
            });
1448
            });
1445
        [% END %]
1449
        [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-3 / +50 lines)
Lines 200-205 Link Here
200
                                                        Tag status here.
200
                                                        Tag status here.
201
                                                    </div>
201
                                                    </div>
202
                                                [% END %]
202
                                                [% END %]
203
                                                [% IF Koha.Preference('OpacBrowseResults') %]
204
                                                  <span class="details_link"></span>
205
                                                [% END %]
203
                                            </span> <!-- / .links -->
206
                                            </span> <!-- / .links -->
204
                                    </div> <!-- / #selections-toolbar -->
207
                                    </div> <!-- / #selections-toolbar -->
205
                                </div> <!-- /#floating -->
208
                                </div> <!-- /#floating -->
Lines 706-716 function tagAdded() { Link Here
706
709
707
function enableCheckboxActions(){
710
function enableCheckboxActions(){
708
    // Enable/disable controls if checkboxes are checked
711
    // Enable/disable controls if checkboxes are checked
709
    var checkedBoxes = $(".checkboxed input:checkbox:checked");
712
    var bibnums = getContextBiblioNumbers();
710
    var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, , #selections-toolbar .links label")
713
    var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, , #selections-toolbar .links label")
711
    if ($(checkedBoxes).size()) {
714
    if ( bibnums.length > 0 ) {
712
      $("#selections").html(_("With selected titles: "));
715
      $("#selections").html(_("With selected titles: "));
713
      $(controls).removeClass("disabled");
716
      $(controls).removeClass("disabled");
717
      // Hide or show details link
718
      // Update with first biblionumber in queue
719
      $(".details_link a").attr("href", "/cgi-bin/koha/opac-detail.pl?biblionumber=" + bibnums[0]);
714
    } else {
720
    } else {
715
      $("#selections").html(_("Select titles to: "));
721
      $("#selections").html(_("Select titles to: "));
716
      $(controls).addClass("disabled");
722
      $(controls).addClass("disabled");
Lines 739-744 function highlightOn() { Link Here
739
    $(".highlight_toggle").toggle();
745
    $(".highlight_toggle").toggle();
740
}
746
}
741
[% END %]
747
[% END %]
748
742
$(document).ready(function(){
749
$(document).ready(function(){
743
750
744
    $(".moretoggle").click(function(e){
751
    $(".moretoggle").click(function(e){
Lines 754-768 $(document).ready(function(){ Link Here
754
        });
761
        });
755
    [% END %]
762
    [% END %]
756
763
757
    $(".cb").click(function(){
764
    $(".cb").change(function(){
765
      [% IF Koha.Preference('OpacBrowseResults') %]
766
        if ( $(this).is(':checked') == true ) {
767
          addBibToContext( $(this).val() );
768
        } else {
769
          delBibToContext( $(this).val() );
770
        }
771
      [% END %]
758
      enableCheckboxActions();
772
      enableCheckboxActions();
759
    });
773
    });
774
775
    $("span.details_link").html("<a href=\"#\" class=\"disabled\">"+_("Browse selected records")+"<\/a>");
776
    $(".details_link a").click(function(e) {
777
      if ( $(this).hasClass("disabled") == true ) {
778
        e.preventDefault();
779
        var checkedBoxes = $(".searchresults :checkbox:checked");
780
        if ($(checkedBoxes).size() == 0) {
781
            alert(MSG_NO_RECORD_SELECTED);
782
        } else {
783
            alert(MSG_NEED_COOKIE_ENABLED);
784
        }
785
        return false;
786
      }
787
    });
760
    enableCheckboxActions();
788
    enableCheckboxActions();
761
789
762
    $(".br-readonly a").on("click", function(e){
790
    $(".br-readonly a").on("click", function(e){
763
        e.preventDefault();
791
        e.preventDefault();
764
    });
792
    });
765
793
794
    $("#bookbag_form").ready(function(){
795
      $("#bookbag_form").unCheckCheckboxes();
796
      var bibnums = getContextBiblioNumbers();
797
      if (bibnums) {
798
        for (var i=0; i < bibnums.length; i++) {
799
          var id = ('#bib' + bibnums[i]);
800
          if ($(id)) {
801
            $(id).attr('checked', true);
802
          }
803
        }
804
      }
805
    });
806
766
    [% IF ( IDreamBooksResults ) %]
807
    [% IF ( IDreamBooksResults ) %]
767
        $('.idbresult').each(function() {
808
        $('.idbresult').each(function() {
768
            var isbn = $(this).children('a').text().replace(/\s*/,'');
809
            var isbn = $(this).children('a').text().replace(/\s*/,'');
Lines 906-916 $(document).ready(function(){ Link Here
906
    $("#CheckAll").click(function(){
947
    $("#CheckAll").click(function(){
907
        $("#bookbag_form").checkCheckboxes();
948
        $("#bookbag_form").checkCheckboxes();
908
        enableCheckboxActions();
949
        enableCheckboxActions();
950
        $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){
951
            $(this).change();
952
        } );
909
        return false;
953
        return false;
910
    });
954
    });
911
    $("#CheckNone").click(function(){
955
    $("#CheckNone").click(function(){
912
        $("#bookbag_form").unCheckCheckboxes();
956
        $("#bookbag_form").unCheckCheckboxes();
913
        enableCheckboxActions();
957
        enableCheckboxActions();
958
        $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){
959
            $(this).change();
960
        } );
914
        return false;
961
        return false;
915
    });
962
    });
916
963
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js (-13 / +29 lines)
Lines 159-175 function SelectAll(){ Link Here
159
}
159
}
160
160
161
function addMultiple(){
161
function addMultiple(){
162
    var bibnums = getContextBiblioNumbers();
162
    var c_value = "";
163
    var c_value = "";
163
    if(document.bookbag_form.biblionumber.length > 0) {
164
    if ( bibnums.length > 0 ) {
164
        for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
165
        for ( var i = 0 ; i < bibnums.length ; i++ ) {
165
            if (document.bookbag_form.biblionumber[i].checked) {
166
            c_value = c_value + bibnums[i] + "/";
166
                c_value = c_value + document.bookbag_form.biblionumber[i].value + "/";
167
            }
168
        }
167
        }
169
        addSelRecords(c_value);
168
        addSelRecords(c_value);
170
    } else {
169
    } else {
171
        c_value = c_value + document.bookbag_form.biblionumber.value + "/";
170
        if(document.bookbag_form.biblionumber.length > 0) {
172
        addSelRecords(c_value);
171
            for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
172
                if (document.bookbag_form.biblionumber[i].checked) {
173
                    c_value = c_value + document.bookbag_form.biblionumber[i].value + "/";
174
                }
175
            }
176
            addSelRecords(c_value);
177
        } else {
178
            c_value = c_value + document.bookbag_form.biblionumber.value + "/";
179
            addSelRecords(c_value);
180
        }
173
    }
181
    }
174
}
182
}
175
183
Lines 437-456 function addSelToShelf() { Link Here
437
///  vShelfAdd()  builds url string for multiple-biblio adds.
445
///  vShelfAdd()  builds url string for multiple-biblio adds.
438
446
439
function vShelfAdd() {
447
function vShelfAdd() {
440
        bibs= new Array;
448
    var bibnums = getContextBiblioNumbers();
449
    bibs = new Array;
450
    if ( bibnums.length > 0 ) {
451
        for ( var i = 0 ; i < bibnums.length ; i++ ) {
452
            bibs.push("biblionumber=" + bibnums[i]);
453
        }
454
        return bibs.join("&");
455
    } else {
441
        if(document.bookbag_form.biblionumber.length > 0) {
456
        if(document.bookbag_form.biblionumber.length > 0) {
442
                for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
457
            for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
443
                        if (document.bookbag_form.biblionumber[i].checked) {
458
                if (document.bookbag_form.biblionumber[i].checked) {
444
                                bibs.push("biblionumber=" +  document.bookbag_form.biblionumber[i].value);
459
                    bibs.push("biblionumber=" +  document.bookbag_form.biblionumber[i].value);
445
                        }
446
                }
460
                }
447
        if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); }
461
            }
462
            if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); }
448
            return bibs.join("&");
463
            return bibs.join("&");
449
        } else {
464
        } else {
450
            if (document.bookbag_form.biblionumber.checked) {
465
            if (document.bookbag_form.biblionumber.checked) {
451
                return "biblionumber=" + document.bookbag_form.biblionumber.value;
466
                return "biblionumber=" + document.bookbag_form.biblionumber.value;
452
            }
467
            }
453
        }
468
        }
469
    }
454
}
470
}
455
471
456
function showCart(){
472
function showCart(){
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/commons.js (+69 lines)
Line 0 Link Here
1
// Extends jQuery API
2
// http://www.wskidmore.com/downloads/jquery-uniqueArray.min.js
3
jQuery.extend({uniqueArray:function(e){if($.isArray(e)){var c={};var a,b;for(b=0,a=e.length;b<a;b++){var d=e[b].toString();if(c[d]){e.splice(b,1);a--;b--}else{c[d]=true}}}return(e)}});
4
5
function removeByValue(arr, val) {
6
    for(var i=0; i<arr.length; i++) {
7
        if(arr[i] == val) {
8
            arr.splice(i, 1);
9
            break;
10
        }
11
    }
12
}
13
14
function paramOfUrl( url, param ) {
15
    param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
16
    var regexS = "[\\?&]"+param+"=([^&#]*)";
17
    var regex = new RegExp( regexS );
18
    var results = regex.exec( url );
19
    if( results == null ) {
20
        return "";
21
    } else {
22
        return results[1];
23
    }
24
}
25
26
function addBibToContext( bibnum ) {
27
    var bibnums = getContextBiblioNumbers();
28
    bibnums.push(bibnum);
29
    setContextBiblioNumbers( bibnums );
30
    setContextBiblioNumbers( $.uniqueArray( bibnums ) );
31
}
32
33
function delBibToContext( bibnum ) {
34
    var bibnums = getContextBiblioNumbers();
35
    removeByValue( bibnums, bibnum );
36
    setContextBiblioNumbers( $.uniqueArray( bibnums ) );
37
}
38
39
function setContextBiblioNumbers( bibnums ) {
40
    $.cookie('bibs_selected', JSON.stringify( bibnums ));
41
}
42
43
function getContextBiblioNumbers() {
44
    var r = $.cookie('bibs_selected');
45
    if ( r ) {
46
        return JSON.parse(r);
47
    }
48
    r = new Array();
49
    return r;
50
}
51
52
function resetSearchContext() {
53
    setContextBiblioNumbers( new Array() );
54
}
55
56
$(document).ready(function(){
57
    // forms with action leading to search
58
    $("form[action*='opac-search.pl']").submit(function(){
59
        resetSearchContext();
60
    });
61
    // any link to launch a search except navigation links
62
    $("[href*='opac-search.pl?']").not(".nav").not('.searchwithcontext').click(function(){
63
        resetSearchContext();
64
    });
65
    // any link to a detail page from the results page.
66
    $("#bookbag_form a[href*='opac-detail.pl?']").click(function(){
67
        resetSearchContext();
68
    });
69
});
(-)a/opac/opac-detail.pl (-4 / +17 lines)
Lines 24-29 use Modern::Perl; Link Here
24
24
25
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
26
use C4::Acquisition qw( SearchOrders );
26
use C4::Acquisition qw( SearchOrders );
27
use JSON;
27
use C4::Auth qw(:DEFAULT get_session);
28
use C4::Auth qw(:DEFAULT get_session);
28
use C4::Koha;
29
use C4::Koha;
29
use C4::Serials;    #uses getsubscriptionfrom biblionumber
30
use C4::Serials;    #uses getsubscriptionfrom biblionumber
Lines 283-293 if ($session->param('busc')) { Link Here
283
            push @{$arrParamsBusc{$key}}, uri_unescape($value);
284
            push @{$arrParamsBusc{$key}}, uri_unescape($value);
284
        }
285
        }
285
    }
286
    }
287
286
    my $searchAgain = 0;
288
    my $searchAgain = 0;
289
    my ( $offset, $results_per_page );
290
291
    my $bibnums = JSON::from_json( $query->cookie('bibs_selected') || '[]' );
292
    if ( scalar( @$bibnums ) ) {
293
        $arrParamsBusc{count} = scalar( @$bibnums );
294
        $arrParamsBusc{listBiblios} = join ',', @$bibnums;
295
        $results_per_page = $arrParamsBusc{count};
296
        $offset = 0;
297
    } else {
298
    $offset = ($arrParamsBusc{'offset'} && $arrParamsBusc{'offset'} =~ /^[0-9]+?/)?$arrParamsBusc{'offset'}:0;
287
    my $count = C4::Context->preference('OPACnumSearchResults') || 20;
299
    my $count = C4::Context->preference('OPACnumSearchResults') || 20;
288
    my $results_per_page = ($arrParamsBusc{'count'} && $arrParamsBusc{'count'} =~ /^[0-9]+?/)?$arrParamsBusc{'count'}:$count;
300
    $results_per_page = ($arrParamsBusc{'count'} && $arrParamsBusc{'count'} =~ /^[0-9]+?/)?$arrParamsBusc{'count'}:$count;
289
    $arrParamsBusc{'count'} = $results_per_page;
301
    $arrParamsBusc{'count'} = $results_per_page;
290
    my $offset = ($arrParamsBusc{'offset'} && $arrParamsBusc{'offset'} =~ /^[0-9]+?/)?$arrParamsBusc{'offset'}:0;
291
    # The value OPACnumSearchResults has changed and the search has to be rebuild
302
    # The value OPACnumSearchResults has changed and the search has to be rebuild
292
    if ($count != $results_per_page) {
303
    if ($count != $results_per_page) {
293
        if (exists($arrParamsBusc{'listBiblios'}) && $arrParamsBusc{'listBiblios'} =~ /^[0-9]+(?:,[0-9]+)*$/) {
304
        if (exists($arrParamsBusc{'listBiblios'}) && $arrParamsBusc{'listBiblios'} =~ /^[0-9]+(?:,[0-9]+)*$/) {
Lines 347-352 if ($session->param('busc')) { Link Here
347
            @arrBusc = split(/\&(?:amp;)?/, $newbusc);
358
            @arrBusc = split(/\&(?:amp;)?/, $newbusc);
348
        }
359
        }
349
    }
360
    }
361
362
    } # end if cookie bibs_selected exists
363
350
    my $buscParam = '';
364
    my $buscParam = '';
351
    my $j = 0;
365
    my $j = 0;
352
    # Rebuild the query for the button "back to results"
366
    # Rebuild the query for the button "back to results"
Lines 413-419 if ($session->param('busc')) { Link Here
413
        }
427
        }
414
        $offsetSearch = 0 if (defined($offsetSearch) && $offsetSearch < 0);
428
        $offsetSearch = 0 if (defined($offsetSearch) && $offsetSearch < 0);
415
    }
429
    }
416
    if ($searchAgain) {
430
    if ($searchAgain and not scalar( @$bibnums )) {
417
        my $newresultsRef = searchAgain(\%arrParamsBusc, $offsetSearch, $results_per_page);
431
        my $newresultsRef = searchAgain(\%arrParamsBusc, $offsetSearch, $results_per_page);
418
        my @newresults = @$newresultsRef;
432
        my @newresults = @$newresultsRef;
419
        # build the new listBiblios
433
        # build the new listBiblios
420
- 

Return to bug 10858