Expand interactive SIP tests.
authorJoe Atzberger (siptest <atz4sip@arwen.metavore.com>
Tue, 16 Jun 2009 17:11:35 +0000 (12:11 -0500)
committerGalen Charlton <galen.charlton@liblime.com>
Wed, 17 Jun 2009 16:42:44 +0000 (11:42 -0500)
Also tweak interactive item dump to suppress huge fields (marc, marcxml).

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/SIP/interactive_item_dump.pl
C4/SIP/interactive_members_dump.pl
C4/SIP/interactive_patron_dump.pl

index ece250e..2fa0db2 100755 (executable)
@@ -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');
+    }
 }
index 8df6ea4..e477486 100755 (executable)
@@ -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";
index 557d2f7..6788ce0 100755 (executable)
@@ -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);
 }