Bug 5347: Followup Adds columns claims_count and claimed_date in aqorders
[koha_gimpoz] / misc / link_bibs_to_authorities.pl
index 1cb0483..0fc9c26 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
+use warnings;
 BEGIN {
     # find Koha's Perl modules
     # test carefully before changing this
@@ -85,6 +86,11 @@ sub process_bib {
             print "Bib $biblionumber ($title): $headings_changed headings changed\n";
         }
         if (not $test_only) {
+            # delete any item tags
+            my ($itemtag, $itemsubfield) = GetMarcFromKohaField("items.itemnumber", '');
+            foreach my $field ($bib->field($itemtag)) {
+                $bib->delete_field($field);
+            }
             ModBiblio($bib, $biblionumber, GetFrameworkCode($biblionumber));
             $num_bibs_modified++;
         }
@@ -111,10 +117,6 @@ Parameters:
     --test                  only test the authority linking
                             and report the results; do not
                             change the bib records.
-    --comment <comment>     optional comment to describe
-                            the record batch; if the comment
-                            has spaces in it, surround the
-                            comment with quotation marks.
     --help or -h            show this message.
 _USAGE_
 }