From d64e55c623f36a22805c6eff29d1def974683a06 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 5 Mar 2013 08:54:21 -0500 Subject: [PATCH] attempt to sort libraries by system in tpac results --- Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm | 7 +++++-- Open-ILS/src/templates/opac/parts/record/copy_table.tt2 | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm index 2529d6b6a8..be76a5ee02 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm @@ -1999,8 +1999,10 @@ sub basic_opac_copy_query { ccs => { ($staff ? () : (filter => { opac_visible => 't' })) }, - aou => {}, - acpm => { + aou => { + 'parent' => { 'class' => "aou", "fkey" => "parent_ou" } + }, + acpm => { type => 'left', join => { bmp => { type => 'left' } @@ -2019,6 +2021,7 @@ sub basic_opac_copy_query { }, order_by => [ + {class => 'parent', field => 'name'}, {class => 'aou', field => 'name'}, {class => 'acn', field => 'label'} ], 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 b806f5cead..331c6c8977 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -73,7 +73,12 @@ END; [%- ELSE %] [%- - org_name = ctx.get_aou(copy_info.circ_lib).name; + org_obj = ctx.get_aou(copy_info.circ_lib); + IF org_obj.parent_ou; + parent_org_name = ctx.get_aou(org_obj.parent_ou).name; + org_name = parent_org_name _ ' - ' _ org_obj.name; + ELSE; + org_name = org_obj.name; END; org_name | html -%] [% END %] -- 2.11.0