From 50047399754873c79013fbe967e878b6ddcba949 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 7 Apr 2005 12:00:57 +0000 Subject: [PATCH] updating to deal with frameworkcodes. --- misc/migration_tools/check_marc_definition.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/migration_tools/check_marc_definition.pl b/misc/migration_tools/check_marc_definition.pl index 6fc0491985..76c37c0574 100755 --- a/misc/migration_tools/check_marc_definition.pl +++ b/misc/migration_tools/check_marc_definition.pl @@ -35,13 +35,21 @@ my $dbh = C4::Context->dbh; print "Checking\n"; my $sth = $dbh->prepare("SELECT count(*), tag, subfieldcode, frameworkcode FROM marc_subfield_table, marc_biblio WHERE marc_biblio.bibid = marc_subfield_table.bibid group by frameworkcode,tag,subfieldcode"); $sth->execute; +my %tags; my $sth2 = $dbh->prepare("select tab,liblibrarian,kohafield from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?"); while (my ($total,$tag,$subfield,$frameworkcode) = $sth->fetchrow) { $sth2->execute($tag,$subfield,$frameworkcode); + $tags{$frameworkcode." / ".$tag." / ".$subfield} ++; my ($tab,$liblibrarian,$kohafield) = $sth2->fetchrow; if ($tab eq -1 && $kohafield ne "biblio.biblionumber" && $kohafield ne "biblioitems.biblioitemnumber" && $kohafield ne "items.itemnumber") { print "Tab ignore for framework $frameworkcode, $tag\$$subfield - $liblibrarian (used $total times)\n"; } } +$sth = $dbh->prepare("select frameworkcode,tagfield,tagsubfield from marc_subfield_structure where tab<>-1 order by frameworkcode,tagfield,tagsubfield"); +$sth->execute; +print "===================\n"; +while (my ($frameworkcode,$tag,$subfield) = $sth->fetchrow) { + print "$tag, $subfield in framework $frameworkcode is active, but never filled\n" unless $tags{$frameworkcode." / ".$tag." / ".$subfield}; +} print "Done\n"; -- 2.39.5