From: Dan Scott Date: Mon, 8 Jul 2013 18:06:48 +0000 (-0400) Subject: Support linking to library info from copy display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=78e5128e8c7f11c425ea9f01746a24e51f9493ed;p=working%2FEvergreen.git Support linking to library info from copy display If the "Library information URL" library setting has a value, then the copy display section of the TPAC and KPAC will turn the library name for that branch into a link to the given URL. This supports the patron goal of quickly finding branch information such as hours of operation, directions, and contact information. Signed-off-by: Dan Scott Signed-off-by: Kathy Lussier --- 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 f6a42f45ec..fb3b637c3d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -3831,6 +3831,15 @@ INSERT into config.org_unit_setting_type 'coust', 'description'), 'string', null) +,( 'lib.info_url', 'lib', + oils_i18n_gettext('lib.info_url', + '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".', + 'coust', 'description'), + 'string', 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/sql/Pg/upgrade/XXXX.add_library_info_url_OUS.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.add_library_info_url_OUS.sql new file mode 100644 index 0000000000..623539bf38 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.add_library_info_url_OUS.sql @@ -0,0 +1,11 @@ +INSERT into config.org_unit_setting_type +( name, grp, label, description, datatype, fm_class ) VALUES +( 'lib.info_url', 'lib', + oils_i18n_gettext('lib.info_url', + '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".', + 'coust', 'description'), + 'string', null) +; diff --git a/Open-ILS/src/templates/kpac/parts/copy_table.tt2 b/Open-ILS/src/templates/kpac/parts/copy_table.tt2 index 7939987e9b..58fc329683 100644 --- a/Open-ILS/src/templates/kpac/parts/copy_table.tt2 +++ b/Open-ILS/src/templates/kpac/parts/copy_table.tt2 @@ -36,7 +36,15 @@ END; END; -%] - [% ctx.get_aou(copy_info.circ_lib).name | html %] + + [%- + org_name = ctx.get_aou(copy_info.circ_lib).name; + lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url'); + IF lib_url; ''; END; + org_name | html; + IF lib_url; ''; END; + -%] + [%- IF has_parts == 'true' %] [% l('[_1] ([_2])', callnum, copy_info.part_label) | html %] [% ELSE %] diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 63d6b44114..5c18d60a96 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -351,14 +351,16 @@ status = copy.findnodes('./*[local-name()="status"]'); NEXT IF status.getAttribute('opac_visible') == 'false'; + # extract the circ_lib id from the circ_lib node + circ_lib = copy.findnodes('./*[local-name()="circ_lib"]'); + circ_lib_id = circ_lib.getAttribute('id').replace('.*/', ''); + UNLESS ou_hiding_disabled; - # extract the circ_lib id from the circ_lib node - circ_lib = copy.findnodes('./*[local-name()="circ_lib"]'); - circ_lib_id = circ_lib.getAttribute('id').replace('.*/', ''); NEXT UNLESS ctx.org_within_hiding_scope(circ_lib_id); END; holding = { + circ_lib => circ_lib_id, label => vol.label, part_label => part_label, location => loc.textContent, 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 e82ba2b6a5..9a71bcef81 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -74,7 +74,10 @@ END; [%- ELSE %] [%- org_name = ctx.get_aou(copy_info.circ_lib).name; - org_name | html + lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url'); + IF lib_url; ''; END; + org_name | html; + IF lib_url; ''; END; -%] [% END %] [% callnum | html %] [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](Text)[% END %] diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 0c0b27cf44..65b475c095 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -233,7 +233,14 @@ END; [% FOR copy IN args.holdings %] - [% copy.library | html %] + +[%- + lib_url = ctx.get_org_setting(copy.circ_lib, 'lib.info_url'); + IF lib_url; ''; END; + copy.library | html; + IF lib_url; ''; END; +-%] + [% copy.location | html %] [% copy.label | html %] [%- IF has_parts == 'true'; %] diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/link_library_names.txt b/docs/RELEASE_NOTES_NEXT/OPAC/link_library_names.txt new file mode 100644 index 0000000000..7b926ce478 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/OPAC/link_library_names.txt @@ -0,0 +1,14 @@ +Linked library names in copy details +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A patron may find one or more available copies of an item that they want to +retrieve, but may not be familiar with the location, hours of operation, or +contact information for each branch of their local library system. To enable +the patron to quickly access information about a given library branch, the TPAC +and KPAC can link the name of the branch in the copy details display to a URL +associated with that branch. + +To set the URL for a given branch, use the *Local Administration -> Library +Settings Editor* and edit the *Library Information URL* setting for that +branch. Any branches that do not have a library information URL setting display +as normal text.