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

(-)a/opac/opac-ISBDdetail.pl (-5 / +7 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 CanBookBeReserved );
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 167-173 $template->param( Link Here
167
    subscriptionsnumber => $subscriptionsnumber,
167
    subscriptionsnumber => $subscriptionsnumber,
168
);
168
);
169
169
170
my $allow_onshelf_holds;
170
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
171
my $is_available;
171
my $res = GetISBDView({
172
my $res = GetISBDView({
172
    'record'    => $record,
173
    'record'    => $record,
173
    'template'  => 'opac',
174
    'template'  => 'opac',
Lines 177-187 my $res = GetISBDView({ Link Here
177
my $items = $biblio->items;
178
my $items = $biblio->items;
178
while ( my $item = $items->next ) {
179
while ( my $item = $items->next ) {
179
180
180
    $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } )
181
    $is_available = IsAvailableForItemLevelRequest($item, $patron, $currentbranch)
181
      unless $allow_onshelf_holds;
182
      unless $is_available;
182
}
183
}
183
184
184
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
185
my $canReserve = CanBookBeReserved($loggedinuser, $biblionumber, $currentbranch);
186
if ( $canReserve->{status} eq "OK" && $is_available) {
185
    $template->param( ReservableItems => 1 );
187
    $template->param( ReservableItems => 1 );
186
}
188
}
187
189
(-)a/opac/opac-MARCdetail.pl (-5 / +7 lines)
Lines 59-65 use C4::Biblio qw( Link Here
59
    GetMarcStructure
59
    GetMarcStructure
60
    TransformMarcToKoha
60
    TransformMarcToKoha
61
);
61
);
62
use C4::Reserves;
62
use C4::Reserves qw( IsAvailableForItemLevelRequest CanBookBeReserved );
63
use C4::Members;
63
use C4::Members;
64
use C4::Koha qw( GetNormalizedISBN );
64
use C4::Koha qw( GetNormalizedISBN );
65
use List::MoreUtils qw( uniq );
65
use List::MoreUtils qw( uniq );
Lines 143-157 $template->param( Link Here
143
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
143
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
144
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
144
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
145
145
146
my $allow_onshelf_holds;
146
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
147
my $is_available;
147
my $items = $biblio->items;
148
my $items = $biblio->items;
148
149
149
while ( my $item = $items->next ) {
150
while ( my $item = $items->next ) {
150
    $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } )
151
    $is_available = IsAvailableForItemLevelRequest($item, $patron, $currentbranch)
151
      unless $allow_onshelf_holds;
152
      unless $is_available;
152
}
153
}
153
154
154
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
155
my $canReserve = CanBookBeReserved($loggedinuser, $biblionumber, $currentbranch);
156
if ( $canReserve->{status} eq "OK" && $is_available) {
155
    $template->param( ReservableItems => 1 );
157
    $template->param( ReservableItems => 1 );
156
}
158
}
157
159
(-)a/opac/opac-detail.pl (-6 / +6 lines)
Lines 63-69 use C4::External::Syndetics qw( Link Here
63
use C4::Members;
63
use C4::Members;
64
use C4::XSLT qw( XSLTParse4Display );
64
use C4::XSLT qw( XSLTParse4Display );
65
use C4::ShelfBrowser qw( GetNearbyItems );
65
use C4::ShelfBrowser qw( GetNearbyItems );
66
use C4::Reserves qw( GetReserveStatus );
66
use C4::Reserves qw( GetReserveStatus IsAvailableForItemLevelRequest CanBookBeReserved );
67
use C4::Charset qw( SetUTF8Flag );
67
use C4::Charset qw( SetUTF8Flag );
68
use MARC::Field;
68
use MARC::Field;
69
use List::MoreUtils qw( any );
69
use List::MoreUtils qw( any );
Lines 698-704 if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { Link Here
698
    };
698
    };
699
}
699
}
700
700
701
my $allow_onshelf_holds;
701
my $is_available;
702
my ( $itemloop_has_images, $otheritemloop_has_images );
702
my ( $itemloop_has_images, $otheritemloop_has_images );
703
if ( not $viewallitems and @items > $max_items_to_display ) {
703
if ( not $viewallitems and @items > $max_items_to_display ) {
704
    $template->param(
704
    $template->param(
Lines 711-718 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
711
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
711
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
712
    $itm->{priority} = $priority{ $itm->{itemnumber} };
712
    $itm->{priority} = $priority{ $itm->{itemnumber} };
713
713
714
    $allow_onshelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } )
714
    $is_available = IsAvailableForItemLevelRequest($item, $patron, $currentbranch)
715
      unless $allow_onshelf_holds;
715
      unless $is_available;
716
716
717
    # get collection code description, too
717
    # get collection code description, too
718
    my $ccode = $itm->{'ccode'};
718
    my $ccode = $itm->{'ccode'};
Lines 776-782 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
776
  }
776
  }
777
}
777
}
778
778
779
if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
779
my $canReserve = CanBookBeReserved($borrowernumber, $biblionumber, $currentbranch);
780
if ( $canReserve->{status} eq "OK" && $is_available) {
780
    $template->param( ReservableItems => 1 );
781
    $template->param( ReservableItems => 1 );
781
}
782
}
782
783
783
- 

Return to bug 30556