From 2a2fcf40455c7892fcb9e8f5e82af837a058f054 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 6 Jan 2014 14:33:04 -0500 Subject: [PATCH] Copy details link to Evergreen library page by default Add a new library setting, 'lib.prefer_external_url', to force library names in copy details pages to link to their associated 'lib.info_url' setting rather than the Evergreen-generated page. In the absence of a 'lib.info_url' setting, the name will fall back to being linked to the Evergreen-generated page. Per discussion with Ben Shum and Kathy Lussier. Signed-off-by: Dan Scott Signed-off-by: Dan Wells --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 11 ++++++++++- .../src/templates/opac/parts/record/copy_table.tt2 | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) 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 e0912da2b5..86af666514 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -3901,10 +3901,19 @@ INSERT into config.org_unit_setting_type 'Library information URL (such as "http://example.com/about.html")', 'coust', 'label'), oils_i18n_gettext('lib.info_url', - 'URL for information on this library, such as contact information, hours of operation, and directions. If set, the library name in the copy details section links to that URL. Use a complete URL, such as "http://example.com/hours.html".', + 'URL for information on this library, such as contact information, hours of operation, and directions. Use a complete URL, such as "http://example.com/hours.html".', 'coust', 'description'), 'string', null) +,( 'lib.prefer_external_url', 'lib', + oils_i18n_gettext('lib.prefer_external_url', + 'Use external "library information URL" in copy table, if available', + 'coust', 'label'), + oils_i18n_gettext('lib.prefer_external_url', + 'If set to true, the library name in the copy details section will link to the URL associated with the "Library information URL" library setting rather than the library information page generated by Evergreen.', + 'coust', 'description'), + 'bool', null) + ,( 'notice.telephony.callfile_lines', 'lib', oils_i18n_gettext('notice.telephony.callfile_lines', 'Telephony: Arbitrary line(s) to include in each notice callfile', diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 index 736ee0673f..be0d62c3bf 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -98,7 +98,8 @@ END; # FOREACH bib org_name = ctx.get_aou(copy_info.circ_lib).name; org_sname = ctx.get_aou(copy_info.circ_lib).shortname; lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url'); - UNLESS lib_url; + prefer_external_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.prefer_external_url'); + UNLESS lib_url && prefer_external_url; lib_url = mkurl(ctx.opac_root _ '/library/' _ ctx.get_aou(copy_info.circ_lib).shortname, {}, 1); END; IF lib_url; ''; END; -- 2.43.2