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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-24 lines)
Lines 273-282 Link Here
273
                                            [% END # / UNLESS singleBranchMode %]
273
                                            [% END # / UNLESS singleBranchMode %]
274
                                        </ul>
274
                                        </ul>
275
275
276
                                        [% IF pickup_delays %]
277
                                            <p class="pickup_delay" style="display:none;">When your item is ready for pickup, you will have <span id="pickup_delay_days_[% bibitemloo.biblionumber | html %]"></span> days to pick it up from this library.</p>
278
                                        [% END %]
279
280
                                        <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
276
                                        <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
281
277
282
                                        <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
278
                                        <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
Lines 512-531 Link Here
512
        $(radios).first().attr("checked", "checked");
508
        $(radios).first().attr("checked", "checked");
513
    }
509
    }
514
510
515
    function calculate_delay_days(){
516
        $(".branch > select").each(function(){
517
            var selected_branch = $(this).val();
518
            var branch_biblionumber = $(this).attr('id');
519
            var biblionumber = branch_biblionumber.slice( branch_biblionumber.indexOf('_')+1 );
520
            [% FOREACH branchcode IN pickup_delays.keys %]
521
                var branchcode = "[% branchcode | html %]";
522
                if ( branchcode == selected_branch ) {
523
                    $("#pickup_delay_days_" + biblionumber).text([% pickup_delays.$branchcode | html %]);
524
                }
525
            [% END %]
526
        });
527
    }
528
529
    $(document).ready(function() {
511
    $(document).ready(function() {
530
512
531
        $(".toggle_unholdable").click(function(e){
513
        $(".toggle_unholdable").click(function(e){
Lines 533-544 Link Here
533
            $(this).parent('div').find(".unholdable").toggle();
515
            $(this).parent('div').find(".unholdable").toggle();
534
        });
516
        });
535
517
536
        calculate_delay_days();
537
        $(".pickup_delay").show();
538
        $(".branch > select").change(function(){
539
            calculate_delay_days();
540
        });
541
542
        $("#hold-request-form").preventDoubleFormSubmit();
518
        $("#hold-request-form").preventDoubleFormSubmit();
543
        var copiesRowId = null;
519
        var copiesRowId = null;
544
        var wasSpecific = false;
520
        var wasSpecific = false;
(-)a/opac/opac-reserve.pl (-20 lines)
Lines 689-711 if ( Link Here
689
    );
689
    );
690
}
690
}
691
691
692
my @branches = Koha::Libraries->search->as_list;
693
my %hold_pickup_delay_by_branch = ();
694
695
foreach my $branch ( @branches ) {
696
    my $rule = Koha::CirculationRules->get_effective_rule({
697
        categorycode => $patron->categorycode,
698
        branchcode => $branch->branchcode,
699
        itemtype => undef,
700
        rule_name => 'holds_pickup_period',
701
    });
702
    if ( $rule and $rule->rule_value ) {
703
        $hold_pickup_delay_by_branch{$branch->branchcode} = $rule->rule_value;
704
    } else {
705
        $hold_pickup_delay_by_branch{$branch->branchcode} = C4::Context->preference('ReservesMaxPickUpDelay');
706
    }
707
}
708
709
$template->param( pickup_delays => \%hold_pickup_delay_by_branch );
710
711
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
692
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
712
- 

Return to bug 8367