name to sort by.
</%doc>
<%once>
-return unless $RT::URI::freeside::IntegrationType eq 'Internal';
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',
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}
</%once>
<%init>
-return unless $RT::URI::freeside::IntegrationType eq 'Internal';
my $arg = shift;
if ( $arg eq 'Names' ) {
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}),
Value => $f->{Value},
}
} #map
- grep { exists $_->{Value} }
+ grep { exists $_->{Condition} || exists $_->{Value} }
@customer_fields;
}
else { die "unknown CustomerFields mode '$arg'\n"; }