X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-tags.pl;h=43f156d31b47387a6ee3c78eb1474acbb8fc0496;hb=7c7db3eb6be53737af4c06a052b425f2c066575b;hp=c8f5d15aab8074b1bf6f8aaffa2365ad337df7b7;hpb=0a37e8f7fd89d9ea23e0a8649885cca3f9c043f3;p=koha-ffzg.git diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index c8f5d15aab..43f156d31b 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -40,8 +40,6 @@ use C4::Auth qw( check_cookie_auth get_template_and_user ); use C4::Context; use C4::Output qw( output_with_http_headers is_ajax output_html_with_http_headers ); use C4::Scrubber; -use C4::Biblio qw( GetMarcBiblio ); -use C4::Items qw( GetItemsInfo ); use C4::Tags qw( add_tag get_approval_rows @@ -50,6 +48,7 @@ use C4::Tags qw( stratify_tags ); use C4::XSLT qw( XSLTParse4Display ); +use Koha::Biblios; use Koha::Logger; @@ -230,7 +229,6 @@ my $my_tags = []; if ($loggedinuser) { my $patron = Koha::Patrons->find( { borrowernumber => $loggedinuser } ); - $borcat = $patron ? $patron->categorycode : $borcat; my $rules = C4::Context->yaml_preference('OpacHiddenItems'); my $should_hide = ( $rules ) ? 1 : 0; $my_tags = get_tag_rows({borrowernumber=>$loggedinuser}); @@ -252,15 +250,17 @@ if ($loggedinuser) { foreach my $tag (@$my_tags) { $tag->{visible} = 0; my $biblio = Koha::Biblios->find( $tag->{biblionumber} ); - my $record = &GetMarcBiblio({ - biblionumber => $tag->{biblionumber}, - embed_items => 1, - opac => 1, - borcat => $borcat }); + my $record = $biblio->metadata->record( + { + embed_items => 1, + opac => 1, + patron => $patron, + } + ); next unless $record; my @hidden_items; if ($should_hide) { - my $items = $biblio->items; + my $items = $biblio->items->search_ordered; my @all_itemnumbers = $items->get_column('itemnumber'); my @items_to_show = $items->filter_by_visible_in_opac({ opac => 1, patron => $patron })->as_list; @hidden_items = array_minus( @all_itemnumbers, @items_to_show ); @@ -292,7 +292,7 @@ if ($loggedinuser) { xsl_syspref => 'OPACXSLTResultsDisplay', fix_amps => 1, hidden_items => \@hidden_items, - xslt_variables => $variables + xslt_variables => $variables, } );