3 # This script should be used only with UNIMARC flavour
4 # It is designed to report some missing information from biblio
12 eval { require "$FindBin::Bin/../kohalib.pl" };
19 my $dbh = C4::Context->dbh;
21 my $biblio = GetMarcBiblio($id);
23 if(!$biblio->field('099'))
25 $field = new MARC::Field('099','','',
28 $biblio->add_fields($field);
31 $field = $biblio->field('099');
33 my $sth = $dbh->prepare("SELECT DATE_FORMAT(datecreated,'%Y-%m-%d') as datecreated,
34 DATE_FORMAT(timestamp,'%Y-%m-%d') as timestamp,
37 WHERE biblionumber = ?");
39 (my $bibliorow = $sth->fetchrow_hashref);
40 my $frameworkcode = $bibliorow->{'frameworkcode'};
42 $field->update( 'c' => $bibliorow->{'datecreated'},
43 'd' => $bibliorow->{'timestamp'}
46 if(&ModBiblio($biblio, $id, $frameworkcode))
55 my $dbh = C4::Context->dbh;
57 my $sth = $dbh->prepare("SELECT biblionumber FROM biblio");
60 while(my $biblios = $sth->fetchrow_hashref)
62 updateMarc($biblios->{'biblionumber'});
68 if (lc(C4::Context->preference('marcflavour')) eq "unimarc"){
72 print "this script is UNIMARC only and should be used only on unimarc databases";