Bug 32855: Fix cataloguing/value_builder/unimarc_field_126b.pl
[srvgit] / patroncards / edit-batch.pl
index 990642e..dbb3d9c 100755 (executable)
 
 
 use Modern::Perl;
-use vars qw($debug);
 
 use CGI qw ( -utf8 );
 use autouse 'Data::Dumper' => qw(Dumper);
 
-use C4::Auth qw(get_template_and_user);
-use C4::Output qw(output_html_with_http_headers);
-use C4::Creators;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
+use C4::Creators qw( get_card_summary html_table );
 use C4::Patroncards;
 use Koha::Patrons;
 
-my $cgi = new CGI;
+my $cgi = CGI->new;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
         template_name   => "patroncards/edit-batch.tt",
         query           => $cgi,
         type            => "intranet",
-        flagsrequired   => { catalogue => 1 },
-        debug           => 1,
+        flagsrequired   => { tools => 'label_creator' },
     }
 );
 
@@ -63,6 +61,13 @@ my $errstr = $cgi->param('error') || '';
 my $bor_num_list = $cgi->param('bor_num_list') || undef;
 my $branch_code = C4::Context->userenv->{'branch'};
 
+my @errors = ( 'pdferr', 'errnocards', 'errba', 'errpl', 'errpt', 'errlo', 'errtpl', );
+foreach my $param (@errors) {
+    my $error = $cgi->param($param) ? 1 : 0;
+    $template->param( 'error_' . $param => $error )
+      if $error;
+}
+
 if ($op eq 'remove') {
     $batch = C4::Patroncards::Batch->retrieve(batch_id => $batch_id);
     foreach my $label_id (@label_ids) {