Following a suggestion from Bill Erickson, the SIP->get_ou_settings()
function now uses the workstation org. unit of the logged in SIP2
account if it is set. The home_ou is used as a fallback.
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
my $self = shift;
my $setting = shift;
my $sess = $self->fetch_session;
- return $U->ou_ancestor_setting_value($sess->home_ou, $setting);
+ my $ou = (ref($sess->home_ou)) ? $sess->home_ou->id : $sess->home_ou;
+ if ($sess->ws_ou) {
+ $ou = (ref($sess->ws_ou)) ? $sess->ws_ou->id : $sess->ws_ou;
+ }
+ return $U->ou_ancestor_setting_value($ou, $setting);
}
sub get_barcode_regex {
The new feature determines if the value in the Patron ID field is a
barcode or username by comparing the field value against the
-`opac.barcode_regex` setting for the home organizational unit of the
-logged in SIP2 account as configured in the oils_sip.xml file. This
-is similar to what the OPAC does when a patron logs in.
+`opac.barcode_regex` setting for the organizational unit of the logged
+in SIP2 account as configured in the oils_sip.xml file. This is
+similar to what the OPAC does when a patron logs in.