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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 1404-1410 sub IsAvailableForItemLevelRequest { Link Here
1404
        my $any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $item->biblionumber, patron => $patron });
1404
        my $any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $item->biblionumber, patron => $patron });
1405
        return $any_available ? 0 : 1;
1405
        return $any_available ? 0 : 1;
1406
    } else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved)
1406
    } else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved)
1407
        return $item->onloan || IsItemOnHoldAndFound( $item->itemnumber );
1407
        return $item->notforloan < 0 || $item->onloan || IsItemOnHoldAndFound( $item->itemnumber );
1408
    }
1408
    }
1409
}
1409
}
1410
1410
(-)a/opac/opac-ISBDdetail.pl (-5 / +4 lines)
Lines 52-58 use C4::Biblio qw( Link Here
52
    GetMarcISSN
52
    GetMarcISSN
53
    TransformMarcToKoha
53
    TransformMarcToKoha
54
);
54
);
55
use C4::Reserves;
55
use C4::Reserves qw( IsAvailableForItemLevelRequest );
56
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
56
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
57
use C4::Koha qw(
57
use C4::Koha qw(
58
    GetNormalizedEAN
58
    GetNormalizedEAN
Lines 168-174 $template->param( Link Here
168
    subscriptionsnumber => $subscriptionsnumber,
168
    subscriptionsnumber => $subscriptionsnumber,
169
);
169
);
170
170
171
my $allow_onshelf_holds;
171
my $can_item_be_reserved = 0;
172
my $res = GetISBDView({
172
my $res = GetISBDView({
173
    'record'    => $record,
173
    'record'    => $record,
174
    'template'  => 'opac',
174
    'template'  => 'opac',
Lines 178-188 my $res = GetISBDView({ Link Here
178
my $items = $biblio->items;
178
my $items = $biblio->items;
179
while ( my $item = $items->next ) {
179
while ( my $item = $items->next ) {
180
180
181
    $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } )
181
    $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef);
182
      unless $allow_onshelf_holds;
183
}
182
}
184
183
185
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
184
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
186
    $template->param( ReservableItems => 1 );
185
    $template->param( ReservableItems => 1 );
187
}
186
}
188
187
(-)a/opac/opac-MARCdetail.pl (-5 / +4 lines)
Lines 58-64 use C4::Biblio qw( Link Here
58
    GetMarcStructure
58
    GetMarcStructure
59
    TransformMarcToKoha
59
    TransformMarcToKoha
60
);
60
);
61
use C4::Reserves;
61
use C4::Reserves qw( IsAvailableForItemLevelRequest );
62
use C4::Members;
62
use C4::Members;
63
use C4::Koha qw( GetNormalizedISBN );
63
use C4::Koha qw( GetNormalizedISBN );
64
use List::MoreUtils qw( uniq );
64
use List::MoreUtils qw( uniq );
Lines 139-153 $template->param( Link Here
139
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
139
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
140
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
140
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
141
141
142
my $allow_onshelf_holds;
142
my $can_item_be_reserved = 0;
143
my $items = $biblio->items;
143
my $items = $biblio->items;
144
144
145
while ( my $item = $items->next ) {
145
while ( my $item = $items->next ) {
146
    $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } )
146
    $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef);
147
      unless $allow_onshelf_holds;
148
}
147
}
149
148
150
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
149
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
151
    $template->param( ReservableItems => 1 );
150
    $template->param( ReservableItems => 1 );
152
}
151
}
153
152
(-)a/opac/opac-detail.pl (-7 / +4 lines)
Lines 60-66 use C4::External::Syndetics qw( Link Here
60
use C4::Members;
60
use C4::Members;
61
use C4::XSLT qw( XSLTParse4Display );
61
use C4::XSLT qw( XSLTParse4Display );
62
use C4::ShelfBrowser qw( GetNearbyItems );
62
use C4::ShelfBrowser qw( GetNearbyItems );
63
use C4::Reserves qw( GetReserveStatus );
63
use C4::Reserves qw( GetReserveStatus IsAvailableForItemLevelRequest );
64
use C4::Charset qw( SetUTF8Flag );
64
use C4::Charset qw( SetUTF8Flag );
65
use MARC::Field;
65
use MARC::Field;
66
use List::MoreUtils qw( any );
66
use List::MoreUtils qw( any );
Lines 662-668 if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { Link Here
662
    };
662
    };
663
}
663
}
664
664
665
my $allow_onshelf_holds;
665
my $can_item_be_reserved = 0;
666
my ( $itemloop_has_images, $otheritemloop_has_images );
666
my ( $itemloop_has_images, $otheritemloop_has_images );
667
if ( not $viewallitems and $items->count > $max_items_to_display ) {
667
if ( not $viewallitems and $items->count > $max_items_to_display ) {
668
    $template->param(
668
    $template->param(
Lines 686-694 else { Link Here
686
        $item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding;
686
        $item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding;
687
        $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home;
687
        $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home;
688
688
689
        $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy(
689
        $can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef);
690
            { item => $item, patron => $patron } )
691
          unless $allow_onshelf_holds;
692
690
693
        # get collection code description, too
691
        # get collection code description, too
694
        my $ccode = $item->ccode;
692
        my $ccode = $item->ccode;
Lines 763-769 else { Link Here
763
    }
761
    }
764
}
762
}
765
763
766
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
764
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
767
    $template->param( ReservableItems => 1 );
765
    $template->param( ReservableItems => 1 );
768
}
766
}
769
767
770
- 

Return to bug 30846