Lines 266-279
sub new {
Link Here
|
266 |
# it's using the 2.00 login process, so it must support 2.00. |
266 |
# it's using the 2.00 login process, so it must support 2.00. |
267 |
$protocol_version = 2; |
267 |
$protocol_version = 2; |
268 |
} |
268 |
} |
269 |
syslog( "LOG_DEBUG", "Sip::MsgType::new('%s', '%s...', '%s'): seq.no '%s', protocol %s", $class, substr( $msg, 0, 10 ), $msgtag, $seqno, $protocol_version ); |
269 |
siplog( "LOG_DEBUG", "Sip::MsgType::new('%s', '%s...', '%s'): seq.no '%s', protocol %s", $class, substr( $msg, 0, 10 ), $msgtag, $seqno, $protocol_version ); |
270 |
|
270 |
|
271 |
# warn "SIP PROTOCOL: $protocol_version"; |
271 |
# warn "SIP PROTOCOL: $protocol_version"; |
272 |
if ( !exists( $handlers{$msgtag} ) ) { |
272 |
if ( !exists( $handlers{$msgtag} ) ) { |
273 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message of unknown type '%s' in '%s'", $msgtag, $msg ); |
273 |
siplog( "LOG_WARNING", "new Sip::MsgType: Skipping message of unknown type '%s' in '%s'", $msgtag, $msg ); |
274 |
return; |
274 |
return; |
275 |
} elsif ( !exists( $handlers{$msgtag}->{protocol}->{$protocol_version} ) ) { |
275 |
} elsif ( !exists( $handlers{$msgtag}->{protocol}->{$protocol_version} ) ) { |
276 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message '%s' unsupported by protocol rev. '%d'", $msgtag, $protocol_version ); |
276 |
siplog( "LOG_WARNING", "new Sip::MsgType: Skipping message '%s' unsupported by protocol rev. '%d'", $msgtag, $protocol_version ); |
277 |
return; |
277 |
return; |
278 |
} |
278 |
} |
279 |
|
279 |
|
Lines 305-311
sub _initialize {
Link Here
|
305 |
$self->{fields}->{$field} = undef; |
305 |
$self->{fields}->{$field} = undef; |
306 |
} |
306 |
} |
307 |
|
307 |
|
308 |
syslog( "LOG_DEBUG", "Sip::MsgType::_initialize('%s', '%s', '%s', '%s', ...)", $self->{name}, $msg, $proto->{template}, $proto->{template_len} ); |
308 |
siplog( "LOG_DEBUG", "Sip::MsgType::_initialize('%s', '%s', '%s', '%s', ...)", $self->{name}, $msg, $proto->{template}, $proto->{template_len} ); |
309 |
|
309 |
|
310 |
$self->{fixed_fields} = [ unpack( $proto->{template}, $msg ) ]; # see http://perldoc.perl.org/5.8.8/functions/unpack.html |
310 |
$self->{fixed_fields} = [ unpack( $proto->{template}, $msg ) ]; # see http://perldoc.perl.org/5.8.8/functions/unpack.html |
311 |
|
311 |
|
Lines 315-323
sub _initialize {
Link Here
|
315 |
$fn = substr( $field, 0, 2 ); |
315 |
$fn = substr( $field, 0, 2 ); |
316 |
|
316 |
|
317 |
if ( !exists( $self->{fields}->{$fn} ) ) { |
317 |
if ( !exists( $self->{fields}->{$fn} ) ) { |
318 |
syslog( "LOG_WARNING", "Unsupported field '%s' in %s message '%s'", $fn, $self->{name}, $msg ); |
318 |
siplog( "LOG_WARNING", "Unsupported field '%s' in %s message '%s'", $fn, $self->{name}, $msg ); |
319 |
} elsif ( defined( $self->{fields}->{$fn} ) ) { |
319 |
} elsif ( defined( $self->{fields}->{$fn} ) ) { |
320 |
syslog( "LOG_WARNING", "Duplicate field '%s' (previous value '%s') in %s message '%s'", $fn, $self->{fields}->{$fn}, $self->{name}, $msg ); |
320 |
siplog( "LOG_WARNING", "Duplicate field '%s' (previous value '%s') in %s message '%s'", $fn, $self->{fields}->{$fn}, $self->{name}, $msg ); |
321 |
} else { |
321 |
} else { |
322 |
$self->{fields}->{$fn} = substr( $field, 2 ); |
322 |
$self->{fields}->{$fn} = substr( $field, 2 ); |
323 |
} |
323 |
} |
Lines 366-372
sub handle {
Link Here
|
366 |
$error_detection = 1; |
366 |
$error_detection = 1; |
367 |
|
367 |
|
368 |
if ( !verify_cksum($msg) ) { |
368 |
if ( !verify_cksum($msg) ) { |
369 |
syslog( "LOG_WARNING", "Checksum failed on message '%s'", $msg ); |
369 |
siplog( "LOG_WARNING", "Checksum failed on message '%s'", $msg ); |
370 |
|
370 |
|
371 |
# REQUEST_SC_RESEND with error detection |
371 |
# REQUEST_SC_RESEND with error detection |
372 |
$last_response = REQUEST_SC_RESEND_CKSUM; |
372 |
$last_response = REQUEST_SC_RESEND_CKSUM; |
Lines 382-388
sub handle {
Link Here
|
382 |
|
382 |
|
383 |
# We received a non-ED message when ED is supposed to be active. |
383 |
# We received a non-ED message when ED is supposed to be active. |
384 |
# Warn about this problem, then process the message anyway. |
384 |
# Warn about this problem, then process the message anyway. |
385 |
syslog( "LOG_WARNING", "Received message without error detection: '%s'", $msg ); |
385 |
siplog( "LOG_WARNING", "Received message without error detection: '%s'", $msg ); |
386 |
$error_detection = 0; |
386 |
$error_detection = 0; |
387 |
$self = C4::SIP::Sip::MsgType->new( $msg, 0 ); |
387 |
$self = C4::SIP::Sip::MsgType->new( $msg, 0 ); |
388 |
} else { |
388 |
} else { |
Lines 395-401
sub handle {
Link Here
|
395 |
return substr( $msg, 0, 2 ); |
395 |
return substr( $msg, 0, 2 ); |
396 |
} |
396 |
} |
397 |
unless ( $self->{handler} ) { |
397 |
unless ( $self->{handler} ) { |
398 |
syslog( "LOG_WARNING", "No handler defined for '%s'", $msg ); |
398 |
siplog( "LOG_WARNING", "No handler defined for '%s'", $msg ); |
399 |
$last_response = REQUEST_SC_RESEND; |
399 |
$last_response = REQUEST_SC_RESEND; |
400 |
print("$last_response\r"); |
400 |
print("$last_response\r"); |
401 |
return REQUEST_ACS_RESEND; |
401 |
return REQUEST_ACS_RESEND; |
Lines 526-532
sub handle_checkout {
Link Here
|
526 |
|
526 |
|
527 |
# Off-line transactions need to be recorded, but there's |
527 |
# Off-line transactions need to be recorded, but there's |
528 |
# not a lot we can do about it |
528 |
# not a lot we can do about it |
529 |
syslog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); |
529 |
siplog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); |
530 |
|
530 |
|
531 |
$status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); |
531 |
$status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); |
532 |
} else { |
532 |
} else { |
Lines 653-659
sub handle_checkin {
Link Here
|
653 |
if ( $no_block eq 'Y' ) { |
653 |
if ( $no_block eq 'Y' ) { |
654 |
|
654 |
|
655 |
# Off-line transactions, ick. |
655 |
# Off-line transactions, ick. |
656 |
syslog( "LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id} ); |
656 |
siplog( "LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id} ); |
657 |
$status = $ils->checkin_no_block( $item_id, $trans_date, $return_date, $item_props, $cancel ); |
657 |
$status = $ils->checkin_no_block( $item_id, $trans_date, $return_date, $item_props, $cancel ); |
658 |
} else { |
658 |
} else { |
659 |
$status = $ils->checkin( $item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel, $account->{checked_in_ok}, $account->{cv_triggers_alert} ); |
659 |
$status = $ils->checkin( $item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel, $account->{checked_in_ok}, $account->{cv_triggers_alert} ); |
Lines 772-790
sub handle_sc_status {
Link Here
|
772 |
} elsif ( $sc_protocol_version =~ /^2\./ ) { |
772 |
} elsif ( $sc_protocol_version =~ /^2\./ ) { |
773 |
$new_proto = 2; |
773 |
$new_proto = 2; |
774 |
} else { |
774 |
} else { |
775 |
syslog( "LOG_WARNING", "Unrecognized protocol revision '%s', falling back to '1'", $sc_protocol_version ); |
775 |
siplog( "LOG_WARNING", "Unrecognized protocol revision '%s', falling back to '1'", $sc_protocol_version ); |
776 |
$new_proto = 1; |
776 |
$new_proto = 1; |
777 |
} |
777 |
} |
778 |
|
778 |
|
779 |
if ( $new_proto != $protocol_version ) { |
779 |
if ( $new_proto != $protocol_version ) { |
780 |
syslog( "LOG_INFO", "Setting protocol level to $new_proto" ); |
780 |
siplog( "LOG_INFO", "Setting protocol level to $new_proto" ); |
781 |
$protocol_version = $new_proto; |
781 |
$protocol_version = $new_proto; |
782 |
} |
782 |
} |
783 |
|
783 |
|
784 |
if ( $status == SC_STATUS_PAPER ) { |
784 |
if ( $status == SC_STATUS_PAPER ) { |
785 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' out of paper", $self->{account}->{id}, $self->{account}->{institution} ); |
785 |
siplog( "LOG_WARNING", "Self-Check unit '%s@%s' out of paper", $self->{account}->{id}, $self->{account}->{institution} ); |
786 |
} elsif ( $status == SC_STATUS_SHUTDOWN ) { |
786 |
} elsif ( $status == SC_STATUS_SHUTDOWN ) { |
787 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' shutting down", $self->{account}->{id}, $self->{account}->{institution} ); |
787 |
siplog( "LOG_WARNING", "Self-Check unit '%s@%s' shutting down", $self->{account}->{id}, $self->{account}->{institution} ); |
788 |
} |
788 |
} |
789 |
|
789 |
|
790 |
$self->{account}->{print_width} = $print_width; |
790 |
$self->{account}->{print_width} = $print_width; |
Lines 824-833
sub login_core {
Link Here
|
824 |
my $pwd = shift; |
824 |
my $pwd = shift; |
825 |
my $status = 1; # Assume it all works |
825 |
my $status = 1; # Assume it all works |
826 |
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) { |
826 |
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) { |
827 |
syslog( "LOG_WARNING", "MsgType::login_core: Unknown login '$uid'" ); |
827 |
siplog( "LOG_WARNING", "MsgType::login_core: Unknown login '$uid'" ); |
828 |
$status = 0; |
828 |
$status = 0; |
829 |
} elsif ( $server->{config}->{accounts}->{$uid}->{password} ne $pwd ) { |
829 |
} elsif ( $server->{config}->{accounts}->{$uid}->{password} ne $pwd ) { |
830 |
syslog( "LOG_WARNING", "MsgType::login_core: Invalid password for login '$uid'" ); |
830 |
siplog( "LOG_WARNING", "MsgType::login_core: Invalid password for login '$uid'" ); |
831 |
$status = 0; |
831 |
$status = 0; |
832 |
} else { |
832 |
} else { |
833 |
|
833 |
|
Lines 841-856
sub login_core {
Link Here
|
841 |
|
841 |
|
842 |
my $auth_status = api_auth( $uid, $pwd, $inst ); |
842 |
my $auth_status = api_auth( $uid, $pwd, $inst ); |
843 |
if ( !$auth_status or $auth_status !~ /^ok$/i ) { |
843 |
if ( !$auth_status or $auth_status !~ /^ok$/i ) { |
844 |
syslog( "LOG_WARNING", "api_auth failed for SIP terminal '%s' of '%s': %s", $uid, $inst, ( $auth_status || 'unknown' ) ); |
844 |
siplog( "LOG_WARNING", "api_auth failed for SIP terminal '%s' of '%s': %s", $uid, $inst, ( $auth_status || 'unknown' ) ); |
845 |
$status = 0; |
845 |
$status = 0; |
846 |
} else { |
846 |
} else { |
847 |
syslog( "LOG_INFO", "Successful login/auth for '%s' of '%s'", $server->{account}->{id}, $inst ); |
847 |
siplog( "LOG_INFO", "Successful login/auth for '%s' of '%s'", $server->{account}->{id}, $inst ); |
848 |
|
848 |
|
849 |
# |
849 |
# |
850 |
# initialize connection to ILS |
850 |
# initialize connection to ILS |
851 |
# |
851 |
# |
852 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
852 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
853 |
syslog( "LOG_DEBUG", 'login_core: ' . Dumper($module) ); |
853 |
siplog( "LOG_DEBUG", 'login_core: ' . Dumper($module) ); |
854 |
|
854 |
|
855 |
# Suspect this is always ILS but so we don't break any eccentic install (for now) |
855 |
# Suspect this is always ILS but so we don't break any eccentic install (for now) |
856 |
if ( $module eq 'ILS' ) { |
856 |
if ( $module eq 'ILS' ) { |
Lines 858-871
sub login_core {
Link Here
|
858 |
} |
858 |
} |
859 |
$module->use; |
859 |
$module->use; |
860 |
if ($@) { |
860 |
if ($@) { |
861 |
syslog( "LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", $server->{service}, $module, $inst ); |
861 |
siplog( "LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", $server->{service}, $module, $inst ); |
862 |
die("Failed to load ILS implementation '$module' for $inst"); |
862 |
die("Failed to load ILS implementation '$module' for $inst"); |
863 |
} |
863 |
} |
864 |
|
864 |
|
865 |
# like ILS->new(), I think. |
865 |
# like ILS->new(), I think. |
866 |
$server->{ils} = $module->new( $server->{institution}, $server->{account} ); |
866 |
$server->{ils} = $module->new( $server->{institution}, $server->{account} ); |
867 |
if ( !$server->{ils} ) { |
867 |
if ( !$server->{ils} ) { |
868 |
syslog( "LOG_ERR", "%s: ILS connection to '%s' failed", $server->{service}, $inst ); |
868 |
siplog( "LOG_ERR", "%s: ILS connection to '%s' failed", $server->{service}, $inst ); |
869 |
die("Unable to connect to ILS '$inst'"); |
869 |
die("Unable to connect to ILS '$inst'"); |
870 |
} |
870 |
} |
871 |
} |
871 |
} |
Lines 888-894
sub handle_login {
Link Here
|
888 |
$pwd = $fields->{ (FID_LOGIN_PWD) }; # Terminal PWD, not patron PWD. |
888 |
$pwd = $fields->{ (FID_LOGIN_PWD) }; # Terminal PWD, not patron PWD. |
889 |
|
889 |
|
890 |
if ( $uid_algorithm || $pwd_algorithm ) { |
890 |
if ( $uid_algorithm || $pwd_algorithm ) { |
891 |
syslog( "LOG_ERR", "LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm" ); |
891 |
siplog( "LOG_ERR", "LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm" ); |
892 |
$status = 0; |
892 |
$status = 0; |
893 |
} else { |
893 |
} else { |
894 |
$status = login_core( $server, $uid, $pwd ); |
894 |
$status = login_core( $server, $uid, $pwd ); |
Lines 927-939
sub summary_info {
Link Here
|
927 |
return ''; # No detailed information required |
927 |
return ''; # No detailed information required |
928 |
} |
928 |
} |
929 |
|
929 |
|
930 |
syslog( "LOG_DEBUG", "Summary_info: index == '%d', field '%s'", $summary_type, $summary_map[$summary_type]->{fid} ); |
930 |
siplog( "LOG_DEBUG", "Summary_info: index == '%d', field '%s'", $summary_type, $summary_map[$summary_type]->{fid} ); |
931 |
|
931 |
|
932 |
my $func = $summary_map[$summary_type]->{func}; |
932 |
my $func = $summary_map[$summary_type]->{func}; |
933 |
my $fid = $summary_map[$summary_type]->{fid}; |
933 |
my $fid = $summary_map[$summary_type]->{fid}; |
934 |
my $itemlist = &$func( $patron, $start, $end, $server ); |
934 |
my $itemlist = &$func( $patron, $start, $end, $server ); |
935 |
|
935 |
|
936 |
syslog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", map{ $_->{barcode} } @{$itemlist} ) ); |
936 |
siplog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", map{ $_->{barcode} } @{$itemlist} ) ); |
937 |
foreach my $i ( @{$itemlist} ) { |
937 |
foreach my $i ( @{$itemlist} ) { |
938 |
$resp .= add_field( $fid, $i->{barcode}, $server ); |
938 |
$resp .= add_field( $fid, $i->{barcode}, $server ); |
939 |
} |
939 |
} |
Lines 1256-1262
sub handle_item_status_update {
Link Here
|
1256 |
$item_props = $fields->{ (FID_ITEM_PROPS) }; |
1256 |
$item_props = $fields->{ (FID_ITEM_PROPS) }; |
1257 |
|
1257 |
|
1258 |
if ( !defined($item_id) ) { |
1258 |
if ( !defined($item_id) ) { |
1259 |
syslog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
1259 |
siplog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
1260 |
} else { |
1260 |
} else { |
1261 |
$item = $ils->find_item($item_id); |
1261 |
$item = $ils->find_item($item_id); |
1262 |
} |
1262 |
} |
Lines 1301-1307
sub handle_patron_enable {
Link Here
|
1301 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1301 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1302 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1302 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1303 |
|
1303 |
|
1304 |
syslog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
1304 |
siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
1305 |
|
1305 |
|
1306 |
$patron = $ils->find_patron($patron_id); |
1306 |
$patron = $ils->find_patron($patron_id); |
1307 |
|
1307 |
|
Lines 1371-1377
sub handle_hold {
Link Here
|
1371 |
} elsif ( $hold_mode eq '*' ) { |
1371 |
} elsif ( $hold_mode eq '*' ) { |
1372 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1372 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1373 |
} else { |
1373 |
} else { |
1374 |
syslog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
1374 |
siplog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
1375 |
$status = $ils->Transaction::Hold; # new? |
1375 |
$status = $ils->Transaction::Hold; # new? |
1376 |
$status->screen_msg("System error. Please contact library staff."); |
1376 |
$status->screen_msg("System error. Please contact library staff."); |
1377 |
} |
1377 |
} |
Lines 1419-1425
sub handle_renew {
Link Here
|
1419 |
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_renew" ); |
1419 |
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_renew" ); |
1420 |
|
1420 |
|
1421 |
if ( $no_block eq 'Y' ) { |
1421 |
if ( $no_block eq 'Y' ) { |
1422 |
syslog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
1422 |
siplog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
1423 |
} |
1423 |
} |
1424 |
|
1424 |
|
1425 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1425 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
Lines 1586-1592
sub send_acs_status {
Link Here
|
1586 |
$retries = sprintf( "%03d", $policy->{retries} ); |
1586 |
$retries = sprintf( "%03d", $policy->{retries} ); |
1587 |
|
1587 |
|
1588 |
if ( length($retries) != 3 ) { |
1588 |
if ( length($retries) != 3 ) { |
1589 |
syslog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
1589 |
siplog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
1590 |
$retries = '000'; |
1590 |
$retries = '000'; |
1591 |
} |
1591 |
} |
1592 |
|
1592 |
|
Lines 1599-1605
sub send_acs_status {
Link Here
|
1599 |
} elsif ( $protocol_version == 2 ) { |
1599 |
} elsif ( $protocol_version == 2 ) { |
1600 |
$msg .= '2.00'; |
1600 |
$msg .= '2.00'; |
1601 |
} else { |
1601 |
} else { |
1602 |
syslog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
1602 |
siplog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
1603 |
$msg .= '1.00'; |
1603 |
$msg .= '1.00'; |
1604 |
} |
1604 |
} |
1605 |
|
1605 |
|
Lines 1619-1625
sub send_acs_status {
Link Here
|
1619 |
} |
1619 |
} |
1620 |
} |
1620 |
} |
1621 |
if ( length($supported_msgs) < 16 ) { |
1621 |
if ( length($supported_msgs) < 16 ) { |
1622 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1622 |
siplog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1623 |
} |
1623 |
} |
1624 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs, $server ); |
1624 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs, $server ); |
1625 |
} |
1625 |
} |
Lines 1629-1635
sub send_acs_status {
Link Here
|
1629 |
if ( defined( $account->{print_width} ) |
1629 |
if ( defined( $account->{print_width} ) |
1630 |
&& defined($print_line) |
1630 |
&& defined($print_line) |
1631 |
&& $account->{print_width} < length($print_line) ) { |
1631 |
&& $account->{print_width} < length($print_line) ) { |
1632 |
syslog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
1632 |
siplog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
1633 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1633 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1634 |
} |
1634 |
} |
1635 |
|
1635 |
|
Lines 1649-1655
sub patron_status_string {
Link Here
|
1649 |
my $patron = shift; |
1649 |
my $patron = shift; |
1650 |
my $patron_status; |
1650 |
my $patron_status; |
1651 |
|
1651 |
|
1652 |
syslog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
1652 |
siplog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
1653 |
$patron_status = sprintf( |
1653 |
$patron_status = sprintf( |
1654 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |
1654 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |
1655 |
denied( $patron->charge_ok ), |
1655 |
denied( $patron->charge_ok ), |
1656 |
- |
|
|