misc subdir - Dates.pm integration and warnings fixes.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joe Atzberger 2007-12-04 17:40:56 -06:00 committed by Joshua Ferraro
parent 82b8c496fd
commit 28159f04de
6 changed files with 41 additions and 41 deletions

View file

@ -1,6 +1,6 @@
use strict;
use C4::Context;
use C4::Date;
use C4::Dates;
use Mail::Sendmail; # comment out if not doing e-mail notices
use Getopt::Long;
use C4::Circulation;

View file

@ -31,7 +31,7 @@
use strict;
use C4::Context;
use C4::Date;
use C4::Dates;
use Mail::Sendmail; # comment out if not doing e-mail notices
use Getopt::Long;

View file

@ -36,7 +36,7 @@
use strict;
use C4::Context;
use C4::Date;
use C4::Dates;
use Mail::Sendmail; # comment out if not doing e-mail notices
use Getopt::Long;

View file

@ -32,7 +32,7 @@ use C4::Search;
use C4::Circulation;
use C4::Circulation::Fines;
use C4::Members;
use C4::Date;
use C4::Dates;
use HTML::Template::Pro;
use Mail::Sendmail;
use Mail::RFC822::Address;

View file

@ -31,56 +31,56 @@ SAMPLE :
\t\$ perl misc/marcimport_to_biblioitems.pl -file /home/jmf/koha.mrc
EOF
;#'
die;
die;
}
my $starttime = gettimeofday;
my $timeneeded;
my $dbh = C4::Context->dbh;
my $sth2=$dbh->prepare("update biblioitems set marc=? where biblionumber=?");
my $i=0;
my $batch = MARC::Batch->new( 'USMARC', $input_marc_file );
$batch->warnings_off();
$batch->strict_off();
my $i=0;
my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
my $i=0;
while ( my $record = $batch->next() ) {
my $biblionumber=$record->field($tagfield)->subfield($biblionumtagsubfield);
$i++;
$sth2->execute($record->as_usmarc,$biblionumber) if $biblionumber;
print "$biblionumber \n";
my $biblionumber=$record->field($tagfield)->subfield($biblionumtagsubfield);
$i++;
$sth2->execute($record->as_usmarc,$biblionumber) if $biblionumber;
print "$biblionumber \n";
}
$timeneeded = gettimeofday - $starttime ;
print "$i records in $timeneeded s\n" ;
print "$i records in $timeneeded s\n" ;
END;
sub search{
my ($query)=@_;
my $nquery="\ \@attr 1=1007 ".$query;
my $oAuth=C4::Context->Zconn("biblioserver");
if ($oAuth eq "error"){
warn "Error/CONNECTING \n";
return("error",undef);
# IS THIS SUPPOSED TO BE __END__ ?? If not, then what is it? --JBA
sub search {
my ($query)=@_;
my $nquery="\ \@attr 1=1007 ".$query;
my $oAuth=C4::Context->Zconn("biblioserver");
if ($oAuth eq "error"){
warn "Error/CONNECTING \n";
return("error",undef);
}
my $oAResult;
my $Anewq= new ZOOM::Query::PQF($nquery);
eval {
$oAResult= $oAuth->search_pqf($nquery) ;
};
if($@){
warn " /Cannot search:", $@->code()," /MSG:",$@->message(),"\n";
return("error",undef);
}
my $authrecord;
my $nbresults="0";
$nbresults=$oAResult->size();
if ($nbresults eq "1" ){
my $rec=$oAResult->record(0);
my $marcdata=$rec->raw();
$authrecord = MARC::File::USMARC::decode($marcdata);
}
return ($authrecord,$nbresults);
}
my $oAResult;
my $Anewq= new ZOOM::Query::PQF($nquery);
eval {
$oAResult= $oAuth->search_pqf($nquery) ;
};
if($@){
warn " /Cannot search:", $@->code()," /MSG:",$@->message(),"\n";
return("error",undef);
}
my $authrecord;
my $nbresults="0";
$nbresults=$oAResult->size();
if ($nbresults eq "1" ){
my $rec=$oAResult->record(0);
my $marcdata=$rec->raw();
$authrecord = MARC::File::USMARC::decode($marcdata);
}
return ($authrecord,$nbresults);
}

View file

@ -106,11 +106,11 @@ while (my ($bibid,$tag,$tag_indicator,$tagorder,$subfieldcode,$subfieldorder) =
&MARCaddsubfield($bibid,$tag,$tag_indicator,$tagorder,$subfield->[0],$subfieldorder,$subfield->[1]);
}
&MARCaddsubfield($bibid,$tag,$tag_indicator,$tagorder,'9',$subfieldorder,$mergeto);
my $biblio = GetMarcBiblio($bibid);
$biblio = GetMarcBiblio($bibid);
print "AFTER : ".$biblio->as_formatted."\n" if $verbose;
$nbdone++;
# &MARCdelsubfield($dbh,$bibid,$tag,$tagorder,$subfieldcode,$subfieldorder);
}
my $timeneeded = gettimeofday - $starttime;
print "$nbdone authorities done in $timeneeded seconds" unless $noconfirm;
print "$nbdone authorities done in $timeneeded seconds" unless $noconfirm;