From 01ec1e0a3d1964a50bbe47f8cb24b8c25f8131e1 Mon Sep 17 00:00:00 2001 From: "Joe Atzberger (siptest" Date: Tue, 16 Jun 2009 12:11:35 -0500 Subject: [PATCH] Expand interactive SIP tests. Also tweak interactive item dump to suppress huge fields (marc, marcxml). Signed-off-by: Galen Charlton --- C4/SIP/interactive_item_dump.pl | 30 ++++++++++++++++++++++++++++-- C4/SIP/interactive_members_dump.pl | 2 +- C4/SIP/interactive_patron_dump.pl | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/C4/SIP/interactive_item_dump.pl b/C4/SIP/interactive_item_dump.pl index ece250ef73..2fa0db2f6c 100755 --- a/C4/SIP/interactive_item_dump.pl +++ b/C4/SIP/interactive_item_dump.pl @@ -7,12 +7,38 @@ use strict; use ILS::Item; use Data::Dumper; +my $compare = (@ARGV) ? shift : 0; while (1) { print "Enter item barcode: "; my $in = <>; defined($in) or last; chomp($in); last unless $in; - my $patron = ILS::Item->new($in); - print Dumper($patron); + my $item = ILS::Item->new($in); + unless ($item) { + print "No item ($in)"; + next; + } + for (qw(marc marcxml)) { + $item->{$_} = 'suppressed...'; + } + my $queue = $item->hold_queue(); + print "Item ($in): ", Dumper($item); + print "hold_queue: ", Dumper($queue); + my $holdernumber; + if ($queue and scalar(@$queue)) { + $holdernumber = $queue->[0]->{borrowernumber}; + print "first borrowernumber: $holdernumber\n"; + } + if ($compare) { + print "Enter patron barcode: "; + my $barcode = <>; + defined($barcode) or next; + chomp($barcode); + next unless $barcode; + my $x = ILS::Item::_barcode_to_borrowernumber($barcode) || 'UNDEF'; + print " converts to: $x\n"; + printf " compares as: %s\n", + ($item->barcode_is_borrowernumber($barcode,$holdernumber) ? 'TRUE' : 'FALSE'); + } } diff --git a/C4/SIP/interactive_members_dump.pl b/C4/SIP/interactive_members_dump.pl index 8df6ea4f40..e477486886 100755 --- a/C4/SIP/interactive_members_dump.pl +++ b/C4/SIP/interactive_members_dump.pl @@ -15,7 +15,7 @@ while (1) { last unless $in; print "GetMember : \n", Dumper(GetMember($in, 'cardnumber')); my ($member) = GetMemberDetails(undef, $in); - my $flags = $member->{flags}; + my $flags = $member->{authflags}; print "GetMemberDetails (member) : \n", Dumper($member); print "GetMemberDetails ( flags) : \n", Dumper($flags); print "=" x 10, "\n"; diff --git a/C4/SIP/interactive_patron_dump.pl b/C4/SIP/interactive_patron_dump.pl index 557d2f704e..6788ce0364 100755 --- a/C4/SIP/interactive_patron_dump.pl +++ b/C4/SIP/interactive_patron_dump.pl @@ -14,5 +14,5 @@ while (1) { chomp($in); last unless $in; my $patron = ILS::Patron->new($in); - print Dumper($patron); + print "Patron ($in):\n", Dumper($patron); } -- 2.39.5