0577878e91b10fd0b29c7725f955f84e9d021f1a
[koha.git] / misc / maintenance / UNIMARC_fix_collectiontitle.pl
1 #!/usr/bin/perl
2 #
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
6 #
7 use strict;
8 use warnings;
9
10 use Koha::Script;
11
12 sub process {
13
14     my $dbh = C4::Context->dbh;
15
16     my $sth = $dbh->prepare(qq{UPDATE marc_subfield_structure SET kohafield='biblioitems.collectiontitle' where kohafield='biblio.seriestitle' and not tagfield like "4__"});
17     return $sth->execute();
18
19
20 }
21
22 if (lc(C4::Context->preference('marcflavour')) eq "unimarc"){
23 print "count subfields changed :".process()." kohafields biblio.seriestitle changed into biblioitems.collectiontitle";
24
25 else {
26         print "this script is UNIMARC only and should be used only on unimarc databases\n";
27 }