Bug 17600: Standardize our EXPORT_OK
[srvgit] / Koha / SuggestionEngine / Plugin / ExplodedTerms.pm
index c0c6166..0c4656e 100644 (file)
@@ -4,18 +4,18 @@ package Koha::SuggestionEngine::Plugin::ExplodedTerms;
 #
 # 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 <http://www.gnu.org/licenses>.
 
 =head1 NAME
 
@@ -31,9 +31,7 @@ subjects to subject searches.
 
 =cut
 
-use strict;
-use warnings;
-use Carp;
+use Modern::Perl;
 use C4::Templates qw(gettemplate); # This is necessary for translatability
 
 use base qw(Koha::SuggestionEngine::Base);
@@ -80,17 +78,15 @@ sub get_suggestions {
         'su-br',
         'su-rl'
     );
-    my $cgi = new CGI;
+    my $cgi = CGI->new;
     my $template = C4::Templates::gettemplate('text/explodedterms.tt', 'opac', $cgi);
     my @results;
     foreach my $index (@indexes) {
         my $thissearch = $search;
-        $thissearch = "$index=$thissearch"
-          unless ( $thissearch =~ s/OP!/$index=/g );
+        $thissearch = "$index:$thissearch"
+          unless ( $thissearch =~ s/OP!/$index:/g );
         $template->{VARS}->{index} = $index;
-        my $label = pack("U0a*", $template->output); #FIXME: C4::Templates is
-        # returning incorrectly-marked UTF-8. This fixes the problem, but is
-        # an annoying workaround.
+        my $label = $template->output;
         push @results,
         {
             'search'  => $thissearch,