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

(-)a/opac/opac-MARCdetail.pl (-18 / +14 lines)
Lines 92-100 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
92
92
93
my $patron = Koha::Patrons->find($loggedinuser);
93
my $patron = Koha::Patrons->find($loggedinuser);
94
my $biblio = Koha::Biblios->find($biblionumber);
94
my $biblio = Koha::Biblios->find($biblionumber);
95
95
if ( !$biblio ) {
96
my $record = $biblio ? $biblio->metadata->record : undef;
97
if ( ! $record ) {
98
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
96
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
99
    exit;
97
    exit;
100
}
98
}
Lines 108-126 unless ( $patron and $patron->category->override_hidden_items ) { Link Here
108
    }
106
    }
109
}
107
}
110
108
111
my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron });
109
my $record = $biblio ? $biblio->metadata_record(
112
my $framework = $biblio ? $biblio->frameworkcode : q{};
110
    {
113
my $tagslib   = &GetMarcStructure( 0, $framework );
111
        embed_items => 1,
114
112
        opac        => 1,
115
my $record_processor = Koha::RecordProcessor->new({
113
        patron      => $patron,
116
    filters => [ 'EmbedItems', 'ViewPolicy' ],
117
    options => {
118
        interface     => 'opac',
119
        frameworkcode => $framework,
120
        items         => [ $items->as_list ],
121
    }
114
    }
122
});
115
) : undef;
123
$record_processor->process($record);
116
if ( ! $record ) {
117
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
118
    exit;
119
}
124
120
125
# get biblionumbers stored in the cart
121
# get biblionumbers stored in the cart
126
if(my $cart_list = $query->cookie("bib_list")){
122
if(my $cart_list = $query->cookie("bib_list")){
Lines 130-135 if(my $cart_list = $query->cookie("bib_list")){ Link Here
130
    }
126
    }
131
}
127
}
132
128
129
my $framework = $biblio ? $biblio->frameworkcode : q{};
130
my $tagslib   = &GetMarcStructure( 0, $framework );
133
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField( 'biblio.title' );
131
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField( 'biblio.title' );
134
$template->param(
132
$template->param(
135
    bibliotitle => $biblio->title,
133
    bibliotitle => $biblio->title,
Lines 137-144 $template->param( Link Here
137
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
135
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
138
136
139
my $can_item_be_reserved = 0;
137
my $can_item_be_reserved = 0;
140
$items->reset;
138
my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron });
141
142
while ( my $item = $items->next ) {
139
while ( my $item = $items->next ) {
143
    $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef );
140
    $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest( $item, $patron, undef );
144
}
141
}
145
- 

Return to bug 31224