From: Jason Boyer Date: Mon, 9 Sep 2019 14:43:07 +0000 (-0400) Subject: LP1613335: OK in Patron Status Screen Message X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=17aaed5c01c892bad618f1b2a4d61e2a9c5f51ef;p=working%2FEvergreen.git LP1613335: OK in Patron Status Screen Message Conditionally return a screen message of OK if the client expects it, otherwise there will be no screen message for a user in good standing. Signed-off-by: Jason Boyer --- diff --git a/Open-ILS/examples/oils_sip.xml.example b/Open-ILS/examples/oils_sip.xml.example index 57ebda4596..aa9008ca99 100644 --- a/Open-ILS/examples/oils_sip.xml.example +++ b/Open-ILS/examples/oils_sip.xml.example @@ -30,6 +30,7 @@ + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm index 500efa22bc..7529f2ddf6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP.pm @@ -250,9 +250,11 @@ sub find_patron { my $self = shift; my $key = (@_ > 1) ? shift : 'barcode'; # if we have multiple args, the first is the key index (default barcode) my $patron_id = shift; + # want_patron_ok is per-login depending on the needs of your selfcheck or PC management systems. + my $want_patron_ok = ( $self->{login}->{want_patron_ok} && $self->{login}->{want_patron_ok} =~ /true|yes|enabled/i ); $self->verify_session; - return OpenILS::SIP::Patron->new($key => $patron_id, authtoken => $self->{authtoken}, @_); + return OpenILS::SIP::Patron->new($key => $patron_id, authtoken => $self->{authtoken}, want_ok => $want_patron_ok, @_); } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index 3b458cb784..4c9e538cc2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -118,6 +118,9 @@ sub new { $self->{id} = ($key eq 'barcode') ? $patron_id : $user->card->barcode; # The barcode IS the ID to SIP. # We give back the passed barcode if the key was indeed a barcode, just to be safe. Otherwise pull it from the card. + # Return 'OK' in the screen message? Likely used primarily by PC management systems. + $self->{want_ok} = $args{want_ok}; + syslog("LOG_DEBUG", "OILS: new OpenILS Patron(%s => %s): found patron : barred=%s, card:active=%s", $key, $patron_id, $user->barred, $user->card->active ); @@ -453,7 +456,7 @@ sub screen_msg { my $expire = DateTime::Format::ISO8601->new->parse_datetime(clean_ISO8601($u->expire_date)); return $b if CORE::time > $expire->epoch; - return ''; + return ($self->{want_ok} ? 'OK' : ''); } sub print_line { # not implemented