diff options
author | Christopher Burger <burgerc@freeside.biz> | 2019-05-22 12:58:05 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2019-05-22 12:58:05 -0400 |
commit | a98de57aee063b3ff737c283336f83b2e50e14a8 (patch) | |
tree | ffeec186cc5b5798401ce9f51d5011084a76bb0c /httemplate/elements | |
parent | 7bfdea32633df161273631bcdc6b33b93867f5b2 (diff) |
RT 77532 - added contact phone numbers to advanced customer report
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-cust-fields.html | 10 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust-fields.html | 9 |
2 files changed, 16 insertions, 3 deletions
diff --git a/httemplate/elements/select-cust-fields.html b/httemplate/elements/select-cust-fields.html index 5e3063877..7396808b1 100644 --- a/httemplate/elements/select-cust-fields.html +++ b/httemplate/elements/select-cust-fields.html @@ -1,8 +1,14 @@ <%init> my( $cust_fields, %opt ) = @_; - use FS::ConfDefaults; - $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; + my @fields = FS::ConfDefaults->cust_fields_avail(); + my $contact_phone_list; + foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { + $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)"; + } + @fields = map {s/\| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields; + + $opt{'avail_fields'} ||= [ @fields ]; tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} }; </%init> diff --git a/httemplate/elements/tr-select-cust-fields.html b/httemplate/elements/tr-select-cust-fields.html index dd8513316..62b8144e3 100644 --- a/httemplate/elements/tr-select-cust-fields.html +++ b/httemplate/elements/tr-select-cust-fields.html @@ -6,6 +6,13 @@ my( $cust_fields, %opt ) = @_; -$opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; +my @fields = FS::ConfDefaults->cust_fields_avail(); +my $contact_phone_list; +foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { + $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)"; +} +@fields = map {s/\| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields; + +$opt{'avail_fields'} ||= [ @fields ]; </%init> |