[Koha-cvs] koha/acqui.simple addbiblio.pl [dev_week]
Joshua Ferraro
jmf at kados.org
Sat Oct 7 21:51:45 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Joshua Ferraro <kados> 06/10/07 19:51:45
Modified files:
acqui.simple : addbiblio.pl
Log message:
redirect to cataloging
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui.simple/addbiblio.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.52.2.40.2.11&r2=1.52.2.40.2.12
Patches:
Index: addbiblio.pl
===================================================================
RCS file: /sources/koha/koha/acqui.simple/Attic/addbiblio.pl,v
retrieving revision 1.52.2.40.2.11
retrieving revision 1.52.2.40.2.12
diff -u -b -r1.52.2.40.2.11 -r1.52.2.40.2.12
--- addbiblio.pl 6 Oct 2006 03:06:32 -0000 1.52.2.40.2.11
+++ addbiblio.pl 7 Oct 2006 19:51:45 -0000 1.52.2.40.2.12
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: addbiblio.pl,v 1.52.2.40.2.11 2006/10/06 03:06:32 kados Exp $
+# $Id: addbiblio.pl,v 1.52.2.40.2.12 2006/10/07 19:51:45 kados Exp $
# Copyright 2000-2002 Katipo Communications
#
@@ -94,7 +94,26 @@
$sth->execute($id);
my ($file,$marc,$encoding) = $sth->fetchrow;
if ($marc) {
- my $record = MARC::File::USMARC::decode($marc);
+ my $record = MARC::Record->new_from_usmarc($marc);
+ #my $record = MARC::File::USMARC::decode($marc);
+
+ my @warnings = $record->warnings();
+ foreach my $warning (@warnings) {
+ warn "WARNING".$warning;
+ }
+
+ my $marcxml = $record->as_xml_record("UTF-8");
+ #warn "MARCXML:".$marcxml;
+ my $marcxml_entity_encoded;
+ use Unicode::Normalize;
+ foreach my $line (split(/\n/, $marcxml)) {
+ my $nfc_string = NFC($line);
+ $nfc_string =~s/([\x{0080}-\x{fffd}])/sprintf('&#x%X;',ord($1))/sgoe;
+ $marcxml_entity_encoded .= $nfc_string."\n";
+ }
+ #warn $marcxml_entity_encoded;
+ $record=MARC::Record->new_from_xml($marcxml_entity_encoded,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
+
if (ref($record) eq undef) {
return -1;
} else {
@@ -116,7 +135,7 @@
$field=MARC::Field->new($tag,"","",$subfieldcode=>$subfieldvalue) if ($subfieldcode ne $subfield);
}
}
- warn $field->as_formatted;
+# warn $field->as_formatted;
# }
}
$record->delete_field($record->field($tag));
@@ -570,16 +589,17 @@
oldbiblionumtagsubfield => $oldbiblionumtagsubfield,
oldbiblioitemnumtagfield => $oldbiblioitemnumtagfield,
oldbiblioitemnumtagsubfield => $oldbiblioitemnumtagsubfield,
- oldbiblioitemnumber => $oldbiblioitemnumber );
+ oldbiblioitemnumber => $oldbiblioitemnumber
+ );
} elsif ($op eq "delete") {
#------------------------------------------------------------------------------------------------------------------------------
my $error = &DelBiblio($dbh,$biblionumber);
- if ($error != 1) {
+ if ($error) {
print "Content-Type: text/html\n\n$error";
}
else {
- print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=/cgi-bin/koha/search.marc/search.pl?type=intranet\"></html>";
+ print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl");
}
exit;
#------------------------------------------------------------------------------------------------------------------------------
More information about the Koha-cvs
mailing list