Lines 422-449
sub build_patron_status {
Link Here
|
422 |
|
422 |
|
423 |
$resp .= patron_status_string($patron); |
423 |
$resp .= patron_status_string($patron); |
424 |
$resp .= $lang . timestamp(); |
424 |
$resp .= $lang . timestamp(); |
425 |
$resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) ); |
425 |
$resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ), $server ); |
426 |
|
426 |
|
427 |
# while the patron ID we got from the SC is valid, let's |
427 |
# while the patron ID we got from the SC is valid, let's |
428 |
# use the one returned from the ILS, just in case... |
428 |
# use the one returned from the ILS, just in case... |
429 |
$resp .= add_field( FID_PATRON_ID, $patron->id ); |
429 |
$resp .= add_field( FID_PATRON_ID, $patron->id, $server ); |
430 |
|
430 |
|
431 |
if ( $protocol_version >= 2 ) { |
431 |
if ( $protocol_version >= 2 ) { |
432 |
$resp .= add_field( FID_VALID_PATRON, 'Y' ); |
432 |
$resp .= add_field( FID_VALID_PATRON, 'Y', $server ); |
433 |
|
433 |
|
434 |
# Patron password is a required field. |
434 |
# Patron password is a required field. |
435 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool($password_rc) ); |
435 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool($password_rc), $server ); |
436 |
$resp .= maybe_add( FID_CURRENCY, $patron->currency ); |
436 |
$resp .= maybe_add( FID_CURRENCY, $patron->currency, $server ); |
437 |
$resp .= maybe_add( FID_FEE_AMT, $patron->fee_amount ); |
437 |
$resp .= maybe_add( FID_FEE_AMT, $patron->fee_amount, $server ); |
438 |
} |
438 |
} |
439 |
|
439 |
|
440 |
my $msg = $patron->screen_msg; |
440 |
my $msg = $patron->screen_msg; |
441 |
$msg .= ' -- '. INVALID_PW if $patron_pwd && !$password_rc; |
441 |
$msg .= ' -- '. INVALID_PW if $patron_pwd && !$password_rc; |
442 |
$resp .= maybe_add( FID_SCREEN_MSG, $msg, $server ); |
442 |
$resp .= maybe_add( FID_SCREEN_MSG, $msg, $server, $server ); |
443 |
|
443 |
|
444 |
$resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server ) |
444 |
$resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server ) |
445 |
if ( $server->{account}->{send_patron_home_library_in_af} ); |
445 |
if ( $server->{account}->{send_patron_home_library_in_af} ); |
446 |
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line ); |
446 |
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line, $server ); |
447 |
|
447 |
|
448 |
$resp .= $patron->build_patron_attributes_string( $server ); |
448 |
$resp .= $patron->build_patron_attributes_string( $server ); |
449 |
|
449 |
|
Lines 453-471
sub build_patron_status {
Link Here
|
453 |
|
453 |
|
454 |
# no personal name, and is invalid (if we're using 2.00) |
454 |
# no personal name, and is invalid (if we're using 2.00) |
455 |
$resp .= 'YYYY' . ( ' ' x 10 ) . $lang . timestamp(); |
455 |
$resp .= 'YYYY' . ( ' ' x 10 ) . $lang . timestamp(); |
456 |
$resp .= add_field( FID_PERSONAL_NAME, '' ); |
456 |
$resp .= add_field( FID_PERSONAL_NAME, '', $server ); |
457 |
|
457 |
|
458 |
# the patron ID is invalid, but it's a required field, so |
458 |
# the patron ID is invalid, but it's a required field, so |
459 |
# just echo it back |
459 |
# just echo it back |
460 |
$resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) } ); |
460 |
$resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) }, $server ); |
461 |
|
461 |
|
462 |
( $protocol_version >= 2 ) |
462 |
( $protocol_version >= 2 ) |
463 |
and $resp .= add_field( FID_VALID_PATRON, 'N' ); |
463 |
and $resp .= add_field( FID_VALID_PATRON, 'N', $server ); |
464 |
|
464 |
|
465 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); |
465 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server, $server ); |
466 |
} |
466 |
} |
467 |
|
467 |
|
468 |
$resp .= add_field( FID_INST_ID, $fields->{ (FID_INST_ID) } ); |
468 |
$resp .= add_field( FID_INST_ID, $fields->{ (FID_INST_ID) }, $server ); |
469 |
return $resp; |
469 |
return $resp; |
470 |
} |
470 |
} |
471 |
|
471 |
|
Lines 537-561
sub handle_checkout {
Link Here
|
537 |
$resp .= timestamp; |
537 |
$resp .= timestamp; |
538 |
|
538 |
|
539 |
# Now for the variable fields |
539 |
# Now for the variable fields |
540 |
$resp .= add_field( FID_INST_ID, $inst ); |
540 |
$resp .= add_field( FID_INST_ID, $inst, $server ); |
541 |
$resp .= add_field( FID_PATRON_ID, $patron_id ); |
541 |
$resp .= add_field( FID_PATRON_ID, $patron_id, $server ); |
542 |
$resp .= add_field( FID_ITEM_ID, $item_id ); |
542 |
$resp .= add_field( FID_ITEM_ID, $item_id, $server ); |
543 |
$resp .= add_field( FID_TITLE_ID, $item->title_id ); |
543 |
$resp .= add_field( FID_TITLE_ID, $item->title_id, $server ); |
544 |
if ( $item->due_date ) { |
544 |
if ( $item->due_date ) { |
545 |
$resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ) ); |
545 |
$resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ), $server ); |
546 |
} else { |
546 |
} else { |
547 |
$resp .= add_field( FID_DUE_DATE, q{} ); |
547 |
$resp .= add_field( FID_DUE_DATE, q{}, $server ); |
548 |
} |
548 |
} |
549 |
|
549 |
|
550 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
550 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
551 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
551 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
552 |
|
552 |
|
553 |
if ( $protocol_version >= 2 ) { |
553 |
if ( $protocol_version >= 2 ) { |
554 |
if ( $ils->supports('security inhibit') ) { |
554 |
if ( $ils->supports('security inhibit') ) { |
555 |
$resp .= add_field( FID_SECURITY_INHIBIT, $status->security_inhibit ); |
555 |
$resp .= add_field( FID_SECURITY_INHIBIT, $status->security_inhibit, $server ); |
556 |
} |
556 |
} |
557 |
$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type ); |
557 |
$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type, $server ); |
558 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties ); |
558 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); |
559 |
|
559 |
|
560 |
} |
560 |
} |
561 |
} |
561 |
} |
Lines 566-595
sub handle_checkout {
Link Here
|
566 |
# Checkout Response: not ok, no renewal, don't know mag. media, |
566 |
# Checkout Response: not ok, no renewal, don't know mag. media, |
567 |
# no desensitize |
567 |
# no desensitize |
568 |
$resp = sprintf( "120NUN%s", timestamp ); |
568 |
$resp = sprintf( "120NUN%s", timestamp ); |
569 |
$resp .= add_field( FID_INST_ID, $inst ); |
569 |
$resp .= add_field( FID_INST_ID, $inst, $server ); |
570 |
$resp .= add_field( FID_PATRON_ID, $patron_id ); |
570 |
$resp .= add_field( FID_PATRON_ID, $patron_id, $server ); |
571 |
$resp .= add_field( FID_ITEM_ID, $item_id ); |
571 |
$resp .= add_field( FID_ITEM_ID, $item_id, $server ); |
572 |
|
572 |
|
573 |
# If the item is valid, provide the title, otherwise |
573 |
# If the item is valid, provide the title, otherwise |
574 |
# leave it blank |
574 |
# leave it blank |
575 |
$resp .= add_field( FID_TITLE_ID, $item ? $item->title_id : '' ); |
575 |
$resp .= add_field( FID_TITLE_ID, $item ? $item->title_id : '', $server ); |
576 |
|
576 |
|
577 |
# Due date is required. Since it didn't get checked out, |
577 |
# Due date is required. Since it didn't get checked out, |
578 |
# it's not due, so leave the date blank |
578 |
# it's not due, so leave the date blank |
579 |
$resp .= add_field( FID_DUE_DATE, '' ); |
579 |
$resp .= add_field( FID_DUE_DATE, '', $server ); |
580 |
|
580 |
|
581 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
581 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
582 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
582 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
583 |
|
583 |
|
584 |
if ( $protocol_version >= 2 ) { |
584 |
if ( $protocol_version >= 2 ) { |
585 |
|
585 |
|
586 |
# Is the patron ID valid? |
586 |
# Is the patron ID valid? |
587 |
$resp .= add_field( FID_VALID_PATRON, sipbool($patron) ); |
587 |
$resp .= add_field( FID_VALID_PATRON, sipbool($patron), $server ); |
588 |
|
588 |
|
589 |
if ( $patron && exists( $fields->{FID_PATRON_PWD} ) ) { |
589 |
if ( $patron && exists( $fields->{FID_PATRON_PWD} ) ) { |
590 |
|
590 |
|
591 |
# Password provided, so we can tell if it was valid or not |
591 |
# Password provided, so we can tell if it was valid or not |
592 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password( $fields->{ (FID_PATRON_PWD) } ) ) ); |
592 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password( $fields->{ (FID_PATRON_PWD) } ) ), $server ); |
593 |
} |
593 |
} |
594 |
} |
594 |
} |
595 |
} |
595 |
} |
Lines 598-607
sub handle_checkout {
Link Here
|
598 |
|
598 |
|
599 |
# Financials : return irrespective of ok status |
599 |
# Financials : return irrespective of ok status |
600 |
if ( $status->fee_amount ) { |
600 |
if ( $status->fee_amount ) { |
601 |
$resp .= add_field( FID_FEE_AMT, $status->fee_amount ); |
601 |
$resp .= add_field( FID_FEE_AMT, $status->fee_amount, $server ); |
602 |
$resp .= maybe_add( FID_CURRENCY, $status->sip_currency ); |
602 |
$resp .= maybe_add( FID_CURRENCY, $status->sip_currency, $server ); |
603 |
$resp .= maybe_add( FID_FEE_TYPE, $status->sip_fee_type ); |
603 |
$resp .= maybe_add( FID_FEE_TYPE, $status->sip_fee_type, $server ); |
604 |
$resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id ); |
604 |
$resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id, $server ); |
605 |
} |
605 |
} |
606 |
} |
606 |
} |
607 |
|
607 |
|
Lines 655-681
sub handle_checkin {
Link Here
|
655 |
|
655 |
|
656 |
$resp .= $status->alert ? 'Y' : 'N'; |
656 |
$resp .= $status->alert ? 'Y' : 'N'; |
657 |
$resp .= timestamp; |
657 |
$resp .= timestamp; |
658 |
$resp .= add_field( FID_INST_ID, $inst_id ); |
658 |
$resp .= add_field( FID_INST_ID, $inst_id, $server ); |
659 |
$resp .= add_field( FID_ITEM_ID, $item_id ); |
659 |
$resp .= add_field( FID_ITEM_ID, $item_id, $server ); |
660 |
|
660 |
|
661 |
if ($item) { |
661 |
if ($item) { |
662 |
$resp .= add_field( FID_PERM_LOCN, $item->permanent_location ); |
662 |
$resp .= add_field( FID_PERM_LOCN, $item->permanent_location, $server ); |
663 |
$resp .= maybe_add( FID_TITLE_ID, $item->title_id ); |
663 |
$resp .= maybe_add( FID_TITLE_ID, $item->title_id, $server ); |
664 |
} |
664 |
} |
665 |
|
665 |
|
666 |
if ( $protocol_version >= 2 ) { |
666 |
if ( $protocol_version >= 2 ) { |
667 |
$resp .= maybe_add( FID_SORT_BIN, $status->sort_bin ); |
667 |
$resp .= maybe_add( FID_SORT_BIN, $status->sort_bin, $server ); |
668 |
if ($patron) { |
668 |
if ($patron) { |
669 |
$resp .= add_field( FID_PATRON_ID, $patron->id ); |
669 |
$resp .= add_field( FID_PATRON_ID, $patron->id, $server ); |
670 |
} |
670 |
} |
671 |
if ($item) { |
671 |
if ($item) { |
672 |
$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type ); |
672 |
$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type, $server ); |
673 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties ); |
673 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); |
674 |
$resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code ); |
674 |
$resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code, $server ); |
675 |
$resp .= maybe_add( FID_CALL_NUMBER, $item->call_number ); |
675 |
$resp .= maybe_add( FID_CALL_NUMBER, $item->call_number, $server ); |
676 |
$resp .= maybe_add( FID_DESTINATION_LOCATION, $item->destination_loc ); |
676 |
$resp .= maybe_add( FID_DESTINATION_LOCATION, $item->destination_loc, $server ); |
677 |
$resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode ); |
677 |
$resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode, $server ); |
678 |
$resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ) ); |
678 |
$resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ), $server ); |
679 |
if ( $status->hold and $status->hold->{branchcode} ne $item->destination_loc ) { |
679 |
if ( $status->hold and $status->hold->{branchcode} ne $item->destination_loc ) { |
680 |
warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc; |
680 |
warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc; |
681 |
|
681 |
|
Lines 685-692
sub handle_checkin {
Link Here
|
685 |
} |
685 |
} |
686 |
|
686 |
|
687 |
$resp .= maybe_add( FID_ALERT_TYPE, $status->alert_type ) if $status->alert; |
687 |
$resp .= maybe_add( FID_ALERT_TYPE, $status->alert_type ) if $status->alert; |
688 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
688 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
689 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
689 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
690 |
|
690 |
|
691 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
691 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
692 |
|
692 |
|
Lines 911-917
sub summary_info {
Link Here
|
911 |
|
911 |
|
912 |
syslog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", @{$itemlist} ) ); |
912 |
syslog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", @{$itemlist} ) ); |
913 |
foreach my $i ( @{$itemlist} ) { |
913 |
foreach my $i ( @{$itemlist} ) { |
914 |
$resp .= add_field( $fid, $i->{barcode} ); |
914 |
$resp .= add_field( $fid, $i->{barcode}, $server ); |
915 |
} |
915 |
} |
916 |
|
916 |
|
917 |
return $resp; |
917 |
return $resp; |
Lines 948-966
sub handle_patron_info {
Link Here
|
948 |
$resp .= add_count( 'patron_info/recall_items', scalar @{ $patron->recall_items } ); |
948 |
$resp .= add_count( 'patron_info/recall_items', scalar @{ $patron->recall_items } ); |
949 |
$resp .= add_count( 'patron_info/unavail_holds', scalar @{ $patron->unavail_holds } ); |
949 |
$resp .= add_count( 'patron_info/unavail_holds', scalar @{ $patron->unavail_holds } ); |
950 |
|
950 |
|
951 |
$resp .= add_field( FID_INST_ID, ( $ils->institution_id || 'SIP2' ) ); |
951 |
$resp .= add_field( FID_INST_ID, ( $ils->institution_id || 'SIP2' ), $server ); |
952 |
|
952 |
|
953 |
# while the patron ID we got from the SC is valid, let's |
953 |
# while the patron ID we got from the SC is valid, let's |
954 |
# use the one returned from the ILS, just in case... |
954 |
# use the one returned from the ILS, just in case... |
955 |
$resp .= add_field( FID_PATRON_ID, $patron->id ); |
955 |
$resp .= add_field( FID_PATRON_ID, $patron->id, $server ); |
956 |
$resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) ); |
956 |
$resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ), $server ); |
957 |
|
957 |
|
958 |
# TODO: add code for the fields |
958 |
# TODO: add code for the fields |
959 |
# hold items limit |
959 |
# hold items limit |
960 |
# overdue items limit |
960 |
# overdue items limit |
961 |
# charged items limit |
961 |
# charged items limit |
962 |
|
962 |
|
963 |
$resp .= add_field( FID_VALID_PATRON, 'Y' ); |
963 |
$resp .= add_field( FID_VALID_PATRON, 'Y', $server ); |
964 |
my $password_rc; |
964 |
my $password_rc; |
965 |
if ( defined($patron_pwd) ) { |
965 |
if ( defined($patron_pwd) ) { |
966 |
|
966 |
|
Lines 969-980
sub handle_patron_info {
Link Here
|
969 |
if ( $patron_pwd eq q{} && $server->{account}->{allow_empty_passwords} ) { |
969 |
if ( $patron_pwd eq q{} && $server->{account}->{allow_empty_passwords} ) { |
970 |
$password_rc = 1; |
970 |
$password_rc = 1; |
971 |
} |
971 |
} |
972 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $password_rc ) ); |
972 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $password_rc ), $server ); |
973 |
} |
973 |
} |
974 |
|
974 |
|
975 |
$resp .= maybe_add( FID_CURRENCY, $patron->currency ); |
975 |
$resp .= maybe_add( FID_CURRENCY, $patron->currency, $server ); |
976 |
$resp .= maybe_add( FID_FEE_AMT, $patron->fee_amount ); |
976 |
$resp .= maybe_add( FID_FEE_AMT, $patron->fee_amount, $server ); |
977 |
$resp .= add_field( FID_FEE_LMT, $patron->fee_limit ); |
977 |
$resp .= add_field( FID_FEE_LMT, $patron->fee_limit, $server ); |
978 |
|
978 |
|
979 |
# TODO: zero or more item details for 2.0 can go here: |
979 |
# TODO: zero or more item details for 2.0 can go here: |
980 |
# hold_items |
980 |
# hold_items |
Lines 985-1011
sub handle_patron_info {
Link Here
|
985 |
|
985 |
|
986 |
$resp .= summary_info( $ils, $patron, $summary, $start, $end, $server ); |
986 |
$resp .= summary_info( $ils, $patron, $summary, $start, $end, $server ); |
987 |
|
987 |
|
988 |
$resp .= maybe_add( FID_HOME_ADDR, $patron->address ); |
988 |
$resp .= maybe_add( FID_HOME_ADDR, $patron->address, $server ); |
989 |
$resp .= maybe_add( FID_EMAIL, $patron->email_addr ); |
989 |
$resp .= maybe_add( FID_EMAIL, $patron->email_addr, $server ); |
990 |
$resp .= maybe_add( FID_HOME_PHONE, $patron->home_phone ); |
990 |
$resp .= maybe_add( FID_HOME_PHONE, $patron->home_phone, $server ); |
991 |
|
991 |
|
992 |
# SIP 2.0 extensions used by Envisionware |
992 |
# SIP 2.0 extensions used by Envisionware |
993 |
# Other terminals will ignore unrecognized fields (unrecognized field identifiers) |
993 |
# Other terminals will ignore unrecognized fields (unrecognized field identifiers) |
994 |
$resp .= maybe_add( FID_PATRON_BIRTHDATE, $patron->birthdate ); |
994 |
$resp .= maybe_add( FID_PATRON_BIRTHDATE, $patron->birthdate, $server ); |
995 |
$resp .= maybe_add( FID_PATRON_CLASS, $patron->ptype ); |
995 |
$resp .= maybe_add( FID_PATRON_CLASS, $patron->ptype, $server ); |
996 |
|
996 |
|
997 |
# Custom protocol extension to report patron internet privileges |
997 |
# Custom protocol extension to report patron internet privileges |
998 |
$resp .= maybe_add( FID_INET_PROFILE, $patron->inet_privileges ); |
998 |
$resp .= maybe_add( FID_INET_PROFILE, $patron->inet_privileges, $server ); |
999 |
|
999 |
|
1000 |
my $msg = $patron->screen_msg; |
1000 |
my $msg = $patron->screen_msg; |
1001 |
if( defined( $patron_pwd ) && !$password_rc ) { |
1001 |
if( defined( $patron_pwd ) && !$password_rc ) { |
1002 |
$msg .= ' -- ' . INVALID_PW; |
1002 |
$msg .= ' -- ' . INVALID_PW; |
1003 |
} |
1003 |
} |
1004 |
$resp .= maybe_add( FID_SCREEN_MSG, $msg, $server ); |
1004 |
$resp .= maybe_add( FID_SCREEN_MSG, $msg, $server, $server ); |
1005 |
if ( $server->{account}->{send_patron_home_library_in_af} ) { |
1005 |
if ( $server->{account}->{send_patron_home_library_in_af} ) { |
1006 |
$resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server); |
1006 |
$resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server); |
1007 |
} |
1007 |
} |
1008 |
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line ); |
1008 |
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line, $server ); |
1009 |
|
1009 |
|
1010 |
$resp .= $patron->build_patron_attributes_string( $server ); |
1010 |
$resp .= $patron->build_patron_attributes_string( $server ); |
1011 |
} else { |
1011 |
} else { |
Lines 1016-1031
sub handle_patron_info {
Link Here
|
1016 |
$resp .= 'YYYY' . ( ' ' x 10 ) . $lang . timestamp(); |
1016 |
$resp .= 'YYYY' . ( ' ' x 10 ) . $lang . timestamp(); |
1017 |
$resp .= '0000' x 6; |
1017 |
$resp .= '0000' x 6; |
1018 |
|
1018 |
|
1019 |
$resp .= add_field( FID_INST_ID, ( $ils->institution_id || 'SIP2' ) ); |
1019 |
$resp .= add_field( FID_INST_ID, ( $ils->institution_id || 'SIP2' ), $server ); |
1020 |
|
1020 |
|
1021 |
# patron ID is invalid, but field is required, so just echo it back |
1021 |
# patron ID is invalid, but field is required, so just echo it back |
1022 |
$resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) } ); |
1022 |
$resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) }, $server ); |
1023 |
$resp .= add_field( FID_PERSONAL_NAME, '' ); |
1023 |
$resp .= add_field( FID_PERSONAL_NAME, '', $server ); |
1024 |
|
1024 |
|
1025 |
if ( $protocol_version >= 2 ) { |
1025 |
if ( $protocol_version >= 2 ) { |
1026 |
$resp .= add_field( FID_VALID_PATRON, 'N' ); |
1026 |
$resp .= add_field( FID_VALID_PATRON, 'N', $server ); |
1027 |
} |
1027 |
} |
1028 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server ); |
1028 |
$resp .= maybe_add( FID_SCREEN_MSG, INVALID_CARD, $server, $server ); |
1029 |
} |
1029 |
} |
1030 |
|
1030 |
|
1031 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1031 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
Lines 1049-1059
sub handle_end_patron_session {
Link Here
|
1049 |
$resp .= $status ? 'Y' : 'N'; |
1049 |
$resp .= $status ? 'Y' : 'N'; |
1050 |
$resp .= timestamp(); |
1050 |
$resp .= timestamp(); |
1051 |
|
1051 |
|
1052 |
$resp .= add_field( FID_INST_ID, $server->{ils}->institution ); |
1052 |
$resp .= add_field( FID_INST_ID, $server->{ils}->institution, $server ); |
1053 |
$resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) } ); |
1053 |
$resp .= add_field( FID_PATRON_ID, $fields->{ (FID_PATRON_ID) }, $server ); |
1054 |
|
1054 |
|
1055 |
$resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); |
1055 |
$resp .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server, $server ); |
1056 |
$resp .= maybe_add( FID_PRINT_LINE, $print_line ); |
1056 |
$resp .= maybe_add( FID_PRINT_LINE, $print_line, $server ); |
1057 |
|
1057 |
|
1058 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1058 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1059 |
|
1059 |
|
Lines 1087-1097
sub handle_fee_paid {
Link Here
|
1087 |
$status = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment ); |
1087 |
$status = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment ); |
1088 |
|
1088 |
|
1089 |
$resp .= ( $status->ok ? 'Y' : 'N' ) . timestamp; |
1089 |
$resp .= ( $status->ok ? 'Y' : 'N' ) . timestamp; |
1090 |
$resp .= add_field( FID_INST_ID, $inst_id ); |
1090 |
$resp .= add_field( FID_INST_ID, $inst_id, $server ); |
1091 |
$resp .= add_field( FID_PATRON_ID, $patron_id ); |
1091 |
$resp .= add_field( FID_PATRON_ID, $patron_id, $server ); |
1092 |
$resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id ); |
1092 |
$resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id, $server ); |
1093 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1093 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
1094 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
1094 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1095 |
|
1095 |
|
1096 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1096 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1097 |
|
1097 |
|
Lines 1121-1130
sub handle_item_information {
Link Here
|
1121 |
$resp .= timestamp; |
1121 |
$resp .= timestamp; |
1122 |
|
1122 |
|
1123 |
# Just echo back the invalid item id |
1123 |
# Just echo back the invalid item id |
1124 |
$resp .= add_field( FID_ITEM_ID, $fields->{ (FID_ITEM_ID) } ); |
1124 |
$resp .= add_field( FID_ITEM_ID, $fields->{ (FID_ITEM_ID) }, $server ); |
1125 |
|
1125 |
|
1126 |
# title id is required, but we don't have one |
1126 |
# title id is required, but we don't have one |
1127 |
$resp .= add_field( FID_TITLE_ID, '' ); |
1127 |
$resp .= add_field( FID_TITLE_ID, '', $server ); |
1128 |
} else { |
1128 |
} else { |
1129 |
|
1129 |
|
1130 |
# Valid Item ID, send the good stuff |
1130 |
# Valid Item ID, send the good stuff |
Lines 1133-1167
sub handle_item_information {
Link Here
|
1133 |
$resp .= $item->sip_fee_type; |
1133 |
$resp .= $item->sip_fee_type; |
1134 |
$resp .= timestamp; |
1134 |
$resp .= timestamp; |
1135 |
|
1135 |
|
1136 |
$resp .= add_field( FID_ITEM_ID, $item->id ); |
1136 |
$resp .= add_field( FID_ITEM_ID, $item->id, $server ); |
1137 |
$resp .= add_field( FID_TITLE_ID, $item->title_id ); |
1137 |
$resp .= add_field( FID_TITLE_ID, $item->title_id, $server ); |
1138 |
|
1138 |
|
1139 |
$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type ); |
1139 |
$resp .= maybe_add( FID_MEDIA_TYPE, $item->sip_media_type, $server ); |
1140 |
$resp .= maybe_add( FID_PERM_LOCN, $item->permanent_location ); |
1140 |
$resp .= maybe_add( FID_PERM_LOCN, $item->permanent_location, $server ); |
1141 |
$resp .= maybe_add( FID_CURRENT_LOCN, $item->current_location ); |
1141 |
$resp .= maybe_add( FID_CURRENT_LOCN, $item->current_location, $server ); |
1142 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties ); |
1142 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); |
1143 |
|
1143 |
|
1144 |
if ( ( $i = $item->fee ) != 0 ) { |
1144 |
if ( ( $i = $item->fee ) != 0 ) { |
1145 |
$resp .= add_field( FID_CURRENCY, $item->fee_currency ); |
1145 |
$resp .= add_field( FID_CURRENCY, $item->fee_currency, $server ); |
1146 |
$resp .= add_field( FID_FEE_AMT, $i ); |
1146 |
$resp .= add_field( FID_FEE_AMT, $i, $server ); |
1147 |
} |
1147 |
} |
1148 |
$resp .= maybe_add( FID_OWNER, $item->owner ); |
1148 |
$resp .= maybe_add( FID_OWNER, $item->owner, $server ); |
1149 |
|
1149 |
|
1150 |
if ( ( $i = scalar @{ $item->hold_queue } ) > 0 ) { |
1150 |
if ( ( $i = scalar @{ $item->hold_queue } ) > 0 ) { |
1151 |
$resp .= add_field( FID_HOLD_QUEUE_LEN, $i ); |
1151 |
$resp .= add_field( FID_HOLD_QUEUE_LEN, $i, $server ); |
1152 |
} |
1152 |
} |
1153 |
if ( $item->due_date ) { |
1153 |
if ( $item->due_date ) { |
1154 |
$resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ) ); |
1154 |
$resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ), $server ); |
1155 |
} |
1155 |
} |
1156 |
if ( ( $i = $item->recall_date ) != 0 ) { |
1156 |
if ( ( $i = $item->recall_date ) != 0 ) { |
1157 |
$resp .= add_field( FID_RECALL_DATE, timestamp($i) ); |
1157 |
$resp .= add_field( FID_RECALL_DATE, timestamp($i), $server ); |
1158 |
} |
1158 |
} |
1159 |
if ( ( $i = $item->hold_pickup_date ) != 0 ) { |
1159 |
if ( ( $i = $item->hold_pickup_date ) != 0 ) { |
1160 |
$resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i) ); |
1160 |
$resp .= add_field( FID_HOLD_PICKUP_DATE, timestamp($i), $server ); |
1161 |
} |
1161 |
} |
1162 |
|
1162 |
|
1163 |
$resp .= maybe_add( FID_SCREEN_MSG, $item->screen_msg, $server ); |
1163 |
$resp .= maybe_add( FID_SCREEN_MSG, $item->screen_msg, $server, $server ); |
1164 |
$resp .= maybe_add( FID_PRINT_LINE, $item->print_line ); |
1164 |
$resp .= maybe_add( FID_PRINT_LINE, $item->print_line, $server ); |
1165 |
} |
1165 |
} |
1166 |
|
1166 |
|
1167 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1167 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
Lines 1196-1202
sub handle_item_status_update {
Link Here
|
1196 |
# Invalid Item ID |
1196 |
# Invalid Item ID |
1197 |
$resp .= '0'; |
1197 |
$resp .= '0'; |
1198 |
$resp .= timestamp; |
1198 |
$resp .= timestamp; |
1199 |
$resp .= add_field( FID_ITEM_ID, $item_id ); |
1199 |
$resp .= add_field( FID_ITEM_ID, $item_id, $server ); |
1200 |
} else { |
1200 |
} else { |
1201 |
|
1201 |
|
1202 |
# Valid Item ID |
1202 |
# Valid Item ID |
Lines 1206-1218
sub handle_item_status_update {
Link Here
|
1206 |
$resp .= $status->ok ? '1' : '0'; |
1206 |
$resp .= $status->ok ? '1' : '0'; |
1207 |
$resp .= timestamp; |
1207 |
$resp .= timestamp; |
1208 |
|
1208 |
|
1209 |
$resp .= add_field( FID_ITEM_ID, $item->id ); |
1209 |
$resp .= add_field( FID_ITEM_ID, $item->id, $server ); |
1210 |
$resp .= add_field( FID_TITLE_ID, $item->title_id ); |
1210 |
$resp .= add_field( FID_TITLE_ID, $item->title_id, $server ); |
1211 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties ); |
1211 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); |
1212 |
} |
1212 |
} |
1213 |
|
1213 |
|
1214 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1214 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
1215 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
1215 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1216 |
|
1216 |
|
1217 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1217 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1218 |
|
1218 |
|
Lines 1239-1248
sub handle_patron_enable {
Link Here
|
1239 |
|
1239 |
|
1240 |
# Invalid patron ID |
1240 |
# Invalid patron ID |
1241 |
$resp .= 'YYYY' . ( ' ' x 10 ) . '000' . timestamp(); |
1241 |
$resp .= 'YYYY' . ( ' ' x 10 ) . '000' . timestamp(); |
1242 |
$resp .= add_field( FID_PATRON_ID, $patron_id ); |
1242 |
$resp .= add_field( FID_PATRON_ID, $patron_id, $server ); |
1243 |
$resp .= add_field( FID_PERSONAL_NAME, '' ); |
1243 |
$resp .= add_field( FID_PERSONAL_NAME, '', $server ); |
1244 |
$resp .= add_field( FID_VALID_PATRON, 'N' ); |
1244 |
$resp .= add_field( FID_VALID_PATRON, 'N', $server ); |
1245 |
$resp .= add_field( FID_VALID_PATRON_PWD, 'N' ); |
1245 |
$resp .= add_field( FID_VALID_PATRON_PWD, 'N', $server ); |
1246 |
} else { |
1246 |
} else { |
1247 |
|
1247 |
|
1248 |
# valid patron |
1248 |
# valid patron |
Lines 1254-1270
sub handle_patron_enable {
Link Here
|
1254 |
$resp .= patron_status_string($patron); |
1254 |
$resp .= patron_status_string($patron); |
1255 |
$resp .= $patron->language . timestamp(); |
1255 |
$resp .= $patron->language . timestamp(); |
1256 |
|
1256 |
|
1257 |
$resp .= add_field( FID_PATRON_ID, $patron->id ); |
1257 |
$resp .= add_field( FID_PATRON_ID, $patron->id, $server ); |
1258 |
$resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) ); |
1258 |
$resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ), $server ); |
1259 |
if ( defined($patron_pwd) ) { |
1259 |
if ( defined($patron_pwd) ) { |
1260 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) ); |
1260 |
$resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ), $server ); |
1261 |
} |
1261 |
} |
1262 |
$resp .= add_field( FID_VALID_PATRON, 'Y' ); |
1262 |
$resp .= add_field( FID_VALID_PATRON, 'Y', $server ); |
1263 |
$resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg, $server ); |
1263 |
$resp .= maybe_add( FID_SCREEN_MSG, $patron->screen_msg, $server, $server ); |
1264 |
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line ); |
1264 |
$resp .= maybe_add( FID_PRINT_LINE, $patron->print_line, $server ); |
1265 |
} |
1265 |
} |
1266 |
|
1266 |
|
1267 |
$resp .= add_field( FID_INST_ID, $ils->institution ); |
1267 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1268 |
|
1268 |
|
1269 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1269 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1270 |
|
1270 |
|
Lines 1311-1333
sub handle_hold {
Link Here
|
1311 |
$resp .= timestamp; |
1311 |
$resp .= timestamp; |
1312 |
|
1312 |
|
1313 |
if ( $status->ok ) { |
1313 |
if ( $status->ok ) { |
1314 |
$resp .= add_field( FID_PATRON_ID, $status->patron->id ); |
1314 |
$resp .= add_field( FID_PATRON_ID, $status->patron->id, $server ); |
1315 |
|
1315 |
|
1316 |
( $status->expiration_date ) |
1316 |
( $status->expiration_date ) |
1317 |
and $resp .= maybe_add( FID_EXPIRATION, timestamp( $status->expiration_date ) ); |
1317 |
and $resp .= maybe_add( FID_EXPIRATION, timestamp( $status->expiration_date ), $server ); |
1318 |
$resp .= maybe_add( FID_QUEUE_POS, $status->queue_position ); |
1318 |
$resp .= maybe_add( FID_QUEUE_POS, $status->queue_position, $server ); |
1319 |
$resp .= maybe_add( FID_PICKUP_LOCN, $status->pickup_location ); |
1319 |
$resp .= maybe_add( FID_PICKUP_LOCN, $status->pickup_location, $server ); |
1320 |
$resp .= maybe_add( FID_ITEM_ID, $status->item->id ); |
1320 |
$resp .= maybe_add( FID_ITEM_ID, $status->item->id, $server ); |
1321 |
$resp .= maybe_add( FID_TITLE_ID, $status->item->title_id ); |
1321 |
$resp .= maybe_add( FID_TITLE_ID, $status->item->title_id, $server ); |
1322 |
} else { |
1322 |
} else { |
1323 |
|
1323 |
|
1324 |
# Not ok. still need required fields |
1324 |
# Not ok. still need required fields |
1325 |
$resp .= add_field( FID_PATRON_ID, $patron_id ); |
1325 |
$resp .= add_field( FID_PATRON_ID, $patron_id, $server ); |
1326 |
} |
1326 |
} |
1327 |
|
1327 |
|
1328 |
$resp .= add_field( FID_INST_ID, $ils->institution ); |
1328 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1329 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1329 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
1330 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
1330 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1331 |
|
1331 |
|
1332 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1332 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1333 |
|
1333 |
|
Lines 1374-1392
sub handle_renew {
Link Here
|
1374 |
} |
1374 |
} |
1375 |
$resp .= sipbool( $status->desensitize ); |
1375 |
$resp .= sipbool( $status->desensitize ); |
1376 |
$resp .= timestamp; |
1376 |
$resp .= timestamp; |
1377 |
$resp .= add_field( FID_PATRON_ID, $patron->id ); |
1377 |
$resp .= add_field( FID_PATRON_ID, $patron->id, $server ); |
1378 |
$resp .= add_field( FID_ITEM_ID, $item->id ); |
1378 |
$resp .= add_field( FID_ITEM_ID, $item->id, $server ); |
1379 |
$resp .= add_field( FID_TITLE_ID, $item->title_id ); |
1379 |
$resp .= add_field( FID_TITLE_ID, $item->title_id, $server ); |
1380 |
if ( $item->due_date ) { |
1380 |
if ( $item->due_date ) { |
1381 |
$resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ) ); |
1381 |
$resp .= add_field( FID_DUE_DATE, timestamp( $item->due_date ), $server ); |
1382 |
} else { |
1382 |
} else { |
1383 |
$resp .= add_field( FID_DUE_DATE, q{} ); |
1383 |
$resp .= add_field( FID_DUE_DATE, q{}, $server ); |
1384 |
} |
1384 |
} |
1385 |
if ( $ils->supports('security inhibit') ) { |
1385 |
if ( $ils->supports('security inhibit') ) { |
1386 |
$resp .= add_field( FID_SECURITY_INHIBIT, $status->security_inhibit ); |
1386 |
$resp .= add_field( FID_SECURITY_INHIBIT, $status->security_inhibit, $server ); |
1387 |
} |
1387 |
} |
1388 |
$resp .= add_field( FID_MEDIA_TYPE, $item->sip_media_type ); |
1388 |
$resp .= add_field( FID_MEDIA_TYPE, $item->sip_media_type, $server ); |
1389 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties ); |
1389 |
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server ); |
1390 |
} else { |
1390 |
} else { |
1391 |
|
1391 |
|
1392 |
# renew failed for some reason |
1392 |
# renew failed for some reason |
Lines 1397-1418
sub handle_renew {
Link Here
|
1397 |
# If we found the patron or the item, the return the ILS |
1397 |
# If we found the patron or the item, the return the ILS |
1398 |
# information, otherwise echo back the information we received |
1398 |
# information, otherwise echo back the information we received |
1399 |
# from the terminal |
1399 |
# from the terminal |
1400 |
$resp .= add_field( FID_PATRON_ID, $patron ? $patron->id : $patron_id ); |
1400 |
$resp .= add_field( FID_PATRON_ID, $patron ? $patron->id : $patron_id, $server ); |
1401 |
$resp .= add_field( FID_ITEM_ID, $item ? $item->id : $item_id ); |
1401 |
$resp .= add_field( FID_ITEM_ID, $item ? $item->id : $item_id, $server ); |
1402 |
$resp .= add_field( FID_TITLE_ID, $item ? $item->title_id : $title_id ); |
1402 |
$resp .= add_field( FID_TITLE_ID, $item ? $item->title_id : $title_id, $server ); |
1403 |
$resp .= add_field( FID_DUE_DATE, '' ); |
1403 |
$resp .= add_field( FID_DUE_DATE, '', $server ); |
1404 |
} |
1404 |
} |
1405 |
|
1405 |
|
1406 |
if ( $status->fee_amount ) { |
1406 |
if ( $status->fee_amount ) { |
1407 |
$resp .= add_field( FID_FEE_AMT, $status->fee_amount ); |
1407 |
$resp .= add_field( FID_FEE_AMT, $status->fee_amount, $server ); |
1408 |
$resp .= maybe_add( FID_CURRENCY, $status->sip_currency ); |
1408 |
$resp .= maybe_add( FID_CURRENCY, $status->sip_currency, $server ); |
1409 |
$resp .= maybe_add( FID_FEE_TYPE, $status->sip_fee_type ); |
1409 |
$resp .= maybe_add( FID_FEE_TYPE, $status->sip_fee_type, $server ); |
1410 |
$resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id ); |
1410 |
$resp .= maybe_add( FID_TRANSACTION_ID, $status->transaction_id, $server ); |
1411 |
} |
1411 |
} |
1412 |
|
1412 |
|
1413 |
$resp .= add_field( FID_INST_ID, $ils->institution ); |
1413 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1414 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1414 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
1415 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
1415 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1416 |
|
1416 |
|
1417 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1417 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1418 |
|
1418 |
|
Lines 1457-1469
sub handle_renew_all {
Link Here
|
1457 |
} |
1457 |
} |
1458 |
|
1458 |
|
1459 |
$resp .= timestamp; |
1459 |
$resp .= timestamp; |
1460 |
$resp .= add_field( FID_INST_ID, $ils->institution ); |
1460 |
$resp .= add_field( FID_INST_ID, $ils->institution, $server ); |
1461 |
|
1461 |
|
1462 |
$resp .= join( '', map( add_field( FID_RENEWED_ITEMS, $_ ), @renewed ) ); |
1462 |
$resp .= join( '', map( add_field( FID_RENEWED_ITEMS, $_ ), @renewed ), $server ); |
1463 |
$resp .= join( '', map( add_field( FID_UNRENEWED_ITEMS, $_ ), @unrenewed ) ); |
1463 |
$resp .= join( '', map( add_field( FID_UNRENEWED_ITEMS, $_ ), @unrenewed ), $server ); |
1464 |
|
1464 |
|
1465 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server ); |
1465 |
$resp .= maybe_add( FID_SCREEN_MSG, $status->screen_msg, $server, $server ); |
1466 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line ); |
1466 |
$resp .= maybe_add( FID_PRINT_LINE, $status->print_line, $server ); |
1467 |
|
1467 |
|
1468 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1468 |
$self->write_msg( $resp, undef, $server->{account}->{terminator}, $server->{account}->{encoding} ); |
1469 |
|
1469 |
|
Lines 1534-1540
sub send_acs_status {
Link Here
|
1534 |
} |
1534 |
} |
1535 |
|
1535 |
|
1536 |
# Institution ID |
1536 |
# Institution ID |
1537 |
$msg .= add_field( FID_INST_ID, $account->{institution} ); |
1537 |
$msg .= add_field( FID_INST_ID, $account->{institution}, $server ); |
1538 |
|
1538 |
|
1539 |
if ( $protocol_version >= 2 ) { |
1539 |
if ( $protocol_version >= 2 ) { |
1540 |
|
1540 |
|
Lines 1551-1560
sub send_acs_status {
Link Here
|
1551 |
if ( length($supported_msgs) < 16 ) { |
1551 |
if ( length($supported_msgs) < 16 ) { |
1552 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1552 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1553 |
} |
1553 |
} |
1554 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
1554 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs, $server ); |
1555 |
} |
1555 |
} |
1556 |
|
1556 |
|
1557 |
$msg .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server ); |
1557 |
$msg .= maybe_add( FID_SCREEN_MSG, $screen_msg, $server, $server ); |
1558 |
|
1558 |
|
1559 |
if ( defined( $account->{print_width} ) |
1559 |
if ( defined( $account->{print_width} ) |
1560 |
&& defined($print_line) |
1560 |
&& defined($print_line) |
Lines 1563-1569
sub send_acs_status {
Link Here
|
1563 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1563 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1564 |
} |
1564 |
} |
1565 |
|
1565 |
|
1566 |
$msg .= maybe_add( FID_PRINT_LINE, $print_line ); |
1566 |
$msg .= maybe_add( FID_PRINT_LINE, $print_line, $server ); |
1567 |
|
1567 |
|
1568 |
# Do we want to tell the terminal its location? |
1568 |
# Do we want to tell the terminal its location? |
1569 |
|
1569 |
|