X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-tags_subject.pl;h=8af9c29ad4d89bf87b46fe988d069bf9b2c7dd6c;hb=9d6d641d1f8b77271800f43bc027b651f9aea52b;hp=a19f406db9dbc3ef01c3b3006b618607d4287922;hpb=3f35705ddcc3eff0df658faf12320a6e8671b668;p=srvgit diff --git a/opac/opac-tags_subject.pl b/opac/opac-tags_subject.pl index a19f406db9..8af9c29ad4 100755 --- a/opac/opac-tags_subject.pl +++ b/opac/opac-tags_subject.pl @@ -4,18 +4,18 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . =head1 opac-tags_subject.pl @@ -24,35 +24,31 @@ TODO :: Description here =cut -use strict; -use warnings; +use Modern::Perl; -use C4::Auth; +use C4::Auth qw( get_template_and_user ); use C4::Context; -use C4::Output; -use CGI; -use C4::Biblio; -use C4::Koha; # use getitemtypeinfo +use C4::Output qw( output_html_with_http_headers ); +use CGI qw ( -utf8 ); -my $query = new CGI; +my $query = CGI->new; my $dbh = C4::Context->dbh; # open template my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "opac-tags_subject.tmpl", + template_name => "opac-tags_subject.tt", query => $query, type => "opac", authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), - debug => 1, } ); my $number = $query->param('number') || 100; -my $sth = $dbh->prepare("SELECT entry,weight FROM tags ORDER BY weight DESC LIMIT $number"); -$sth->execute; +my $sth = $dbh->prepare("SELECT entry,weight FROM tags ORDER BY weight DESC LIMIT ?"); +$sth->execute($number); my %result; my $max=0;