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

Return to bug 8367