Bug 13189 - Patron card creator patron search browse by last name broken by extended...
[koha.git] / patroncards / image-manage.pl
index f9f7eac..d72c655 100755 (executable)
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use CGI;
+use CGI qw ( -utf8 );
 use Graphics::Magick;
 use POSIX qw(ceil);
 use autouse 'Data::Dumper' => qw(Dumper);
@@ -18,7 +18,7 @@ use C4::Patroncards;
 my $cgi = CGI->new;
 
 my ($template, $loggedinuser, $cookie) = get_template_and_user({
-                    template_name       => "patroncards/image-manage.tmpl",
+                    template_name       => "patroncards/image-manage.tt",
                     query               => $cgi,
                     type                => "intranet",
                     authnotrequired     => 0,
@@ -54,8 +54,7 @@ if ($op eq 'upload') {
             SOURCE_FILE => $source_file,
             IMAGE_NAME => $image_name,
             TABLE => $table,
-            error => 1,
-            $errstr => 1,
+            error => $errstr,
         );
     }
     else {
@@ -69,8 +68,7 @@ if ($op eq 'upload') {
                 SOURCE_FILE => $source_file,
                 IMAGE_NAME => $image_name,
                 TABLE => $table,
-                error => 1,
-                $errstr => 1,
+                error => $errstr,
             );
         }
         else {
@@ -87,8 +85,7 @@ if ($op eq 'upload') {
                     SOURCE_FILE => $source_file,
                     IMAGE_NAME => $image_name,
                     TABLE => $table,
-                    error => 1,
-                    $errstr => 1,
+                    error => $errstr,
                     image_limit => $image_limit,
                 );
             }
@@ -120,8 +117,7 @@ elsif ($op eq 'delete') {
             DELETE_SUCCESSFULL => 0,
             IMAGE_IDS => join(', ', @image_ids),
             TABLE => $table,
-            error => 1,
-            $errstr => 1,
+            error => $errstr,
             image_ids => join(',',@image_ids),
         );
     }
@@ -149,8 +145,7 @@ else { # to trap unsupported operations
         SOURCE_FILE => $source_file,
         IMAGE_NAME => $image_name,
         TABLE => $table,
-        error => 1,
-        $errstr => 1,
+        error => $errstr,
     );
 }