From: Dan Pearl Date: Thu, 5 Apr 2018 18:13:28 +0000 (-0400) Subject: LP1753536 Replace TPAC "Lending Lib" display with Owning Lib X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=00495428d0cb1c251bca8644dbff993924071c87;p=working%2FEvergreen.git LP1753536 Replace TPAC "Lending Lib" display with Owning Lib Also adds some utility code for generating an org unit URL. Signed-off-by: Dan Pearl Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 9ae265a6f7..ee9beab437 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1530,8 +1530,8 @@ sub fetch_user_circs { flesh => 3, flesh_fields => { circ => ['target_copy'], - acp => ['call_number','location','circ_lib'], - acn => ['record'] + acp => ['call_number'], + acn => ['record','owning_lib'] } }; diff --git a/Open-ILS/src/templates/opac/myopac/circs.tt2 b/Open-ILS/src/templates/opac/myopac/circs.tt2 index e7088f899f..7510bf651a 100644 --- a/Open-ILS/src/templates/opac/myopac/circs.tt2 +++ b/Open-ILS/src/templates/opac/myopac/circs.tt2 @@ -77,7 +77,7 @@ [% sort_head("due", l("Due Date")) %] [% sort_head("barcode", l("Barcode")) %] [% sort_head("callnum", l("Call Number")) %] - [% sort_head("lib", l("Lending Library")) %] + [% sort_head("lib", l("Owning Library")) %] @@ -114,7 +114,7 @@ CASE "callnum"; circ.SORTING = circ.circ.target_copy.call_number.label; CASE "lib"; - circ.SORTING = circ.circ.target_copy.circ_lib.name; + circ.SORTING = circ.circ.target_copy.call_number.owning_lib.name; CASE; sort_field = ""; @@ -183,8 +183,8 @@ [% circ.circ.target_copy.call_number.label | html %] - [%- copy_info = circ.circ.target_copy; - INCLUDE "opac/parts/library_name_link.tt2"; + [%- fleshed_ou = circ.circ.target_copy.call_number.owning_lib; + INCLUDE "opac/parts/library_name_link_from_ou.tt2"; %] diff --git a/Open-ILS/src/templates/opac/parts/library_name_link_from_ou.tt2 b/Open-ILS/src/templates/opac/parts/library_name_link_from_ou.tt2 new file mode 100644 index 0000000000..54e085b535 --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/library_name_link_from_ou.tt2 @@ -0,0 +1,22 @@ +[%- + opac_root = ctx.opac_root; + IF ctx.kpac_root; + opac_root = ctx.kpac_root; + END; + + # Requires a "fleshed_ou" (aou) object defined. + # Allow fleshed circ_libs + org_id = fleshed_ou.id; + org_name = fleshed_ou.name; + org_sname = fleshed_ou.shortname; + + lib_url = ctx.get_org_setting(org_id, 'lib.info_url'); + prefer_external_url = ctx.get_org_setting(org_id, 'lib.prefer_external_url'); + UNLESS lib_url && prefer_external_url; + lib_url = mkurl(opac_root _ '/library/' _ org_sname, {}, 1); + END; + IF lib_url; ''; END; + ''; org_name | html; ''; + IF lib_url; ''; END; +-%] + diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/LP1753536_items_out_lib.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/LP1753536_items_out_lib.adoc index c17c7cd006..d634734ea1 100644 --- a/docs/RELEASE_NOTES_NEXT/OPAC/LP1753536_items_out_lib.adoc +++ b/docs/RELEASE_NOTES_NEXT/OPAC/LP1753536_items_out_lib.adoc @@ -1,6 +1,6 @@ New Column in Items Out Display ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -A new column, Lending Library, has been added to the Items Out display which +A new column, Owning Library, has been added to the Items Out display which shows the owning library of the item (not necessarily the library at which the item was picked up at). When a patron has run out of renewals, the owning library is the one with whom the patron will negotiate additional renewals, and