From 3c5f77f094e485b1f5c99e0eff6a3aa2eddf0741 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Mon, 10 May 2010 22:11:18 +0000 Subject: [PATCH] Append extensions fields to checkin response --- Sip/MsgType.pm | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/Sip/MsgType.pm b/Sip/MsgType.pm index 8b959f4..3f3c092 100644 --- a/Sip/MsgType.pm +++ b/Sip/MsgType.pm @@ -637,10 +637,10 @@ sub handle_checkin { $fields = $self->{fields}; $current_loc = $fields->{(FID_CURRENT_LOCN)}; - $inst_id = $fields->{(FID_INST_ID)}; - $item_id = $fields->{(FID_ITEM_ID)}; - $item_props = $fields->{(FID_ITEM_PROPS)}; - $cancel = $fields->{(FID_CANCEL)}; + $inst_id = $fields->{(FID_INST_ID) }; + $item_id = $fields->{(FID_ITEM_ID) }; + $item_props = $fields->{(FID_ITEM_PROPS) }; + $cancel = $fields->{(FID_CANCEL) }; $ils->check_inst_id($inst_id, "handle_checkin"); @@ -656,7 +656,7 @@ sub handle_checkin { } $patron = $status->patron; - $item = $status->item; + $item = $status->item; $resp .= $status->ok ? '1' : '0'; $resp .= $status->resensitize ? 'Y' : 'N'; @@ -678,14 +678,19 @@ sub handle_checkin { } if ($protocol_version >= 2) { - $resp .= maybe_add(FID_SORT_BIN, $status->sort_bin); - if ($patron) { - $resp .= add_field(FID_PATRON_ID, $patron->id); - } - if ($item) { - $resp .= maybe_add(FID_MEDIA_TYPE, $item->sip_media_type); - $resp .= maybe_add(FID_ITEM_PROPS, $item->sip_item_properties); - } + $resp .= maybe_add(FID_SORT_BIN, $status->sort_bin); + if ($patron) { + $resp .= add_field(FID_PATRON_ID, $patron->id); + } + if ($item) { + $resp .= maybe_add(FID_MEDIA_TYPE, $item->sip_media_type ); + $resp .= maybe_add(FID_ITEM_PROPS, $item->sip_item_properties); + $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_bcode ); + $resp .= maybe_add(FID_HOLD_PATRON_NAME, $item->hold_patron_name ); + } } $resp .= maybe_add(FID_ALERT_TYPE, $status->alert_type) if $status->alert; @@ -709,10 +714,10 @@ sub handle_block_patron { ($card_retained, $trans_date) = @{$self->{fixed_fields}}; $fields = $self->{fields}; - $inst_id = $fields->{(FID_INST_ID)}; + $inst_id = $fields->{(FID_INST_ID)}; $blocked_card_msg = $fields->{(FID_BLOCKED_CARD_MSG)}; - $patron_id = $fields->{(FID_PATRON_ID)}; - $terminal_pwd = $fields->{(FID_TERMINAL_PWD)}; + $patron_id = $fields->{(FID_PATRON_ID)}; + $terminal_pwd = $fields->{(FID_TERMINAL_PWD)}; # Terminal passwords are different from account login # passwords, but I have no idea what to do with them. So, -- 2.11.0