3 # Copyright 2011 Athens County Public Libraries
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 use C4::Auth qw(:DEFAULT check_cookie_auth);
27 use C4::Dates qw(format_date);
30 use C4::Tags 0.03 qw(get_tags remove_tag get_tag_rows);
33 my $needed_flags = { tools => 'moderate_tags'
34 }; # FIXME: replace when more specific permission is created.
37 my $op = $query->param('op') || '';
38 my $biblionumber = $query->param('biblionumber');
39 my $tag = $query->param('tag');
40 my $tag_id = $query->param('tag_id');
42 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
44 template_name => "tags/list.tmpl",
49 flagsrequired => $needed_flags,
55 print $query->redirect("/cgi-bin/koha/tags/list.pl?tag=$tag");
59 my $marcflavour = C4::Context->preference('marcflavour');
63 my $taglist = get_tag_rows( { term => $tag } );
65 my $dat = &GetBiblioData( $_->{biblionumber} );
66 my $record = &GetMarcBiblio( $_->{biblionumber} );
68 GetRecordValue( 'subtitle', $record,
69 GetFrameworkCode( $_->{biblionumber} ) );
70 my @items = GetItemsInfo( $_->{biblionumber} );
71 $dat->{biblionumber} = $_->{biblionumber};
72 $dat->{tag_id} = $_->{tag_id};
73 $dat->{items} = \@items;
74 $dat->{TagLoop} = get_tags(
76 biblionumber => $_->{biblionumber},
81 push( @results, $dat );
84 my $resultsarray = \@results;
88 titles => $resultsarray,
93 output_html_with_http_headers $query, $cookie, $template->output;