summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/select-cust-fields.html10
-rw-r--r--httemplate/elements/tr-select-cust-fields.html9
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>