From 57c2ea0a260807c60021ffd269c8c7d536b99e5a Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 25 Aug 2006 05:17:02 +0000 Subject: [PATCH] import fixups git-svn-id: svn://svn.open-ils.org/ILS/trunk@5667 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/src/extras/import/legacy_bill.sql | 2 ++ Evergreen/src/extras/import/legacy_circ.sql | 2 +- Evergreen/src/extras/import/parse_patron_xml.pl | 17 ++++++++++++----- Open-ILS/examples/fm_IDL.xml | 2 +- Open-ILS/src/sql/Pg/005.schema.actors.sql | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Evergreen/src/extras/import/legacy_bill.sql b/Evergreen/src/extras/import/legacy_bill.sql index 33bb810dcc..6cd529f5bb 100644 --- a/Evergreen/src/extras/import/legacy_bill.sql +++ b/Evergreen/src/extras/import/legacy_bill.sql @@ -24,3 +24,5 @@ INSERT INTO money.billing (xact,billing_ts,amount,billing_type,note) JOIN actor.org_unit ou ON (lb.library = ou.shortname) LEFT JOIN biblio.record_entry br ON (lb.cat_key = br.id) WHERE lb.paid IS FALSE; + +COMMIT; diff --git a/Evergreen/src/extras/import/legacy_circ.sql b/Evergreen/src/extras/import/legacy_circ.sql index b6e08575d5..8605c536a4 100644 --- a/Evergreen/src/extras/import/legacy_circ.sql +++ b/Evergreen/src/extras/import/legacy_circ.sql @@ -17,7 +17,7 @@ ARL 100.00 ECGRL 100.00 \. -CREATE TABLE legacy_type_circ_map (lib text, max_fine numeric(6,2), renewals int); +CREATE TABLE legacy_type_circ_map (item_type text, recuring_fine numeric(6,2), renewals int); COPY legacy_type_circ_map (item_type, recuring_fine, renewals) FROM STDIN; ART 0.10 0 ATLAS 0.50 2 diff --git a/Evergreen/src/extras/import/parse_patron_xml.pl b/Evergreen/src/extras/import/parse_patron_xml.pl index f29936c9bb..6b7f038687 100755 --- a/Evergreen/src/extras/import/parse_patron_xml.pl +++ b/Evergreen/src/extras/import/parse_patron_xml.pl @@ -17,7 +17,7 @@ use Time::HiRes qw/time/; use XML::LibXML; my ($file,$config,$profileid,$identtypeid,$default_profile,$profile_map,$usermap) = - ('return_file_0623-2.xml', '/openils/conf/bootstrap.conf', 1, 1, 1, 'profile.map'); + ('return_file_0623-2.xml', '/openils/conf/bootstrap.conf', 1, 3, 'User', 'profile.map'); GetOptions( 'usermap=s' => \$usermap, @@ -112,17 +112,18 @@ for my $patron ( $doc->documentElement->childNodes ) { $p->usrname( $bc ); $p->passwd( $patron->findvalue( 'user_pin' ) ); - my $new_profile = $p_map{$old_profile}; - unless ($new_profile) { + my $new_profile = $p_map{$old_profile} || $default_profile; + + $p->profile( $$profiles{$new_profile} ); + if (!$p->profile) { $count++; next; } - $p->profile( $$profiles{$new_profile} || $default_profile ); - # some defaults $p->standing(1); $p->active('t'); + $p->deleted('f'); $p->master_account('f'); $p->super_user('f'); $p->usrgroup($uid); @@ -182,6 +183,7 @@ for my $patron ( $doc->documentElement->childNodes ) { my @addresses; my $mailing_addr_id = $patron->findvalue( 'user_mailingaddr' ); + my $all_valid = 't'; for my $addr ( $patron->findnodes( "Address" ) ) { if (!$p->email) { $p->email( $patron->findvalue( 'email' ) ); @@ -221,6 +223,7 @@ for my $patron ( $doc->documentElement->childNodes ) { push @addresses, $a; if ($prefix eq 'coa_') { + $all_valid = 'f'; $prefix = 'std_'; $line1 = $addr->findvalue( "${prefix}line1" ); @@ -248,6 +251,10 @@ for my $patron ( $doc->documentElement->childNodes ) { } } + if ($all_valid eq 'f') { + $_->valid('f') for (@addresses); + } + my @notes; for my $note_field ( qw#note comment voter bus_school Address/phone1 Address/phone2# ) { for my $note ( $patron->findnodes( $note_field) ) { diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 823f22477a..0b9007a963 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -628,7 +628,7 @@ - + diff --git a/Open-ILS/src/sql/Pg/005.schema.actors.sql b/Open-ILS/src/sql/Pg/005.schema.actors.sql index d42ffc4407..b180840292 100644 --- a/Open-ILS/src/sql/Pg/005.schema.actors.sql +++ b/Open-ILS/src/sql/Pg/005.schema.actors.sql @@ -50,7 +50,7 @@ CREATE TABLE actor.usr ( mailing_address INT, billing_address INT, home_ou INT NOT NULL, - dob TIMESTAMP WITH TIME ZONE NOT NULL, + dob TIMESTAMP WITH TIME ZONE, active BOOL NOT NULL DEFAULT TRUE, master_account BOOL NOT NULL DEFAULT FALSE, super_user BOOL NOT NULL DEFAULT FALSE, -- 2.43.2