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 return unless $biblio;
25 if(!$biblio->field('099'))
27 $field = new MARC
::Field
('099','','',
30 $biblio->add_fields($field);
33 $field = $biblio->field('099');
35 my $sth = $dbh->prepare("SELECT DATE_FORMAT(datecreated,'%Y-%m-%d') as datecreated,
36 DATE_FORMAT(timestamp,'%Y-%m-%d') as timestamp,
39 WHERE biblionumber = ?");
41 (my $bibliorow = $sth->fetchrow_hashref);
42 my $frameworkcode = $bibliorow->{'frameworkcode'};
44 $field->update( 'c' => $bibliorow->{'datecreated'},
45 'd' => $bibliorow->{'timestamp'}
48 if(&ModBiblio
($biblio, $id, $frameworkcode))
57 my $dbh = C4
::Context
->dbh;
59 my $sth = $dbh->prepare("SELECT biblionumber FROM biblio");
62 while(my $biblios = $sth->fetchrow_hashref)
64 updateMarc
($biblios->{'biblionumber'});
70 if (lc(C4
::Context
->preference('marcflavour')) eq "unimarc"){
74 print "this script is UNIMARC only and should be used only on unimarc databases\n";