[Koha-patches] [PATCH] Return barcode as Sip hold_patron_id

Colin Campbell colin.campbell at ptfs-europe.com
Sun Sep 6 11:53:21 CEST 2009


Behave consistently with other patron_ids as many sip clients
use this in a subsequent patron information or patron status request
---
 C4/SIP/ILS/Item.pm    |   13 +++++++++++++
 C4/SIP/Sip/MsgType.pm |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm
index 7e6fac9..2e02c63 100644
--- a/C4/SIP/ILS/Item.pm
+++ b/C4/SIP/ILS/Item.pm
@@ -175,6 +175,19 @@ sub hold_patron_name {
     # $self->{hold_patron_name} = $name;      # TODO: consider caching
     return $name;
 }
+
+sub hold_patron_bcode {
+    my $self = shift or return;
+    my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return;
+    my $holder = GetMember($borrowernumber, 'borrowernumber');
+    if ($holder) {
+        if ($holder->{cardnumber}) {
+            return $holder->{cardnumber};
+        }
+    }
+    return;
+}
+
 sub destination_loc {
     my $self = shift or return;
     my $hold = $self->next_hold();
diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm
index f04d162..67ccc21 100644
--- a/C4/SIP/Sip/MsgType.pm
+++ b/C4/SIP/Sip/MsgType.pm
@@ -676,7 +676,7 @@ sub handle_checkin {
             $resp .= maybe_add(FID_COLLECTION_CODE,      $item->collection_code    );
             $resp .= maybe_add(FID_CALL_NUMBER,          $item->call_number        );
             $resp .= maybe_add(FID_DESTINATION_LOCATION, $item->destination_loc    );
-            $resp .= maybe_add(FID_HOLD_PATRON_ID,       $item->hold_patron_id     );
+            $resp .= maybe_add(FID_HOLD_PATRON_ID,       $item->hold_patron_bcode     );
             $resp .= maybe_add(FID_HOLD_PATRON_NAME,     $item->hold_patron_name   );
             if ($status->hold and $status->hold->{branchcode} ne $item->destination_loc) {
                 warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc;
-- 
1.6.2.5




More information about the Koha-patches mailing list