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 282-291 Link Here
282
                                            [% END # / UNLESS singleBranchMode %]
282
                                            [% END # / UNLESS singleBranchMode %]
283
                                        </ul>
283
                                        </ul>
284
284
285
                                        [% IF pickup_delays %]
286
                                            <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>
287
                                        [% END %]
288
289
                                        <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
285
                                        <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber | html %]" style="display:none;" href="#">Show more options</a>
290
286
291
                                        <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
287
                                        <div id="hold-options-[% bibitemloo.biblionumber | html %]" class="hold-options">
Lines 493-512 Link Here
493
    var MSG_EMPTY_START_DATE = _("Hold start date should be filled.");
489
    var MSG_EMPTY_START_DATE = _("Hold start date should be filled.");
494
    var MSG_EMPTY_END_DATE   = _("Hold expiration date should be filled.");
490
    var MSG_EMPTY_END_DATE   = _("Hold expiration date should be filled.");
495
491
496
    function calculate_delay_days(){
497
        $(".branch > select").each(function(){
498
            var selected_branch = $(this).val();
499
            var branch_biblionumber = $(this).attr('id');
500
            var biblionumber = branch_biblionumber.slice( branch_biblionumber.indexOf('_')+1 );
501
            [% FOREACH branchcode IN pickup_delays.keys %]
502
                var branchcode = "[% branchcode | html %]";
503
                if ( branchcode == selected_branch ) {
504
                    $("#pickup_delay_days_" + biblionumber).text([% pickup_delays.$branchcode | html %]);
505
                }
506
            [% END %]
507
        });
508
    }
509
510
    $(document).ready(function() {
492
    $(document).ready(function() {
511
493
512
        $(".toggle_unholdable").click(function(e){
494
        $(".toggle_unholdable").click(function(e){
Lines 514-525 Link Here
514
            $(this).parent('div').find(".unholdable").toggle();
496
            $(this).parent('div').find(".unholdable").toggle();
515
        });
497
        });
516
498
517
        calculate_delay_days();
518
        $(".pickup_delay").show();
519
        $(".branch > select").change(function(){
520
            calculate_delay_days();
521
        });
522
523
        $("#hold-request-form").preventDoubleFormSubmit();
499
        $("#hold-request-form").preventDoubleFormSubmit();
524
        var copiesRowId = null;
500
        var copiesRowId = null;
525
        var wasSpecific = false;
501
        var wasSpecific = false;
(-)a/opac/opac-reserve.pl (-20 lines)
Lines 613-635 if ( Link Here
613
    );
613
    );
614
}
614
}
615
615
616
my @branches = Koha::Libraries->search->as_list;
617
my %hold_pickup_delay_by_branch = ();
618
619
foreach my $branch ( @branches ) {
620
    my $rule = Koha::CirculationRules->get_effective_rule({
621
        categorycode => $patron->categorycode,
622
        branchcode => $branch->branchcode,
623
        itemtype => undef,
624
        rule_name => 'holds_pickup_period',
625
    });
626
    if ( $rule and $rule->rule_value ) {
627
        $hold_pickup_delay_by_branch{$branch->branchcode} = $rule->rule_value;
628
    } else {
629
        $hold_pickup_delay_by_branch{$branch->branchcode} = C4::Context->preference('ReservesMaxPickUpDelay');
630
    }
631
}
632
633
$template->param( pickup_delays => \%hold_pickup_delay_by_branch );
634
635
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
616
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
636
- 

Return to bug 8367