From 4c164ad88defe592ee26559dea8eb722cec3c597 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 4 Aug 2006 04:37:49 +0000 Subject: [PATCH] data cleansing git-svn-id: svn://svn.open-ils.org/ILS/trunk@5275 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/extras/import/drain-batgirl-bill.pl | 2 ++ Evergreen/src/extras/import/parse_patron_xml.pl | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Evergreen/src/extras/import/drain-batgirl-bill.pl b/Evergreen/src/extras/import/drain-batgirl-bill.pl index a5cb3a8890..82f4814741 100755 --- a/Evergreen/src/extras/import/drain-batgirl-bill.pl +++ b/Evergreen/src/extras/import/drain-batgirl-bill.pl @@ -33,5 +33,7 @@ while (my $cn = $sth->fetchrow_hashref) { } print "\\.\n"; +print "CREATE INDEX lb_bk1_idx ON legacy_bill (bill_key1);\n"; +print "CREATE INDEX lb_usr_idx ON legacy_bill (user_key);\n"; diff --git a/Evergreen/src/extras/import/parse_patron_xml.pl b/Evergreen/src/extras/import/parse_patron_xml.pl index 650c349464..5085fdb1bd 100755 --- a/Evergreen/src/extras/import/parse_patron_xml.pl +++ b/Evergreen/src/extras/import/parse_patron_xml.pl @@ -137,9 +137,19 @@ for my $patron ( $doc->documentElement->childNodes ) { my $id_val = $patron->findvalue( 'user_altid' ); $p->ident_value( $id_val ) if ($id_val); - $p->first_given_name( $patron->findvalue( 'first_name' ) ); - $p->second_given_name( $patron->findvalue( 'middle_name' ) ); - $p->family_name( $patron->findvalue( 'last_name' ) ); + my ($fname,$mname,$lname) = ($patron->findvalue('first_name'),$patron->findvalue('middle_name'),$patron->findvalue('last_name')); + + $fname =~ s/^\s*//o; + $mname =~ s/^\s*//o; + $lname =~ s/^\s*//o; + + $fname =~ s/\s*$//o; + $mname =~ s/\s*$//o; + $lname =~ s/\s*$//o; + + $p->first_given_name( $fname ); + $p->second_given_name( $mname ); + $p->family_name( $lname ); $p->day_phone( $patron->findvalue( 'Address/dayphone' ) ); $p->evening_phone( $patron->findvalue( 'Address/homephone' ) ); @@ -242,6 +252,7 @@ for my $patron ( $doc->documentElement->childNodes ) { my $a = new Fieldmapper::actor::usr_note; $a->creator(1); + $a->create_date('now'); $a->usr( $uid ); $a->title( "Legacy ".$note->localName ); $a->value( $note->textContent ); -- 2.43.2