From aa6d9b1161913ba5e7bfb4884078d77face3b539 Mon Sep 17 00:00:00 2001
From: Jonathan Druart
Date: Fri, 3 Jun 2022 08:29:19 +0200
Subject: [PATCH] Bug 27272: Remove GetItemsInfo from tags/list.pl
Signed-off-by: Victor Grousset/tuxayo
---
koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt | 5 +++--
tags/list.pl | 8 +++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt
index cc25b9f11d..70904be156 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt
@@ -1,6 +1,7 @@
[% USE raw %]
[% USE Asset %]
[% USE AuthorisedValues %]
+[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( do_it ) %]Review[% ELSE %]Review tags[% END %] › Tags › Tools › Koha
@@ -64,9 +65,9 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
[% END %]
[% END %]
- [% IF ( title.items ) %][% FOREACH item IN title.items %]
+ [% IF ( title.items.count ) %][% FOREACH item IN title.items %]
-
- [% item.branchname | html %]
+ [% Branches.GetName(item.holdingbranch) | html %]
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
diff --git a/tags/list.pl b/tags/list.pl
index ac2ccbc8b1..95531f2a75 100755
--- a/tags/list.pl
+++ b/tags/list.pl
@@ -23,10 +23,11 @@ use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user );
use C4::Biblio qw( GetBiblioData );
use C4::Context;
-use C4::Items qw( GetItemsInfo );
use C4::Tags qw( get_tag_rows get_tags remove_tag );
use C4::Output qw( output_html_with_http_headers );
+use Koha::Items;
+
my $needed_flags = { tools => 'moderate_tags'
}; # FIXME: replace when more specific permission is created.
@@ -57,11 +58,12 @@ else {
if ($tag) {
my $taglist = get_tag_rows( { term => $tag } );
for ( @{$taglist} ) {
+ # FIXME We should use Koha::Biblio here
my $dat = &GetBiblioData( $_->{biblionumber} );
- my @items = GetItemsInfo( $_->{biblionumber} );
+ my $items = Koha::Items->search({ biblionumber => $dat->{biblionumber} });
$dat->{biblionumber} = $_->{biblionumber};
$dat->{tag_id} = $_->{tag_id};
- $dat->{items} = \@items;
+ $dat->{items} = $items;
$dat->{TagLoop} = get_tags(
{
biblionumber => $_->{biblionumber},
--
2.37.1
| |