From 95c780df6393fa274d9efd1da401e991f50cb564 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 21 Feb 2011 12:13:04 -0500 Subject: [PATCH] add affix output to supercat holdings xml --- .../lib/OpenILS/Application/Storage/CDBI.pm | 3 ++ .../perlmods/lib/OpenILS/Application/SuperCat.pm | 34 +++++++++++++++------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm index d004f3898d..c851afa866 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI.pm @@ -640,6 +640,9 @@ sub modify_from_fieldmapper { asset::call_number->has_many( copies => 'asset::copy' ); asset::call_number->has_many( notes => 'asset::call_number_note' ); + asset::call_number->has_a( prefix => 'asset::call_number_prefix' ); + asset::call_number->has_a( suffix => 'asset::call_number_suffix' ); + authority::record_entry->has_many( record_descriptor => 'authority::record_descriptor' ); authority::record_entry->has_many( notes => 'authority::record_note' ); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm index eed53b1bc7..f7786eeb1c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm @@ -305,7 +305,7 @@ sub cn_browse { @cp_filter }, { flesh => 1, - flesh_fields => { acn => [qw/record owning_lib/] }, + flesh_fields => { acn => [qw/record owning_lib prefix suffix/] }, order_by => { acn => "oils_text_as_bytea(label_sortkey) desc, oils_text_as_bytea(label) desc, id desc, owning_lib desc" }, limit => $before_limit, offset => abs($page) * $page_size - $before_offset, @@ -323,7 +323,7 @@ sub cn_browse { @cp_filter }, { flesh => 1, - flesh_fields => { acn => [qw/record owning_lib/] }, + flesh_fields => { acn => [qw/record owning_lib prefix suffix/] }, order_by => { acn => "oils_text_as_bytea(label_sortkey), oils_text_as_bytea(label), id, owning_lib" }, limit => $after_limit, offset => abs($page) * $page_size - $after_offset, @@ -428,7 +428,7 @@ sub cn_startwith { @cp_filter }, { flesh => 1, - flesh_fields => { acn => [qw/record owning_lib/] }, + flesh_fields => { acn => [qw/record owning_lib prefix suffix/] }, order_by => { acn => "oils_text_as_bytea(label_sortkey) desc, oils_text_as_bytea(label) desc, id desc, owning_lib desc" }, limit => $limit, offset => $offset, @@ -446,7 +446,7 @@ sub cn_startwith { @cp_filter }, { flesh => 1, - flesh_fields => { acn => [qw/record owning_lib/] }, + flesh_fields => { acn => [qw/record owning_lib prefix suffix/] }, order_by => { acn => "oils_text_as_bytea(label_sortkey), oils_text_as_bytea(label), id, owning_lib" }, limit => $limit, offset => $offset, @@ -1663,7 +1663,7 @@ sub retrieve_uri { flesh_fields => { auri => [qw/call_number_maps/], auricnm => [qw/call_number/], - acn => [qw/owning_lib record/], + acn => [qw/owning_lib record prefix suffix/], } }) ->gather(1)) @@ -1704,7 +1704,7 @@ sub retrieve_copy { $cpid, { flesh => 2, flesh_fields => { - acn => [qw/owning_lib record/], + acn => [qw/owning_lib record prefix suffix/], acp => [qw/call_number location status circ_lib stat_cat_entries notes/], } }) @@ -1747,7 +1747,7 @@ sub retrieve_callnumber { $cnid, { flesh => 5, flesh_fields => { - acn => [qw/owning_lib record copies uri_maps/], + acn => [qw/owning_lib record copies uri_maps prefix suffix/], auricnm => [qw/uri/], acp => [qw/location status circ_lib stat_cat_entries notes/], } @@ -1796,7 +1796,7 @@ sub basic_record_holdings { { flesh => 5, flesh_fields => { bre => [qw/call_numbers/], - acn => [qw/copies owning_lib/], + acn => [qw/copies owning_lib prefix suffix/], acp => [qw/location status circ_lib/], } } @@ -1948,7 +1948,7 @@ sub new_record_holdings { }, { flesh => 5, flesh_fields => { - acn => [qw/copies owning_lib uri_maps/], + acn => [qw/copies owning_lib uri_maps prefix suffix/], auricnm => [qw/uri/], acp => [qw/circ_lib location status stat_cat_entries notes/], asce => [qw/stat_cat/], @@ -2022,7 +2022,7 @@ sub new_record_holdings { sstr => [qw/items/], sitem => [qw/notes unit/], sunit => [qw/notes location status circ_lib stat_cat_entries call_number/], - acn => [qw/owning_lib/], + acn => [qw/owning_lib prefix suffix/], }, ( $limit > -1 ? ( limit => $limit ) : () ), ( $offset ? ( offset => $offset ) : () ), @@ -2925,6 +2925,20 @@ sub as_xml { } + $xml .= ' obj->prefix->id . '" '; + $xml .= 'id="tag:open-ils.org:asset-call_number_prefix/' . $self->obj->prefix->id . '" '; + $xml .= 'label_sortkey="'.$self->escape( $self->obj->prefix->label_sortkey ) .'">'; + $xml .= $self->escape( $self->obj->prefix->label ) .''; + $xml .= "\n"; + + $xml .= ' obj->suffix->id . '" '; + $xml .= 'id="tag:open-ils.org:asset-call_number_suffix/' . $self->obj->suffix->id . '" '; + $xml .= 'label_sortkey="'.$self->escape( $self->obj->suffix->label_sortkey ) .'">'; + $xml .= $self->escape( $self->obj->suffix->label ) .''; + $xml .= "\n"; + $xml .= ' obj->owning_lib->id . '" '; $xml .= 'shortname="'.$self->escape( $self->obj->owning_lib->shortname ) .'" '; -- 2.11.0