Bug 18309: Add UNIMARC field 214 and its subfields
[koha.git] / misc / maintenance / UNIMARC_fix_collectiontitle.pl
blob4a97c18e5621b75c89ae0d6e269586ee580b0cb6
1 #!/usr/bin/perl
3 # This script should be used only with UNIMARC flavour
4 # It is designed to report some missing information from biblio
5 # table into marc data
7 use strict;
8 use warnings;
10 BEGIN {
11 use FindBin;
12 eval { require "$FindBin::Bin/../kohalib.pl" };
15 use Koha::Script;
16 use C4::Biblio;
18 sub process {
20 my $dbh = C4::Context->dbh;
22 my $sth = $dbh->prepare(qq{UPDATE marc_subfield_structure SET kohafield='biblioitems.collectiontitle' where kohafield='biblio.seriestitle' and not tagfield like "4__"});
23 return $sth->execute();
28 if (lc(C4::Context->preference('marcflavour')) eq "unimarc"){
29 print "count subfields changed :".process()." kohafields biblio.seriestitle changed into biblioitems.collectiontitle";
31 else {
32 print "this script is UNIMARC only and should be used only on unimarc databases\n";