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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-4 / +1 lines)
Lines 159-165 Link Here
159
                <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
159
                <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
160
                    <input type="hidden" name="place_reserve" value="1"/>
160
                    <input type="hidden" name="place_reserve" value="1"/>
161
                    <!-- These values are set dynamically by js -->
161
                    <!-- These values are set dynamically by js -->
162
                    <input type="hidden" name="biblionumbers" id="biblionumbers"/>
163
                    <input type="hidden" name="selecteditems" id="selections"/>
162
                    <input type="hidden" name="selecteditems" id="selections"/>
164
                    <div id="bigloop">
163
                    <div id="bigloop">
165
164
Lines 178-183 Link Here
178
                                [% END %]
177
                                [% END %]
179
                                <p>
178
                                <p>
180
                                    [% IF ( bibitemloo.holdable ) %]
179
                                    [% IF ( bibitemloo.holdable ) %]
180
                                        <input name="biblionumber" type="hidden" value="[% bibitemloo.biblionumber | html %]"/>
181
                                        <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
181
                                        <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
182
                                        <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber | html %]"/>
182
                                        <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber | html %]"/>
183
                                        <span class="confirmjs_hold" title="[% bibitemloo.biblionumber | html %]" style="padding:.3em"></span>
183
                                        <span class="confirmjs_hold" title="[% bibitemloo.biblionumber | html %]" style="padding:.3em"></span>
Lines 620-626 Link Here
620
620
621
        // When 'Place Hold' button is clicked
621
        // When 'Place Hold' button is clicked
622
        $(".placehold").click(function(){
622
        $(".placehold").click(function(){
623
            var biblionumbers = "";
624
            var selections = "";
623
            var selections = "";
625
624
626
            [% IF new_reserves_allowed %]
625
            [% IF new_reserves_allowed %]
Lines 639-645 Link Here
639
            var badBib = null;
638
            var badBib = null;
640
            $(".confirmjs:checked").each(function() {
639
            $(".confirmjs:checked").each(function() {
641
                var biblioNum = $(this).val();
640
                var biblioNum = $(this).val();
642
                biblionumbers += biblioNum + "/";
643
                selections += biblioNum + "/";
641
                selections += biblioNum + "/";
644
642
645
                // If required hold note is empty, make it visible
643
                // If required hold note is empty, make it visible
Lines 677-683 Link Here
677
            }
675
            }
678
676
679
            $("#selections").val(selections);
677
            $("#selections").val(selections);
680
            $("#biblionumbers").val(biblionumbers);
681
678
682
            return true;
679
            return true;
683
        });
680
        });
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-5 / +7 lines)
Lines 590-596 Link Here
590
590
591
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
591
                            <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
592
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
592
                                <!-- The value will be set by holdBiblioNums() in basket.js -->
593
                                <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
594
                            </form>
593
                            </form>
595
                        </div> <!-- / .searchresults -->
594
                        </div> <!-- / .searchresults -->
596
595
Lines 641-652 Link Here
641
    <script>
640
    <script>
642
        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
641
        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
643
            function holdMultiple() {
642
            function holdMultiple() {
644
                var checkedBiblioNums = ""; // Separated by "/"
643
                var checkedBiblioNums = [];
645
                var checkedCount = 0;
644
                var checkedCount = 0;
646
                if(document.bookbag_form.biblionumber.length > 0) {
645
                if(document.bookbag_form.biblionumber.length > 0) {
647
                    for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
646
                    for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
648
                        if (document.bookbag_form.biblionumber[i].checked) {
647
                        if (document.bookbag_form.biblionumber[i].checked) {
649
                            checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
648
                            checkedBiblioNums.push(document.bookbag_form.biblionumber[i].value);
650
                            checkedCount++;
649
                            checkedCount++;
651
                        }
650
                        }
652
                    }
651
                    }
Lines 660-667 Link Here
660
            }
659
            }
661
660
662
            function holdBiblioNums(numList) {
661
            function holdBiblioNums(numList) {
663
                // numList: biblio numbers separated by "/"
662
                if (numList.length){
664
                $("#hold_form_biblios").attr("value", numList);
663
                    numList.forEach(function(list_item){
664
                        $("#hold_form").append('<input type="hidden" name="biblionumber" value="' + list_item + '"/>');
665
                    });
666
                }
665
                $("#hold_form").submit();
667
                $("#hold_form").submit();
666
            }
668
            }
667
        [% END # /IF opacuserlogin && RequestOnOpac %]
669
        [% END # /IF opacuserlogin && RequestOnOpac %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-3 / +8 lines)
Lines 823-833 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); Link Here
823
        if ($(checkedBoxes).size() == 0) {
823
        if ($(checkedBoxes).size() == 0) {
824
            alert( __("No item was selected") );
824
            alert( __("No item was selected") );
825
        } else {
825
        } else {
826
            var bibs = "";
826
            var bibs;
827
            var records = [];
827
            $(checkedBoxes).each(function(){
828
            $(checkedBoxes).each(function(){
828
                bibs += $(this).val() + "/";
829
                records.push( $(this).val() );
829
            });
830
            });
830
            document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers="+bibs;
831
            if (records.length){
832
                var params = { "biblionumber": records };
833
                bibs = $.param(params, true); //Use true so don't suffix params with []
834
            }
835
            document.location = "/cgi-bin/koha/opac-reserve.pl?"+bibs;
831
        }
836
        }
832
    }
837
    }
