Lines 490-496
sub handle_patron_status {
Link Here
|
490 |
$ils->check_inst_id($fields->{(FID_INST_ID)}, "handle_patron_status"); |
490 |
$ils->check_inst_id($fields->{(FID_INST_ID)}, "handle_patron_status"); |
491 |
$patron = $ils->find_patron($fields->{(FID_PATRON_ID)}); |
491 |
$patron = $ils->find_patron($fields->{(FID_PATRON_ID)}); |
492 |
$resp = build_patron_status($patron, $lang, $fields, $server ); |
492 |
$resp = build_patron_status($patron, $lang, $fields, $server ); |
493 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
493 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
494 |
return (PATRON_STATUS_REQ); |
494 |
return (PATRON_STATUS_REQ); |
495 |
} |
495 |
} |
496 |
|
496 |
|
Lines 608-614
sub handle_checkout {
Link Here
|
608 |
} |
608 |
} |
609 |
} |
609 |
} |
610 |
|
610 |
|
611 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
611 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
612 |
return(CHECKOUT); |
612 |
return(CHECKOUT); |
613 |
} |
613 |
} |
614 |
|
614 |
|
Lines 696-702
sub handle_checkin {
Link Here
|
696 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
696 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
697 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
697 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
698 |
|
698 |
|
699 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
699 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
700 |
|
700 |
|
701 |
return(CHECKIN); |
701 |
return(CHECKIN); |
702 |
} |
702 |
} |
Lines 740-746
sub handle_block_patron {
Link Here
|
740 |
} |
740 |
} |
741 |
|
741 |
|
742 |
$resp = build_patron_status( $patron, $patron->language, $fields, $server ); |
742 |
$resp = build_patron_status( $patron, $patron->language, $fields, $server ); |
743 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
743 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
744 |
return(BLOCK_PATRON); |
744 |
return(BLOCK_PATRON); |
745 |
} |
745 |
} |
746 |
|
746 |
|
Lines 782-788
sub handle_request_acs_resend {
Link Here
|
782 |
if (!$last_response) { |
782 |
if (!$last_response) { |
783 |
# We haven't sent anything yet, so respond with a |
783 |
# We haven't sent anything yet, so respond with a |
784 |
# REQUEST_SC_RESEND msg (p. 16) |
784 |
# REQUEST_SC_RESEND msg (p. 16) |
785 |
$self->write_msg(REQUEST_SC_RESEND,undef,$server->{account}->{terminator}); |
785 |
$self->write_msg(REQUEST_SC_RESEND,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
786 |
} elsif ((length($last_response) < 9) |
786 |
} elsif ((length($last_response) < 9) |
787 |
|| substr($last_response, -9, 2) ne 'AY') { |
787 |
|| substr($last_response, -9, 2) ne 'AY') { |
788 |
# When resending a message, we aren't supposed to include |
788 |
# When resending a message, we aren't supposed to include |
Lines 794-800
sub handle_request_acs_resend {
Link Here
|
794 |
# Cut out the sequence number and checksum, since the old |
794 |
# Cut out the sequence number and checksum, since the old |
795 |
# checksum is wrong for the resent message. |
795 |
# checksum is wrong for the resent message. |
796 |
my $rebuilt = substr($last_response, 0, -9); |
796 |
my $rebuilt = substr($last_response, 0, -9); |
797 |
$self->write_msg($rebuilt,undef,$server->{account}->{terminator}); |
797 |
$self->write_msg($rebuilt,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
798 |
} |
798 |
} |
799 |
|
799 |
|
800 |
return REQUEST_ACS_RESEND; |
800 |
return REQUEST_ACS_RESEND; |
Lines 870-876
sub handle_login {
Link Here
|
870 |
} |
870 |
} |
871 |
else { $status = login_core($server,$uid,$pwd); } |
871 |
else { $status = login_core($server,$uid,$pwd); } |
872 |
|
872 |
|
873 |
$self->write_msg(LOGIN_RESP . $status,undef,$server->{account}->{terminator}); |
873 |
$self->write_msg(LOGIN_RESP . $status,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
874 |
return $status ? LOGIN : ''; |
874 |
return $status ? LOGIN : ''; |
875 |
} |
875 |
} |
876 |
|
876 |
|
Lines 1019-1025
sub handle_patron_info {
Link Here
|
1019 |
} |
1019 |
} |
1020 |
} |
1020 |
} |
1021 |
|
1021 |
|
1022 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1022 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1023 |
return(PATRON_INFO); |
1023 |
return(PATRON_INFO); |
1024 |
} |
1024 |
} |
1025 |
|
1025 |
|
Lines 1046-1052
sub handle_end_patron_session {
Link Here
|
1046 |
$resp .= maybe_add(FID_SCREEN_MSG, $screen_msg); |
1046 |
$resp .= maybe_add(FID_SCREEN_MSG, $screen_msg); |
1047 |
$resp .= maybe_add(FID_PRINT_LINE, $print_line); |
1047 |
$resp .= maybe_add(FID_PRINT_LINE, $print_line); |
1048 |
|
1048 |
|
1049 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1049 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1050 |
|
1050 |
|
1051 |
return(END_PATRON_SESSION); |
1051 |
return(END_PATRON_SESSION); |
1052 |
} |
1052 |
} |
Lines 1080-1086
sub handle_fee_paid {
Link Here
|
1080 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1080 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1081 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1081 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1082 |
|
1082 |
|
1083 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1083 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1084 |
|
1084 |
|
1085 |
return(FEE_PAID); |
1085 |
return(FEE_PAID); |
1086 |
} |
1086 |
} |
Lines 1147-1153
sub handle_item_information {
Link Here
|
1147 |
$resp .= maybe_add(FID_PRINT_LINE, $item->print_line); |
1147 |
$resp .= maybe_add(FID_PRINT_LINE, $item->print_line); |
1148 |
} |
1148 |
} |
1149 |
|
1149 |
|
1150 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1150 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1151 |
|
1151 |
|
1152 |
return(ITEM_INFORMATION); |
1152 |
return(ITEM_INFORMATION); |
1153 |
} |
1153 |
} |
Lines 1196-1202
sub handle_item_status_update {
Link Here
|
1196 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1196 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1197 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1197 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1198 |
|
1198 |
|
1199 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1199 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1200 |
|
1200 |
|
1201 |
return(ITEM_STATUS_UPDATE); |
1201 |
return(ITEM_STATUS_UPDATE); |
1202 |
} |
1202 |
} |
Lines 1247-1253
sub handle_patron_enable {
Link Here
|
1247 |
|
1247 |
|
1248 |
$resp .= add_field(FID_INST_ID, $ils->institution); |
1248 |
$resp .= add_field(FID_INST_ID, $ils->institution); |
1249 |
|
1249 |
|
1250 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1250 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1251 |
|
1251 |
|
1252 |
return(PATRON_ENABLE); |
1252 |
return(PATRON_ENABLE); |
1253 |
} |
1253 |
} |
Lines 1313-1319
sub handle_hold {
Link Here
|
1313 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1313 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1314 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1314 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1315 |
|
1315 |
|
1316 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1316 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1317 |
|
1317 |
|
1318 |
return(HOLD); |
1318 |
return(HOLD); |
1319 |
} |
1319 |
} |
Lines 1402-1408
sub handle_renew {
Link Here
|
1402 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1402 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1403 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1403 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1404 |
|
1404 |
|
1405 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1405 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1406 |
|
1406 |
|
1407 |
return(RENEW); |
1407 |
return(RENEW); |
1408 |
} |
1408 |
} |
Lines 1452-1458
sub handle_renew_all {
Link Here
|
1452 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1452 |
$resp .= maybe_add(FID_SCREEN_MSG, $status->screen_msg); |
1453 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1453 |
$resp .= maybe_add(FID_PRINT_LINE, $status->print_line); |
1454 |
|
1454 |
|
1455 |
$self->write_msg($resp,undef,$server->{account}->{terminator}); |
1455 |
$self->write_msg($resp,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1456 |
|
1456 |
|
1457 |
return(RENEW_ALL); |
1457 |
return(RENEW_ALL); |
1458 |
} |
1458 |
} |
Lines 1562-1568
sub send_acs_status {
Link Here
|
1562 |
|
1562 |
|
1563 |
# Do we want to tell the terminal its location? |
1563 |
# Do we want to tell the terminal its location? |
1564 |
|
1564 |
|
1565 |
$self->write_msg($msg,undef,$server->{account}->{terminator}); |
1565 |
$self->write_msg($msg,undef,$server->{account}->{terminator},$server->{account}->{encoding}); |
1566 |
return 1; |
1566 |
return 1; |
1567 |
} |
1567 |
} |
1568 |
|
1568 |
|