From: oajulianclementson <51331324+oajulianclementson@users.noreply.github.com>
Date: Wed, 8 Sep 2021 19:01:32 +0000 (+0100)
Subject: LP#1842297: Add barcode attribute
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=620cd773bc899668f423f7274695604755b601b4;p=evergreen%2Fpines.git
LP#1842297: Add barcode attribute
---
diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index baac96feaf..4594203dba 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -13608,6 +13608,7 @@ SELECT usr,
+
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.html
index d0fb001954..5c6b7d4769 100644
--- a/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.html
@@ -57,5 +57,5 @@
idlClass="{{idlClass}}"
[preloadLinkedValues]="true"
[fieldOptions]="{owning_lib_filter:{customTemplate:{template:orgTemplate}}}"
- fieldOrder="id,org_unit,active,api_key,connection_id,connection_uri,auto_signon_enabled,auto_signout_enabled,unique_identifier,display_name,release_prefix,release_first_given_name,release_second_given_name,release_family_name,release_suffix,release_email,release_home_ou"
+ fieldOrder="id,org_unit,active,api_key,connection_id,connection_uri,auto_signon_enabled,auto_signout_enabled,unique_identifier,display_name,release_prefix,release_first_given_name,release_second_given_name,release_family_name,release_suffix,release_email,release_home_ou,release_barcode"
>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm
index 7bca2db831..cf15e0349b 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm
@@ -17,6 +17,7 @@ use constant OA_ATTR_FAMILY_NAME => 'family_name';
use constant OA_ATTR_SUFFIX => 'suffix';
use constant OA_ATTR_EMAIL => 'email';
use constant OA_ATTR_HOME_OU => 'home_ou';
+use constant OA_ATTR_BARCODE => 'barcode';
use constant OA_SIGNOUT_URL => 'https://login.openathens.net/signout';
use constant OA_SESSION_REQUEST_TYPE =>
'application/vnd.eduserv.iam.auth.localAccountSessionRequest+json';
@@ -24,7 +25,7 @@ use constant OA_SESSION_REQUEST_TYPE =>
my @oa_config_fields = qw/active api_key connection_id connection_uri
auto_signon_enabled auto_signout_enabled release_prefix
release_first_given_name release_second_given_name release_family_name
- release_suffix release_email release_home_ou/;
+ release_suffix release_email release_home_ou release_barcode/;
# -----------------------------------------------------------------------------
@@ -325,6 +326,10 @@ sub _get_openathens_session_initiator_url {
}
}
+ if ($U->is_true($openathens_config->{release_barcode})) {
+ $request_obj->{attributes}->{&OA_ATTR_BARCODE} = $ctx->{active_card};
+ }
+
if ($return_url) {
$request_obj->{returnUrl} = $return_url;
} elsif ($return_data) {
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index c7fd0032e2..1c8a29a9d8 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -1374,4 +1374,55 @@ VALUES
SELECT SETVAL('config.carousel_type_id_seq'::TEXT, 100);
+-- Add OpenAthens Integration
+CREATE TABLE config.openathens_uid_field (
+ id SERIAL PRIMARY KEY,
+ name TEXT NOT NULL
+);
+
+INSERT INTO config.openathens_uid_field
+ (id, name)
+VALUES
+ (1,'id'),
+ (2,'usrname')
+;
+
+SELECT SETVAL('config.openathens_uid_field_id_seq'::TEXT, 100);
+
+CREATE TABLE config.openathens_name_field (
+ id SERIAL PRIMARY KEY,
+ name TEXT NOT NULL
+);
+
+INSERT INTO config.openathens_name_field
+ (id, name)
+VALUES
+ (1,'id'),
+ (2,'usrname'),
+ (3,'fullname')
+;
+
+SELECT SETVAL('config.openathens_name_field_id_seq'::TEXT, 100);
+
+CREATE TABLE config.openathens_identity (
+ id SERIAL PRIMARY KEY,
+ active BOOL NOT NULL DEFAULT true,
+ org_unit INT NOT NULL, -- REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ api_key TEXT NOT NULL,
+ connection_id TEXT NOT NULL,
+ connection_uri TEXT NOT NULL,
+ auto_signon_enabled BOOL NOT NULL DEFAULT true,
+ auto_signout_enabled BOOL NOT NULL DEFAULT false,
+ unique_identifier INT NOT NULL REFERENCES config.openathens_uid_field (id) DEFAULT 1,
+ display_name INT NOT NULL REFERENCES config.openathens_name_field (id) DEFAULT 1,
+ release_prefix BOOL NOT NULL DEFAULT false,
+ release_first_given_name BOOL NOT NULL DEFAULT false,
+ release_second_given_name BOOL NOT NULL DEFAULT false,
+ release_family_name BOOL NOT NULL DEFAULT false,
+ release_suffix BOOL NOT NULL DEFAULT false,
+ release_email BOOL NOT NULL DEFAULT false,
+ release_home_ou BOOL NOT NULL DEFAULT false,
+ release_barcode BOOL NOT NULL DEFAULT false
+);
+
COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql
index e43010d478..118a4fbb95 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql
@@ -48,7 +48,8 @@ CREATE TABLE config.openathens_identity (
release_family_name BOOL NOT NULL DEFAULT false,
release_suffix BOOL NOT NULL DEFAULT false,
release_email BOOL NOT NULL DEFAULT false,
- release_home_ou BOOL NOT NULL DEFAULT false
+ release_home_ou BOOL NOT NULL DEFAULT false,
+ release_barcode BOOL NOT NULL DEFAULT false
);
COMMIT;
diff --git a/docs/RELEASE_NOTES_NEXT/Administration/OpenAthens_SignOn.adoc b/docs/RELEASE_NOTES_NEXT/Administration/OpenAthens_SignOn.adoc
index 7060645c87..87ed3f06f0 100644
--- a/docs/RELEASE_NOTES_NEXT/Administration/OpenAthens_SignOn.adoc
+++ b/docs/RELEASE_NOTES_NEXT/Administration/OpenAthens_SignOn.adoc
@@ -137,6 +137,10 @@ implementation partner.
|home_ou
|the _shortcode_ of the patron's home library (e.g. 'BR1' in the Concerto
sample data set)
+
+|Release barcode
+|barcode
+|the patron's barcode
|===
Network access