Lines 161-184
sub get_biblios_public {
Link Here
|
161 |
|
161 |
|
162 |
my ( $error, $results, $total_hits ) = $searcher->simple_search_compat( $query, 0, undef ); |
162 |
my ( $error, $results, $total_hits ) = $searcher->simple_search_compat( $query, 0, undef ); |
163 |
|
163 |
|
164 |
if ( !$total_hits ) { |
|
|
165 |
return $c->render( |
166 |
status => 404, |
167 |
openapi => { error => 'Nothing found.' } |
168 |
); |
169 |
} |
170 |
|
171 |
return try { |
164 |
return try { |
172 |
|
165 |
|
173 |
my $patron = $c->stash('koha.user'); |
166 |
my $patron = $c->stash('koha.user'); |
174 |
my $is_public = $c->stash('is_public'); |
167 |
my $is_public = $c->stash('is_public'); |
175 |
my $opachiddenitems_rules = C4::Context->yaml_preference('OpacHiddenItems'); |
168 |
my $opachiddenitems_rules = C4::Context->yaml_preference('OpacHiddenItems'); |
176 |
my $searchengine = C4::Context->preference('SearchEngine'); |
|
|
177 |
|
169 |
|
178 |
my @biblionumbers |
170 |
my @biblionumbers; |
179 |
= $searchengine eq 'Zebra' |
171 |
foreach my $res ( @$results ) { |
180 |
? map { MARC::Record->new_from_xml( $_, 'UTF-8' )->field('999')->subfield('c') } $results->@* |
172 |
my $bibno = $searcher->extract_biblionumber( $res ); |
181 |
: map { $_->field('999')->subfield('c') } $results->@*; |
173 |
push @biblionumbers, $bibno if $bibno; |
|
|
174 |
} |
175 |
|
182 |
my @biblios = map { Koha::Biblios->find( { biblionumber => $_ } ) } @biblionumbers; |
176 |
my @biblios = map { Koha::Biblios->find( { biblionumber => $_ } ) } @biblionumbers; |
183 |
my @records = map { |
177 |
my @records = map { |
184 |
next if ( $is_public |
178 |
next if ( $is_public |
Lines 187-192
sub get_biblios_public {
Link Here
|
187 |
$_->metadata->record; |
181 |
$_->metadata->record; |
188 |
} @biblios; |
182 |
} @biblios; |
189 |
|
183 |
|
|
|
184 |
# Extract reserved params |
185 |
my ( $filtered_params, $reserved_params, $path_params ) = $c->extract_reserved_params( $c->req->params->to_hash ); |
186 |
|
187 |
$c->add_pagination_headers( |
188 |
{ |
189 |
page => $reserved_params->{_page}, |
190 |
per_page => $reserved_params->{_per_page}, |
191 |
query_params => $reserved_params->{_q_params}, |
192 |
total => $total_hits, |
193 |
} |
194 |
); |
195 |
|
190 |
$c->respond_to( |
196 |
$c->respond_to( |
191 |
mij => { |
197 |
mij => { |
192 |
status => 200, |
198 |
status => 200, |