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 510-529 Link Here
510
    var MSG_EMPTY_START_DATE = _("Hold start date should be filled.");
506
    var MSG_EMPTY_START_DATE = _("Hold start date should be filled.");
511
    var MSG_EMPTY_END_DATE   = _("Hold expiration date should be filled.");
507
    var MSG_EMPTY_END_DATE   = _("Hold expiration date should be filled.");
512
508
513
    function calculate_delay_days(){
514
        $(".branch > select").each(function(){
515
            var selected_branch = $(this).val();
516
            var branch_biblionumber = $(this).attr('id');
517
            var biblionumber = branch_biblionumber.slice( branch_biblionumber.indexOf('_')+1 );
518
            [% FOREACH branchcode IN pickup_delays.keys %]
519
                var branchcode = "[% branchcode | html %]";
520
                if ( branchcode == selected_branch ) {
521
                    $("#pickup_delay_days_" + biblionumber).text([% pickup_delays.$branchcode | html %]);
522
                }
523
            [% END %]
524
        });
525
    }
526
527
    $(document).ready(function() {
509
    $(document).ready(function() {
528
510
529
        $(".toggle_unholdable").click(function(e){
511
        $(".toggle_unholdable").click(function(e){
Lines 531-542 Link Here
531
            $(this).parent('div').find(".unholdable").toggle();
513
            $(this).parent('div').find(".unholdable").toggle();
532
        });
514
        });
533
515
534
        calculate_delay_days();
535
        $(".pickup_delay").show();
536
        $(".branch > select").change(function(){
537
            calculate_delay_days();
538
        });
539
540
        $("#hold-request-form").preventDoubleFormSubmit();
516
        $("#hold-request-form").preventDoubleFormSubmit();
541
        var copiesRowId = null;
517
        var copiesRowId = null;
542
        var wasSpecific = false;
518
        var wasSpecific = false;
(-)a/opac/opac-reserve.pl (-20 lines)
Lines 626-648 if ( Link Here
626
    );
626
    );
627
}
627
}
628
628
629
my @branches = Koha::Libraries->search->as_list;
630
my %hold_pickup_delay_by_branch = ();
631
632
foreach my $branch ( @branches ) {
633
    my $rule = Koha::CirculationRules->get_effective_rule({
634
        categorycode => $patron->categorycode,
635
        branchcode => $branch->branchcode,
636
        itemtype => undef,
637
        rule_name => 'holds_pickup_period',
638
    });
639
    if ( $rule and $rule->rule_value ) {
640
        $hold_pickup_delay_by_branch{$branch->branchcode} = $rule->rule_value;
641
    } else {
642
        $hold_pickup_delay_by_branch{$branch->branchcode} = C4::Context->preference('ReservesMaxPickUpDelay');
643
    }
644
}
645
646
$template->param( pickup_delays => \%hold_pickup_delay_by_branch );
647
648
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
629
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
649
- 

Return to bug 8367