From: Jason Etheridge Date: Tue, 19 Aug 2008 06:07:11 +0000 (+0000) Subject: handle main card inactive X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=850e56526767cb1cfb9aa23883f5188afb620b57 handle main card inactive --- diff --git a/unicorn_patron_xml2text.pl b/unicorn_patron_xml2text.pl index fcaaedf..4df8e75 100755 --- a/unicorn_patron_xml2text.pl +++ b/unicorn_patron_xml2text.pl @@ -110,10 +110,14 @@ for my $patron ( $doc->documentElement->childNodes ) { my $inactive_barcode1 = ''; my $inactive_barcode2 = ''; + my $userid_active = 't'; my @barcodes = $patron->findnodes( "barcodes" ); for my $i_bc ( $barcodes[0]->findnodes( "barcode" ) ) { my $active = $i_bc->getAttribute('active'); - if ($active eq "0") { + if ($active eq "0" && $i_bc->textContent eq $bc) { + $userid_active = 'f'; + } + if ($active eq "0" && $i_bc->textContent ne $bc) { if (! $inactive_barcode1 ) { $inactive_barcode1 = $i_bc->textContent; } else { @@ -125,7 +129,7 @@ for my $patron ( $doc->documentElement->childNodes ) { } } } - print STDOUT "$inactive_barcode1\t$inactive_barcode2"; + print STDOUT "$userid_active\t$inactive_barcode1\t$inactive_barcode2"; print STDOUT "\n"; $count++;