Copy details link to Evergreen library page by default
authorDan Scott <dscott@laurentian.ca>
Mon, 6 Jan 2014 19:33:04 +0000 (14:33 -0500)
committerDan Wells <dbw2@calvin.edu>
Tue, 21 Jan 2014 19:57:42 +0000 (14:57 -0500)
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 <dscott@laurentian.ca>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index e0912da..86af666 100644 (file)
@@ -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',
index 736ee06..be0d62c 100644 (file)
@@ -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; '<a property="seller" typeof="Library" href="'; lib_url | url; '">'; END;