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

(-)a/opac/opac-ISBDdetail.pl (-4 / +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 qw( IsAvailableForItemLevelRequest );
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 168-174 $template->param( Link Here
168
    subscriptionsnumber => $subscriptionsnumber,
168
    subscriptionsnumber => $subscriptionsnumber,
169
);
169
);
170
170
171
my $can_item_be_reserved = 0;
171
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
172
my $is_available;
172
my $res = GetISBDView({
173
my $res = GetISBDView({
173
    'record'    => $record,
174
    'record'    => $record,
174
    'template'  => 'opac',
175
    'template'  => 'opac',
Lines 178-187 my $res = GetISBDView({ Link Here
178
my $items = $biblio->items;
179
my $items = $biblio->items;
179
while ( my $item = $items->next ) {
180
while ( my $item = $items->next ) {
180
181
181
    $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef );
182
    $is_available = IsAvailableForItemLevelRequest($item, $patron, $currentbranch)
183
      unless $is_available;
182
}
184
}
183
185
184
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
186
my $canReserve = CanBookBeReserved($loggedinuser, $biblionumber, $currentbranch);
187
if (!$loggedinuser || ($canReserve->{status} eq "OK" && $is_available)) {
185
    $template->param( ReservableItems => 1 );
188
    $template->param( ReservableItems => 1 );
186
}
189
}
187
190
(-)a/opac/opac-MARCdetail.pl (-4 / +7 lines)
Lines 58-64 use C4::Biblio qw( Link Here
58
    GetMarcStructure
58
    GetMarcStructure
59
    TransformMarcToKoha
59
    TransformMarcToKoha
60
);
60
);
61
use C4::Reserves qw( IsAvailableForItemLevelRequest );
61
use C4::Reserves qw( IsAvailableForItemLevelRequest CanBookBeReserved );
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 136-149 $template->param( Link Here
136
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
136
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
137
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
137
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
138
138
139
my $can_item_be_reserved = 0;
139
my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
140
my $is_available;
140
$items->reset;
141
$items->reset;
141
142
142
while ( my $item = $items->next ) {
143
while ( my $item = $items->next ) {
143
    $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef );
144
    $is_available = IsAvailableForItemLevelRequest($item, $patron, $currentbranch)
145
      unless $is_available;
144
}
146
}
145
147
146
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
148
my $canReserve = CanBookBeReserved($loggedinuser, $biblionumber, $currentbranch);
149
if (!$loggedinuser || ($canReserve->{status} eq "OK" && $is_available)) {
147
    $template->param( ReservableItems => 1 );
150
    $template->param( ReservableItems => 1 );
148
}
151
}
149
152
(-)a/opac/opac-detail.pl (-5 / +6 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 IsAvailableForItemLevelRequest );
63
use C4::Reserves qw( GetReserveStatus IsAvailableForItemLevelRequest CanBookBeReserved );
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 658-664 if ( C4::Context->preference('OPACAcquisitionDetails' ) ) { Link Here
658
    };
658
    };
659
}
659
}
660
660
661
my $can_item_be_reserved = 0;
661
my $is_available;
662
my ( $itemloop_has_images, $otheritemloop_has_images );
662
my ( $itemloop_has_images, $otheritemloop_has_images );
663
if ( not $viewallitems and $items->count > $max_items_to_display ) {
663
if ( not $viewallitems and $items->count > $max_items_to_display ) {
664
    $template->param(
664
    $template->param(
Lines 682-688 else { Link Here
682
        $item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding;
682
        $item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding;
683
        $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home;
683
        $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home;
684
684
685
        $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest($item, $patron, undef);
685
        $is_available = IsAvailableForItemLevelRequest($item, $patron, $currentbranch)
686
          unless $is_available;
686
687
687
        # get collection code description, too
688
        # get collection code description, too
688
        my $ccode = $item->ccode;
689
        my $ccode = $item->ccode;
Lines 758-764 else { Link Here
758
    }
759
    }
759
}
760
}
760
761
761
if( $can_item_be_reserved || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) {
762
my $canReserve = CanBookBeReserved($borrowernumber, $biblionumber, $currentbranch);
763
if (!$borrowernumber || ($canReserve->{status} eq "OK" && $is_available)) {
762
    $template->param( ReservableItems => 1 );
764
    $template->param( ReservableItems => 1 );
763
}
765
}
764
766
765
- 

Return to bug 30556