From 08788a7908099bcdd41b7f00d9f6ef51f68b371b Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 1 Mar 2011 16:02:43 -0500 Subject: [PATCH] add prefix/suffix to label for summary display --- .../OpenILS/Application/Storage/Publisher/biblio.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/biblio.pm index 5b609bee73..689ae92ef7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/biblio.pm @@ -380,19 +380,28 @@ sub record_copy_status_count { my $descendants = "actor.org_unit_descendants(?,?)"; my $cn_table = asset::call_number->table; + my $cnp_table = asset::call_number_prefix->table; + my $cns_table = asset::call_number_prefix->table; my $cp_table = asset::copy->table; my $cl_table = asset::copy_location->table; my $cs_table = config::copy_status->table; my $sql = <<" SQL"; - SELECT cp.circ_lib, cn.label, cp.status, count(cp.id) + SELECT cp.circ_lib, + cnp.label || CASE WHEN cnp.label <> '' THEN ' ' ELSE '' END || cn.label || CASE WHEN cns.label <> '' THEN ' ' ELSE '' END || cns.label, + cp.status, + count(cp.id) FROM $cp_table cp, $cn_table cn, + $cns_table cns, + $cnp_table cnp, $cl_table cl, $cs_table cs, $descendants d WHERE cn.record = ? + AND cnp.id = cn.prefix + AND cns.id = cn.suffix AND cp.call_number = cn.id AND cp.location = cl.id AND cp.circ_lib = d.id @@ -440,6 +449,8 @@ sub record_copy_status_location_count { my $descendants = "actor.org_unit_descendants(?,?)"; my $cn_table = asset::call_number->table; + my $cnp_table = asset::call_number_prefix->table; + my $cns_table = asset::call_number_prefix->table; my $cp_table = asset::copy->table; my $cl_table = asset::copy_location->table; my $cs_table = config::copy_status->table; @@ -450,16 +461,20 @@ sub record_copy_status_location_count { my $sql = <<" SQL"; SELECT cp.circ_lib, - cn.label, + cnp.label || CASE WHEN cnp.label <> '' THEN ' ' ELSE '' END || cn.label || CASE WHEN cns.label <> '' THEN ' ' ELSE '' END || cns.label, oils_i18n_xlate('asset.copy_location', 'acpl', 'name', 'id', cl.id::TEXT, ?), cp.status, count(cp.id) FROM $cp_table cp, $cn_table cn, + $cns_table cns, + $cnp_table cnp, $cl_table cl, $cs_table cs, $descendants d WHERE cn.record = ? + AND cnp.id = cn.prefix + AND cns.id = cn.suffix AND cp.call_number = cn.id AND cp.location = cl.id AND cp.circ_lib = d.id -- 2.11.0