[Koha-cvs] CVS: koha/misc/migration_tools check_marc_definition.pl,1.1.2.1,1.1.2.2

Paul POULAIN tipaul at users.sourceforge.net
Thu Apr 7 14:01:00 CEST 2005


Update of /cvsroot/koha/koha/misc/migration_tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7172/misc/migration_tools

Modified Files:
      Tag: rel_2_2
	check_marc_definition.pl 
Log Message:
updating to deal with frameworkcodes.

Index: check_marc_definition.pl
===================================================================
RCS file: /cvsroot/koha/koha/misc/migration_tools/check_marc_definition.pl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** check_marc_definition.pl	1 Mar 2005 13:07:57 -0000	1.1.2.1
--- check_marc_definition.pl	7 Apr 2005 12:00:57 -0000	1.1.2.2
***************
*** 36,42 ****
--- 36,44 ----
  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") {
***************
*** 45,47 ****
--- 47,55 ----
  }
  
+ $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";





More information about the Koha-cvs mailing list