summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorlevinse <levinse>2011-06-23 01:55:51 +0000
committerlevinse <levinse>2011-06-23 01:55:51 +0000
commit3545cf7c664f5cd24a5c4e9cf8c7ef368ac51f1f (patch)
tree48b2b3895869dcb6d4dd41d4b587934ed7722dcd /httemplate
parent1070837a51a12ce1e46242dfdff99daa7b96da61 (diff)
add optional fcc_ds0s to pkg_class, RT13057
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/pkg_class.html8
-rw-r--r--httemplate/edit/elements/class_Common.html22
-rw-r--r--httemplate/edit/pkg_class.html11
3 files changed, 33 insertions, 8 deletions
diff --git a/httemplate/browse/pkg_class.html b/httemplate/browse/pkg_class.html
index 97b0621..f3e2364 100644
--- a/httemplate/browse/pkg_class.html
+++ b/httemplate/browse/pkg_class.html
@@ -19,6 +19,8 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $conf = new FS::Conf;
+
my $html_init =
'Package classes define groups of packages, for taxation, ordering '.
'convenience and reporting.<BR><BR>'.
@@ -32,6 +34,12 @@ my $header = [ '#', 'Class' ];
my $fields = [ 'classnum', 'classname' ];
my $links = [ $link, $link ];
+if($conf->exists('cust_main-require_censustract')) {
+ push @{$fields}, 'fcc_ds0s';
+ push @{$header}, 'FCC form 477 voice-grade equivalents';
+ push @{$links}, '';
+}
+
my $cat_query = 'SELECT COUNT(*) FROM pkg_class where categorynum IS NOT NULL';
my $sth = dbh->prepare($cat_query)
or die "Error preparing $cat_query: ". dbh->errstr;
diff --git a/httemplate/edit/elements/class_Common.html b/httemplate/edit/elements/class_Common.html
index e6334fe..69da4db 100644
--- a/httemplate/edit/elements/class_Common.html
+++ b/httemplate/edit/elements/class_Common.html
@@ -1,17 +1,11 @@
<% include( 'edit.html',
- 'fields' => [
- 'classname',
- (scalar(@category)
- ? { field=>'categorynum', type=>'select-table', 'empty_label'=>'(none)', 'table'=>'pkg_category', 'name_col'=>'categoryname' }
- : { field=>'categorynum', type=>'hidden' }
- ),
- { field=>'disabled', type=>'checkbox', value=>'Y', },
- ],
+ 'fields' => $fields,
'labels' => {
'classnum' => 'Class number',
'classname' => 'Class name',
'categorynum' => 'Category',
'disabled' => 'Disable class',
+ %addl_labels,
},
'viewall_dir' => 'browse',
%opt,
@@ -33,4 +27,16 @@ unless ( $opt{'nocat'} ) {
@category = qsearch($category_table, { 'disabled' => '' });
}
+my $fields = [ 'classname',
+ (scalar(@category)
+ ? { field=>'categorynum', type=>'select-table', 'empty_label'=>'(none)', 'table'=>'pkg_category', 'name_col'=>'categoryname' }
+ : { field=>'categorynum', type=>'hidden' }
+ ),
+ { field=>'disabled', type=>'checkbox', value=>'Y', },
+ ];
+push @$fields, $opt{'addl_fields'} if $opt{'addl_fields'};
+
+my %addl_labels = ();
+%addl_labels = %{$opt{'addl_labels'}} if $opt{'addl_labels'};
+
</%init>
diff --git a/httemplate/edit/pkg_class.html b/httemplate/edit/pkg_class.html
index 4f7a729..1bc100e 100644
--- a/httemplate/edit/pkg_class.html
+++ b/httemplate/edit/pkg_class.html
@@ -1,5 +1,16 @@
<% include( 'elements/class_Common.html',
'name' => 'Package Class',
'table' => 'pkg_class',
+ %opt,
)
%>
+<%init>
+
+my $conf = new FS::Conf;
+
+my %opt = ();
+if($conf->exists('cust_main-require_censustract')) {
+ $opt{'addl_fields'} = qw( fcc_ds0s );
+ $opt{'addl_labels'} = { 'fcc_ds0s' => 'FCC form 477 voice-grade equivalents' };
+}
+</%init>