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 275-284 Link Here
275
                                            [% END # / UNLESS singleBranchMode %]
275
                                            [% END # / UNLESS singleBranchMode %]
276
                                        </ul>
276
                                        </ul>
277
277
278
                                        [% IF pickup_delays %]
279
                                            <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>
280
                                        [% END %]
281
282
                                        <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
278
                                        <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
283
279
284
                                        <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
280
                                        <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
Lines 503-522 Link Here
503
<script>
499
<script>
504
    var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
500
    var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
505
501
506
    function calculate_delay_days(){
507
        $(".branch > select").each(function(){
508
            var selected_branch = $(this).val();
509
            var branch_biblionumber = $(this).attr('id');
510
            var biblionumber = branch_biblionumber.slice( branch_biblionumber.indexOf('_')+1 );
511
            [% FOREACH branchcode IN pickup_delays.keys %]
512
                var branchcode = "[% branchcode | html %]";
513
                if ( branchcode == selected_branch ) {
514
                    $("#pickup_delay_days_" + biblionumber).text([% pickup_delays.$branchcode | html %]);
515
                }
516
            [% END %]
517
        });
518
    }
519
520
    $(document).ready(function() {
502
    $(document).ready(function() {
521
503
522
        $(".toggle_unholdable").click(function(e){
504
        $(".toggle_unholdable").click(function(e){
Lines 524-535 Link Here
524
            $(this).parent('div').find(".unholdable").toggle();
506
            $(this).parent('div').find(".unholdable").toggle();
525
        });
507
        });
526
508
527
        calculate_delay_days();
528
        $(".pickup_delay").show();
529
        $(".branch > select").change(function(){
530
            calculate_delay_days();
531
        });
532
533
        $("#hold-request-form").preventDoubleFormSubmit();
509
        $("#hold-request-form").preventDoubleFormSubmit();
534
        var copiesRowId = null;
510
        var copiesRowId = null;
535
        var wasSpecific = false;
511
        var wasSpecific = false;
(-)a/opac/opac-reserve.pl (-20 lines)
Lines 693-715 if ( Link Here
693
    );
693
    );
694
}
694
}
695
695
696
my @branches = Koha::Libraries->search->as_list;
697
my %hold_pickup_delay_by_branch = ();
698
699
foreach my $branch ( @branches ) {
700
    my $rule = Koha::CirculationRules->get_effective_rule({
701
        categorycode => $patron->categorycode,
702
        branchcode => $branch->branchcode,
703
        itemtype => undef,
704
        rule_name => 'holds_pickup_period',
705
    });
706
    if ( $rule and $rule->rule_value ) {
707
        $hold_pickup_delay_by_branch{$branch->branchcode} = $rule->rule_value;
708
    } else {
709
        $hold_pickup_delay_by_branch{$branch->branchcode} = C4::Context->preference('ReservesMaxPickUpDelay');
710
    }
711
}
712
713
$template->param( pickup_delays => \%hold_pickup_delay_by_branch );
714
715
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
696
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
716
- 

Return to bug 8367