LP#1842297: Add barcode attribute
authoroajulianclementson <51331324+oajulianclementson@users.noreply.github.com>
Wed, 8 Sep 2021 19:01:32 +0000 (20:01 +0100)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 15 Aug 2022 18:20:10 +0000 (14:20 -0400)
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.html
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.openathens_identity.sql
docs/RELEASE_NOTES_NEXT/Administration/OpenAthens_SignOn.adoc

index d30f715..a609dca 100644 (file)
@@ -15542,6 +15542,7 @@ SELECT  usr,
                        <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
                        <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
                        <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
+                       <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
                </fields>
                <links>
                        <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
index d0fb001..5c6b7d4 100644 (file)
@@ -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"
 ></eg-fm-record-editor>
index 7bca2db..cf15e03 100644 (file)
@@ -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) {
index 56bf2e8..2bf1624 100644 (file)
@@ -1401,11 +1401,19 @@ CREATE TABLE config.ui_staff_portal_page_entry (
     owner       INT NOT NULL -- REFERENCES actor.org_unit (id)
 );
 
+-- 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 (
@@ -1413,12 +1421,20 @@ CREATE TABLE config.openathens_name_field (
     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,
+    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,
@@ -1432,7 +1448,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;
index e43010d..118a4fb 100644 (file)
@@ -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;
index 7060645..87ed3f0 100644 (file)
@@ -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