Lines 509-515
sub handle_patron_status {
Link Here
|
509 |
$koha_patron->update_lastseen('connection'); |
509 |
$koha_patron->update_lastseen('connection'); |
510 |
} |
510 |
} |
511 |
$resp = build_patron_status( $patron, $lang, $fields, $server ); |
511 |
$resp = build_patron_status( $patron, $lang, $fields, $server ); |
512 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
512 |
$self->write_msg( $resp, $server ); |
513 |
return (PATRON_STATUS_REQ); |
513 |
return (PATRON_STATUS_REQ); |
514 |
} |
514 |
} |
515 |
|
515 |
|
Lines 649-655
sub handle_checkout {
Link Here
|
649 |
} |
649 |
} |
650 |
} |
650 |
} |
651 |
|
651 |
|
652 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
652 |
$self->write_msg( $resp, $server ); |
653 |
return (CHECKOUT); |
653 |
return (CHECKOUT); |
654 |
} |
654 |
} |
655 |
|
655 |
|
Lines 748-754
sub handle_checkin {
Link Here
|
748 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
748 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
749 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
749 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
750 |
|
750 |
|
751 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
751 |
$self->write_msg( $resp, $server ); |
752 |
|
752 |
|
753 |
return (CHECKIN); |
753 |
return (CHECKIN); |
754 |
} |
754 |
} |
Lines 795-801
sub handle_block_patron {
Link Here
|
795 |
} |
795 |
} |
796 |
|
796 |
|
797 |
$resp = build_patron_status( $patron, $patron->language, $fields, $server ); |
797 |
$resp = build_patron_status( $patron, $patron->language, $fields, $server ); |
798 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
798 |
$self->write_msg( $resp, $server ); |
799 |
return (BLOCK_PATRON); |
799 |
return (BLOCK_PATRON); |
800 |
} |
800 |
} |
801 |
|
801 |
|
Lines 836-842
sub handle_request_acs_resend {
Link Here
|
836 |
|
836 |
|
837 |
# We haven't sent anything yet, so respond with a |
837 |
# We haven't sent anything yet, so respond with a |
838 |
# REQUEST_SC_RESEND msg (p. 16) |
838 |
# REQUEST_SC_RESEND msg (p. 16) |
839 |
$self->write_msg( REQUEST_SC_RESEND, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
839 |
$self->write_msg( REQUEST_SC_RESEND, $server ); |
840 |
} elsif ( ( length($last_response) < 9 ) |
840 |
} elsif ( ( length($last_response) < 9 ) |
841 |
|| substr( $last_response, -9, 2 ) ne 'AY' ) { |
841 |
|| substr( $last_response, -9, 2 ) ne 'AY' ) { |
842 |
|
842 |
|
Lines 850-856
sub handle_request_acs_resend {
Link Here
|
850 |
# Cut out the sequence number and checksum, since the old |
850 |
# Cut out the sequence number and checksum, since the old |
851 |
# checksum is wrong for the resent message. |
851 |
# checksum is wrong for the resent message. |
852 |
my $rebuilt = substr( $last_response, 0, -9 ); |
852 |
my $rebuilt = substr( $last_response, 0, -9 ); |
853 |
$self->write_msg( $rebuilt, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
853 |
$self->write_msg( $rebuilt, $server ); |
854 |
} |
854 |
} |
855 |
|
855 |
|
856 |
return REQUEST_ACS_RESEND; |
856 |
return REQUEST_ACS_RESEND; |
Lines 932-938
sub handle_login {
Link Here
|
932 |
$status = login_core( $server, $uid, $pwd ); |
932 |
$status = login_core( $server, $uid, $pwd ); |
933 |
} |
933 |
} |
934 |
|
934 |
|
935 |
$self->write_msg( LOGIN_RESP . $status, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
935 |
$self->write_msg( LOGIN_RESP . $status, $server ); |
936 |
return $status ? LOGIN : ''; |
936 |
return $status ? LOGIN : ''; |
937 |
} |
937 |
} |
938 |
|
938 |
|
Lines 1110-1116
sub handle_patron_info {
Link Here
|
1110 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); |
1110 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); |
1111 |
} |
1111 |
} |
1112 |
|
1112 |
|
1113 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1113 |
$self->write_msg( $resp, $server ); |
1114 |
return (PATRON_INFO); |
1114 |
return (PATRON_INFO); |
1115 |
} |
1115 |
} |
1116 |
|
1116 |
|
Lines 1137-1143
sub handle_end_patron_session {
Link Here
|
1137 |
$resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); |
1137 |
$resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); |
1138 |
$resp .= maybe_add( FID_PRINT_LINE, $print_line, $server ); |
1138 |
$resp .= maybe_add( FID_PRINT_LINE, $print_line, $server ); |
1139 |
|
1139 |
|
1140 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1140 |
$self->write_msg( $resp, $server ); |
1141 |
|
1141 |
|
1142 |
return (END_PATRON_SESSION); |
1142 |
return (END_PATRON_SESSION); |
1143 |
} |
1143 |
} |
Lines 1219-1225
sub handle_fee_paid {
Link Here
|
1219 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1219 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1220 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1220 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1221 |
|
1221 |
|
1222 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1222 |
$self->write_msg( $resp, $server ); |
1223 |
|
1223 |
|
1224 |
return (FEE_PAID); |
1224 |
return (FEE_PAID); |
1225 |
} |
1225 |
} |
Lines 1312-1318
sub handle_item_information {
Link Here
|
1312 |
$resp .= $item->build_custom_field_string( $server ); |
1312 |
$resp .= $item->build_custom_field_string( $server ); |
1313 |
} |
1313 |
} |
1314 |
|
1314 |
|
1315 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1315 |
$self->write_msg( $resp, $server ); |
1316 |
|
1316 |
|
1317 |
return (ITEM_INFORMATION); |
1317 |
return (ITEM_INFORMATION); |
1318 |
} |
1318 |
} |
Lines 1362-1368
sub handle_item_status_update {
Link Here
|
1362 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1362 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1363 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1363 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1364 |
|
1364 |
|
1365 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1365 |
$self->write_msg( $resp, $server ); |
1366 |
|
1366 |
|
1367 |
return (ITEM_STATUS_UPDATE); |
1367 |
return (ITEM_STATUS_UPDATE); |
1368 |
} |
1368 |
} |
Lines 1416-1422
sub handle_patron_enable {
Link Here
|
1416 |
|
1416 |
|
1417 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1417 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1418 |
|
1418 |
|
1419 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1419 |
$self->write_msg( $resp, $server ); |
1420 |
|
1420 |
|
1421 |
return (PATRON_ENABLE); |
1421 |
return (PATRON_ENABLE); |
1422 |
} |
1422 |
} |
Lines 1481-1487
sub handle_hold {
Link Here
|
1481 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1481 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1482 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1482 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1483 |
|
1483 |
|
1484 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1484 |
$self->write_msg( $resp, $server ); |
1485 |
|
1485 |
|
1486 |
return (HOLD); |
1486 |
return (HOLD); |
1487 |
} |
1487 |
} |
Lines 1568-1574
sub handle_renew {
Link Here
|
1568 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1568 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1569 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1569 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1570 |
|
1570 |
|
1571 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1571 |
$self->write_msg( $resp, $server ); |
1572 |
|
1572 |
|
1573 |
return (RENEW); |
1573 |
return (RENEW); |
1574 |
} |
1574 |
} |
Lines 1621-1627
sub handle_renew_all {
Link Here
|
1621 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1621 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1622 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1622 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1623 |
|
1623 |
|
1624 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1624 |
$self->write_msg( $resp, $server ); |
1625 |
|
1625 |
|
1626 |
return (RENEW_ALL); |
1626 |
return (RENEW_ALL); |
1627 |
} |
1627 |
} |
Lines 1727-1733
sub send_acs_status {
Link Here
|
1727 |
|
1727 |
|
1728 |
# Do we want to tell the terminal its location? |
1728 |
# Do we want to tell the terminal its location? |
1729 |
|
1729 |
|
1730 |
$self->write_msg( $msg, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1730 |
$self->write_msg( $msg, $server ); |
1731 |
return 1; |
1731 |
return 1; |
1732 |
} |
1732 |
} |
1733 |
|
1733 |
|