LP#1904593: new library setting for My Account URL
authorRogan Hamby <rogan.hamby@gmail.com>
Fri, 19 Feb 2021 13:55:12 +0000 (08:55 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 20 Sep 2021 16:20:59 +0000 (12:20 -0400)
This adds a library setting parallel to lib.info_url
that can be used to include a link to the My Account
page on receipts and A/T output.

Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Jennifer Bruch <jbruch@sparkpa.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/xxxx.data.my_account_url_yaous.sql [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/services/print.js
docs/RELEASE_NOTES_NEXT/Circulation/m_account_url.adoc [new file with mode: 0644]

index 47dc807..318f849 100644 (file)
@@ -216,6 +216,11 @@ $helpers = {
         return new_editor()->retrieve_actor_org_unit($org_id);
     },
 
+    get_org_setting => sub {
+        my($org_id, $setting) = @_;
+        return $U->ou_ancestor_setting_value($org_id, $setting);
+    },
+
 };
 
 
index ab4ada2..3f5bf12 100644 (file)
@@ -5772,6 +5772,14 @@ INSERT into config.org_unit_setting_type
         'The Photo URL field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.',
         'coust', 'description'),
     'bool', null)
+,( 'lib.my_account_url', 'lib',
+    oils_i18n_gettext('lib.my_account_url',
+        'My Account URL (such as "https://example.com/eg/opac/login")',
+        'coust', 'label'),
+    oils_i18n_gettext('lib.my_account_url',
+        'URL for a My Account link. Use a complete URL, such as "https://example.com/eg/opac/login".',
+        'coust', 'description'),
+    'string', null)
 ;
 
 UPDATE config.org_unit_setting_type
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.data.my_account_url_yaous.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.my_account_url_yaous.sql
new file mode 100644 (file)
index 0000000..bfc6919
--- /dev/null
@@ -0,0 +1,17 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('xxxx', :eg_version);
+
+ INSERT into config.org_unit_setting_type
+ ( name, grp, label, description, datatype, fm_class ) VALUES
+ ( 'lib.my_account_url', 'lib',
+     oils_i18n_gettext('lib.my_account_url',
+         'My Account URL (such as "https://example.com/eg/opac/login")',
+         'coust', 'label'),
+     oils_i18n_gettext('lib.my_account_url',
+         'URL for a My Account link. Use a complete URL, such as "https://example.com/eg/opac/login".',
+         'coust', 'description'),
+     'string', null)
+ ;
+
+COMMIT;
index 0345f73..7cdf915 100644 (file)
@@ -14,10 +14,12 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg , eg
             'circ.staff_client.receipt.event_text',
             'circ.staff_client.receipt.footer_text',
             'circ.staff_client.receipt.header_text',
-            'circ.staff_client.receipt.notice_text'
+            'circ.staff_client.receipt.notice_text',
+            'lib.info_url',
+            'lib.my_account_url'
         ]
     };
-
+    color.log("service",service);
 
     service.template_base_path = 'share/print_templates/t_';
 
diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/m_account_url.adoc b/docs/RELEASE_NOTES_NEXT/Circulation/m_account_url.adoc
new file mode 100644 (file)
index 0000000..ac7d82c
--- /dev/null
@@ -0,0 +1,16 @@
+== Template Support for Information and My Account URLs ==
+
+A new setting has been added named lib.my_account_url to provide a path usable in templates to a patron's account login.  Both this and the existing lib.info_url settings are now available in the server side processed templates, action triggers and traditional print receipts.
+
+Web side processed templates in 3.6 can be found in Administration -> Server Administration -> Print Templates.  
+You can add settings using the following syntax:
+<div>[% helpers.get_org_setting(staff_org.id, 'lib.info_url'); %]</div>
+<div>[% helpers.get_org_setting(staff_org.id, 'lib.my_account_url'); %]</div>
+
+Print Receipts found in Administration -> Workstation -> Print Templates can be added with these includes:
+{{includes.info_url}}
+{{includes.my_account_url}}
+
+Action triggers can use both values with the helpers.get_org_setting include.  Example:
+[% helpers.get_org_setting(circ_lib.id, 'lib.my_account_url') %]
+