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 1101-1107
sub handle_patron_info {
Link Here
|
1101 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); |
1101 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); |
1102 |
} |
1102 |
} |
1103 |
|
1103 |
|
1104 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1104 |
$self->write_msg( $resp, $server ); |
1105 |
return (PATRON_INFO); |
1105 |
return (PATRON_INFO); |
1106 |
} |
1106 |
} |
1107 |
|
1107 |
|
Lines 1128-1134
sub handle_end_patron_session {
Link Here
|
1128 |
$resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); |
1128 |
$resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); |
1129 |
$resp .= maybe_add( FID_PRINT_LINE, $print_line, $server ); |
1129 |
$resp .= maybe_add( FID_PRINT_LINE, $print_line, $server ); |
1130 |
|
1130 |
|
1131 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1131 |
$self->write_msg( $resp, $server ); |
1132 |
|
1132 |
|
1133 |
return (END_PATRON_SESSION); |
1133 |
return (END_PATRON_SESSION); |
1134 |
} |
1134 |
} |
Lines 1210-1216
sub handle_fee_paid {
Link Here
|
1210 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1210 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1211 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1211 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1212 |
|
1212 |
|
1213 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1213 |
$self->write_msg( $resp, $server ); |
1214 |
|
1214 |
|
1215 |
return (FEE_PAID); |
1215 |
return (FEE_PAID); |
1216 |
} |
1216 |
} |
Lines 1303-1309
sub handle_item_information {
Link Here
|
1303 |
$resp .= $item->build_custom_field_string( $server ); |
1303 |
$resp .= $item->build_custom_field_string( $server ); |
1304 |
} |
1304 |
} |
1305 |
|
1305 |
|
1306 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1306 |
$self->write_msg( $resp, $server ); |
1307 |
|
1307 |
|
1308 |
return (ITEM_INFORMATION); |
1308 |
return (ITEM_INFORMATION); |
1309 |
} |
1309 |
} |
Lines 1353-1359
sub handle_item_status_update {
Link Here
|
1353 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1353 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1354 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1354 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1355 |
|
1355 |
|
1356 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1356 |
$self->write_msg( $resp, $server ); |
1357 |
|
1357 |
|
1358 |
return (ITEM_STATUS_UPDATE); |
1358 |
return (ITEM_STATUS_UPDATE); |
1359 |
} |
1359 |
} |
Lines 1407-1413
sub handle_patron_enable {
Link Here
|
1407 |
|
1407 |
|
1408 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1408 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1409 |
|
1409 |
|
1410 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1410 |
$self->write_msg( $resp, $server ); |
1411 |
|
1411 |
|
1412 |
return (PATRON_ENABLE); |
1412 |
return (PATRON_ENABLE); |
1413 |
} |
1413 |
} |
Lines 1472-1478
sub handle_hold {
Link Here
|
1472 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1472 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1473 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1473 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1474 |
|
1474 |
|
1475 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1475 |
$self->write_msg( $resp, $server ); |
1476 |
|
1476 |
|
1477 |
return (HOLD); |
1477 |
return (HOLD); |
1478 |
} |
1478 |
} |
Lines 1559-1565
sub handle_renew {
Link Here
|
1559 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1559 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1560 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1560 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1561 |
|
1561 |
|
1562 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1562 |
$self->write_msg( $resp, $server ); |
1563 |
|
1563 |
|
1564 |
return (RENEW); |
1564 |
return (RENEW); |
1565 |
} |
1565 |
} |
Lines 1612-1618
sub handle_renew_all {
Link Here
|
1612 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1612 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1613 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1613 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1614 |
|
1614 |
|
1615 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1615 |
$self->write_msg( $resp, $server ); |
1616 |
|
1616 |
|
1617 |
return (RENEW_ALL); |
1617 |
return (RENEW_ALL); |
1618 |
} |
1618 |
} |
Lines 1718-1724
sub send_acs_status {
Link Here
|
1718 |
|
1718 |
|
1719 |
# Do we want to tell the terminal its location? |
1719 |
# Do we want to tell the terminal its location? |
1720 |
|
1720 |
|
1721 |
$self->write_msg( $msg, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1721 |
$self->write_msg( $msg, $server ); |
1722 |
return 1; |
1722 |
return 1; |
1723 |
} |
1723 |
} |
1724 |
|
1724 |
|