X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FCustomerFields;h=226378ed88867131481205237f9ca4759ec3b18e;hb=6cd1eaed3f43ff8d3e649f76eb2083587d8d63d1;hp=553a3499972dc99733200af7d26fa09102b64939;hpb=e010976ba33c00bb2b97d677f610e4b19571feaf;p=freeside.git diff --git a/rt/share/html/Elements/CustomerFields b/rt/share/html/Elements/CustomerFields index 553a34999..226378ed8 100644 --- a/rt/share/html/Elements/CustomerFields +++ b/rt/share/html/Elements/CustomerFields @@ -16,7 +16,6 @@ About the keys: name to sort by. <%once> -return unless $RT::URI::freeside::IntegrationType eq 'Internal'; my @customer_fields = ( # ordered { @@ -91,16 +90,29 @@ my @customer_fields = ( # ordered # query/sort needed? }, { + Name => 'BillingAddress', + Label => 'Billing Address', + Display => 'bill_location', + }, + { + Name => 'StreetAddress1', + Label => 'Street Address', + Display => 'bill_address1', + }, + { + Name => 'StreetAddress2', + Label => '', + Display => 'bill_address2', + }, + { Name => 'City', Label => 'City', - Display => 'city', - OrderBy => 'Customer.city', + Display => 'bill_city', }, { Name => 'State', Label => 'State', - Display => 'state', - OrderBy => 'Customer.state', + Display => 'bill_state', }, { Name => 'CustomerTags', @@ -158,8 +170,12 @@ sub select_table { sub ticket_cust_resolvers { my $Ticket = shift; - my @Customers = @{ $Ticket->Customers->ItemsArrayRef }; - return map $_->TargetURI->Resolver, @Customers; + my @Customers = map { $_->TargetURI->Resolver->CustomerResolver } + @{ $Ticket->Customers->ItemsArrayRef }; + # this can contain cust_svc links, careful + # uniq + my %seen = map { $_->URI => $_ } @Customers; + values %seen; } sub cust_info_attribute { # the simple case of $resolver->CustomerInfo->{foo} @@ -177,7 +193,6 @@ sub cust_info_attribute { # the simple case of $resolver->CustomerInfo->{foo} <%init> -return unless $RT::URI::freeside::IntegrationType eq 'Internal'; my $arg = shift; if ( $arg eq 'Names' ) { @@ -198,9 +213,11 @@ elsif ( $arg eq 'ColumnMap' ) { grep { exists $_->{Display} } @customer_fields; } -elsif ( $arg eq 'PickBasics' ) { +elsif ( $arg eq 'Criteria' ) { return map { my $f = $_; + # argument to Search/Elements/ConditionRow + $f->{Condition} || { Name => ($f->{QueryName} || $f->{Name}), Field => ($f->{QueryLabel} || $f->{Label}), @@ -208,7 +225,7 @@ elsif ( $arg eq 'PickBasics' ) { Value => $f->{Value}, } } #map - grep { exists $_->{Value} } + grep { exists $_->{Condition} || exists $_->{Value} } @customer_fields; } else { die "unknown CustomerFields mode '$arg'\n"; }