From c92a33635395549042e4137d8d1e6e5203b498c5 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Fri, 19 Feb 2021 08:55:12 -0500 Subject: [PATCH] LP#1904593: new library setting for My Account URL 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 Signed-off-by: Jennifer Bruch Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm | 5 +++++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 8 ++++++++ .../sql/Pg/upgrade/xxxx.data.my_account_url_yaous.sql | 17 +++++++++++++++++ Open-ILS/web/js/ui/default/staff/services/print.js | 6 ++++-- docs/RELEASE_NOTES_NEXT/Circulation/m_account_url.adoc | 16 ++++++++++++++++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.data.my_account_url_yaous.sql create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/m_account_url.adoc diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm index 47dc807c29..318f849acf 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/PrintTemplate.pm @@ -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); + }, + }; diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index ab4ada2b06..3f5bf12c00 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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 index 0000000000..bfc6919a95 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.data.my_account_url_yaous.sql @@ -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; diff --git a/Open-ILS/web/js/ui/default/staff/services/print.js b/Open-ILS/web/js/ui/default/staff/services/print.js index 0345f73731..7cdf9158ed 100644 --- a/Open-ILS/web/js/ui/default/staff/services/print.js +++ b/Open-ILS/web/js/ui/default/staff/services/print.js @@ -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 index 0000000000..ac7d82c31b --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Circulation/m_account_url.adoc @@ -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: +
[% helpers.get_org_setting(staff_org.id, 'lib.info_url'); %]
+
[% helpers.get_org_setting(staff_org.id, 'lib.my_account_url'); %]
+ +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') %] + -- 2.11.0