Small template cleanup: display library name and cat description instead of codes
[koha_gimpoz] / tools / manage-marc-import.pl
index 9f93266..2501a6b 100755 (executable)
@@ -33,6 +33,7 @@ use C4::Biblio;
 use C4::ImportBatch;
 use C4::Matcher;
 use C4::BackgroundJob;
+use C4::Labels qw(add_batch);  
 
 my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
 
@@ -51,7 +52,7 @@ my ($template, $loggedinuser, $cookie)
                  query => $input,
                  type => "intranet",
                  authnotrequired => 0,
-                 flagsrequired => {parameters => 1},
+                 flagsrequired => {tools => 'manage_staged_marc'},
                  debug => 1,
                  });
 
@@ -132,8 +133,8 @@ sub redo_matching {
 sub create_labelbatch_from_importbatch {
        my ($batch_id) = @_;
        my @items = GetItemNumbersFromImportBatch($batch_id);
-       warn join("/",@items);
-       return 0; # dummy return until C4::Labels::add_batch() takes an array
+       my $labelbatch = add_batch('labels',\@items);
+       return $labelbatch; 
 }
 
 sub import_batches_list {