833
[% END %]
838
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js (-2 / +13 lines)
Lines 383-391 function showLess() { Link Here
383
}
383
}
384
384
385
function holdSel() {
385
function holdSel() {
386
    var items = document.getElementById('records').value;
386
    var items;
387
    var inputs = $("form#bookbag_form input:checked");
388
    if (inputs.length){
389
        var records = []
390
        inputs.each(function(){
391
            records.push( $(this).val() );
392
        });
393
        if (records.length){
394
            var params = { "biblionumber": records };
395
            items = $.param(params, true); //Use true so don't suffix params with []
396
        }
397
    }
387
    if (items) {
398
    if (items) {
388
        parent.opener.document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
399
        parent.opener.document.location = "/cgi-bin/koha/opac-reserve.pl?" + items;
389
        window.close();
400
        window.close();
390
    } else {
401
    } else {
391
        alert( __p("Bibliographic record", "No item was selected") );
402
        alert( __p("Bibliographic record", "No item was selected") );
(-)a/opac/opac-reserve.pl (-25 / +2 lines)
Lines 101-131 if ( $reservefee > 0){ Link Here
101
101
102
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
102
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
103
103
104
# There are two ways of calling this script, with a single biblio num
104
my @biblionumbers = $query->multi_param('biblionumber');
105
# or multiple biblio nums.
106
my $biblionumbers = $query->param('biblionumbers');
107
my $reserveMode = $query->param('reserve_mode');
108
if ($reserveMode && ($reserveMode eq 'single')) {
109
    my $bib = $query->param('single_bib');
110
    $biblionumbers = "$bib/";
111
}
112
if (! $biblionumbers) {
113
    $biblionumbers = $query->param('biblionumber');
114
}
115
116
if ((! $biblionumbers) && (! $query->param('place_reserve'))) {
117
    $template->param(message=>1, no_biblionumber=>1);
118
    output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
119
    exit;
120
}
121
122
# Pass the numbers to the page so they can be fed back
123
# when the hold is confirmed. TODO: Not necessary?
124
$template->param( biblionumbers => $biblionumbers );
125
105
126
# Each biblio number is suffixed with '/', e.g. "1/2/3/"
106
if ( ! @biblionumbers && (! $query->param('place_reserve'))) {
127
my @biblionumbers = split /\//, $biblionumbers;
128
if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) {
129
    # TODO: New message?
107
    # TODO: New message?
130
    $template->param(message=>1, no_biblionumber=>1);
108
    $template->param(message=>1, no_biblionumber=>1);
131
    output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
109
    output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
132
- 

Return to bug 27301