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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-6 / +20 lines)
Lines 399-404 Link Here
399
                                        <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
399
                                        <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
400
                                    [% END %]
400
                                    [% END %]
401
                                [% END %]
401
                                [% END %]
402
                            [% ELSIF ( none_available ) %]
403
                                <li><strong>No items available: </strong>One or more records have no items that can be held</li>
402
                            [% END # /IF exceeded_maxreserves %]
404
                            [% END # /IF exceeded_maxreserves %]
403
                        [% END # /UNLESS multi_hold %]
405
                        [% END # /UNLESS multi_hold %]
404
                    </div>
406
                    </div>
Lines 663-668 Link Here
663
                                                                    <span>Library is not a pickup location</span>
665
                                                                    <span>Library is not a pickup location</span>
664
                                                                [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
666
                                                                [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
665
                                                                    <span>No valid pickup location</span>
667
                                                                    <span>No valid pickup location</span>
668
                                                                [% ELSIF itemloo.not_holdable == 'notforloan' %]
669
                                                                    <span>Not for loan</span>
666
                                                                [% ELSE %]
670
                                                                [% ELSE %]
667
                                                                    <span>[% itemloo.not_holdable | html %]</span>
671
                                                                    <span>[% itemloo.not_holdable | html %]</span>
668
                                                                [% END %]
672
                                                                [% END %]
Lines 769-774 Link Here
769
773
770
                                                    [% IF ( itemloo.notforloan ) %]
774
                                                    [% IF ( itemloo.notforloan ) %]
771
                                                       <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
775
                                                       <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
776
                                                    [% ELSIF ( itemloo.notforloanitype ) %]
777
                                                       <span class="nfl">Not for loan (Itemtype not for loan)</span>
772
                                                    [% END %]
778
                                                    [% END %]
773
                                                </td>
779
                                                </td>
774
                                            </tr>
780
                                            </tr>
Lines 883-895 Link Here
883
889
884
                        <fieldset class="action">
890
                        <fieldset class="action">
885
                            [% IF ( patron AND patron.borrowernumber ) %]
891
                            [% IF ( patron AND patron.borrowernumber ) %]
886
                                [% IF ( override_required ) %]
892
                                [% IF ( multi_hold ) %]
887
                                    <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
893
                                    [% IF ( override_required ) %]
888
                                [% ELSIF ( none_available ) %]
894
                                        <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
889
                                    <button class="btn btn-default" type="submit">Place holds</button>
895
                                    [% ELSIF ( no_bibs_available ) %]
890
                                [% ELSE %]
896
                                        <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place holds</button>
891
                                    [% IF ( multi_hold ) %]
897
                                    [% ELSIF ( none_available ) %]
898
                                        <button type="submit" class="btn btn-default">Place holds</button>
899
                                    [% ELSE %]
892
                                        <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
900
                                        <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
901
                                    [% END %]
902
                                [% ELSE %]
903
                                    [% IF ( override_required ) %]
904
                                        <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
905
                                    [% ELSIF ( none_available ) %]
906
                                        <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place hold</button>
893
                                    [% ELSE %]
907
                                    [% ELSE %]
894
                                        <button type="submit" class="btn btn-default">Place hold</button>
908
                                        <button type="submit" class="btn btn-default">Place hold</button>
895
                                    [% END %]
909
                                    [% END %]
(-)a/reserve/request.pl (-7 / +15 lines)
Lines 71-77 my $pickup = $input->param('pickup'); Link Here
71
my $itemtypes = {
71
my $itemtypes = {
72
    map {
72
    map {
73
        $_->itemtype =>
73
        $_->itemtype =>
74
          { %{ $_->unblessed }, image_location => $_->image_location }
74
          { %{ $_->unblessed }, image_location => $_->image_location, notforloan => $_->notforloan }
75
    } Koha::ItemTypes->search_with_localization->as_list
75
    } Koha::ItemTypes->search_with_localization->as_list
76
};
76
};
77
77
Lines 294-299 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
294
    my $itemdata_ccode = 0;
294
    my $itemdata_ccode = 0;
295
    my @biblioloop = ();
295
    my @biblioloop = ();
296
    my $no_reserves_allowed = 0;
296
    my $no_reserves_allowed = 0;
297
    my $num_bibs_available = 0;
297
    foreach my $biblionumber (@biblionumbers) {
298
    foreach my $biblionumber (@biblionumbers) {
298
        next unless $biblionumber =~ m|^\d+$|;
299
        next unless $biblionumber =~ m|^\d+$|;
299
300
Lines 382-388 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
382
383
383
        if ( $club_hold or $borrowernumber_hold ) {
384
        if ( $club_hold or $borrowernumber_hold ) {
384
            my @available_itemtypes;
385
            my @available_itemtypes;
385
            my $num_available = 0;
386
            my $num_items_available = 0;
386
            my $num_override  = 0;
387
            my $num_override  = 0;
387
            my $hiddencount   = 0;
388
            my $hiddencount   = 0;
388
            my $num_alreadyheld = 0;
389
            my $num_alreadyheld = 0;
Lines 462-467 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
462
                }
463
                }
463
464
464
                # If there is no loan, return and transfer, we show a checkbox.
465
                # If there is no loan, return and transfer, we show a checkbox.
466
                $item->{notforloanitype} = $item->{itemtype}->{notforloan};
465
                $item->{notforloan} ||= 0;
467
                $item->{notforloan} ||= 0;
466
468
467
                # if independent branches is on we need to check if the person can reserve
469
                # if independent branches is on we need to check if the person can reserve
Lines 486-491 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
486
488
487
                    my $can_item_be_reserved = CanItemBeReserved( $patron, $item_object )->{status};
489
                    my $can_item_be_reserved = CanItemBeReserved( $patron, $item_object )->{status};
488
                    $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' );
490
                    $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' );
491
                    $item->{not_holdable} ||= 'notforloan' if ( $item->{notforloanitype} || $item->{notforloan} > 0 );
492
489
493
490
                    $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } );
494
                    $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } );
491
495
Lines 502-508 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
502
                        my $pickup_locations = $item_object->pickup_locations({ patron => $patron });
506
                        my $pickup_locations = $item_object->pickup_locations({ patron => $patron });
503
                        $item->{pickup_locations_count} = $pickup_locations->count;
507
                        $item->{pickup_locations_count} = $pickup_locations->count;
504
                        if ( $item->{pickup_locations_count} > 0 ) {
508
                        if ( $item->{pickup_locations_count} > 0 ) {
505
                            $num_available++;
509
                            $num_items_available++;
506
                            $item->{available} = 1;
510
                            $item->{available} = 1;
507
                            # pass the holding branch for use as default
511
                            # pass the holding branch for use as default
508
                            my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next;
512
                            my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next;
Lines 524-530 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
524
                            $item->{pickup_locations_count} = scalar @pickup_locations;
528
                            $item->{pickup_locations_count} = scalar @pickup_locations;
525
529
526
                            if ( @pickup_locations ) {
530
                            if ( @pickup_locations ) {
527
                                $num_available++;
531
                                $num_items_available++;
528
                                $item->{available} = 1;
532
                                $item->{available} = 1;
529
533
530
                                my $default_pickup_location;
534
                                my $default_pickup_location;
Lines 543-551 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
543
                        } else { $num_alreadyheld++ }
547
                        } else { $num_alreadyheld++ }
544
548
545
                        push( @available_itemtypes, $item->{itype} );
549
                        push( @available_itemtypes, $item->{itype} );
550
                    } else {
551
                        # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
552
                        $item->{available} = 0;
546
                    }
553
                    }
547
554
548
                    # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
549
555
550
                    # Show serial enumeration when needed
556
                    # Show serial enumeration when needed
551
                    if ($item->{enumchron}) {
557
                    if ($item->{enumchron}) {
Lines 567-573 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
567
            if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioloopiter{itemloop} } ) ) {
573
            if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioloopiter{itemloop} } ) ) {
568
            # That is, if all items require an override
574
            # That is, if all items require an override
569
                $template->param( override_required => 1 );
575
                $template->param( override_required => 1 );
570
            } elsif ( $num_available == 0 ) {
576
            } elsif ( $num_items_available == 0 ) {
571
                $template->param( none_available => 1 );
577
                $template->param( none_available => 1 );
572
                $biblioloopiter{warn} = 1;
578
                $biblioloopiter{warn} = 1;
573
                $biblioloopiter{none_avail} = 1;
579
                $biblioloopiter{none_avail} = 1;
Lines 675-683 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
675
            $biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ];
681
            $biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ];
676
        }
682
        }
677
683
684
        $num_bibs_available++ unless $biblioloopiter{none_avail};
678
        push @biblioloop, \%biblioloopiter;
685
        push @biblioloop, \%biblioloopiter;
679
    }
686
    }
680
687
688
    $template->param( no_bibs_available => 1 ) unless $num_bibs_available > 0;
689
681
    $template->param( biblioloop => \@biblioloop );
690
    $template->param( biblioloop => \@biblioloop );
682
    $template->param( no_reserves_allowed => $no_reserves_allowed );
691
    $template->param( no_reserves_allowed => $no_reserves_allowed );
683
    $template->param( exceeded_maxreserves => $exceeded_maxreserves );
692
    $template->param( exceeded_maxreserves => $exceeded_maxreserves );
684
- 

Return to bug 30742