Bug 18389: (QA follow-up) Fix tabs, note used template, info on verbose
authorNick Clemens <nick@bywatersolutions.com>
Thu, 26 Oct 2017 10:46:03 +0000 (10:46 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 27 Oct 2017 17:10:29 +0000 (14:10 -0300)
Fixed whitespace for QA tools
Added a verbose note when template found
Only print 'Modifying MARC' if verbose

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
misc/migration_tools/bulkmarcimport.pl

index e444558..9a3b44c 100755 (executable)
@@ -122,19 +122,21 @@ if(defined $localcust) { #local customize module
 if($marc_mod_template ne '') {
     my @templates = GetModificationTemplates();
     foreach my $this_template (@templates) {
-       if($this_template->{'name'} eq $marc_mod_template) {
-           if($marc_mod_template_id < 0) {
-               $marc_mod_template_id = $this_template->{'template_id'};
-           } else {
-               print "WARNING: MARC modification template name " .
-                   "'$marc_mod_template' matches multiple templates. " .
-                   "Please rename these templates\n";
-               exit 1;
-           }
-       }
+        if($this_template->{'name'} eq $marc_mod_template) {
+            if($marc_mod_template_id < 0) {
+                $marc_mod_template_id = $this_template->{'template_id'};
+            } else {
+                print "WARNING: MARC modification template name " .
+                "'$marc_mod_template' matches multiple templates. " .
+                "Please rename these templates\n";
+                exit 1;
+            }
+        }
     }
     if($marc_mod_template_id < 0) {
-       die "Can't located MARC modification template '$marc_mod_template'\n";
+        die "Can't located MARC modification template '$marc_mod_template'\n";
+    } else {
+        print "Records will be modified using MARC modofication template: $marc_mod_template\n" if $verbose;
     }
 }
 
@@ -288,7 +290,7 @@ RECORD: while (  ) {
     }
     SetUTF8Flag($record);
     if($marc_mod_template_id > 0) {
-    print "Modifying MARC\n";
+    print "Modifying MARC\n" if $verbose;
     ModifyRecordWithTemplate( $marc_mod_template_id, $record );
     }
     &$localcust($record) if $localcust;