1 <% include( 'elements/browse.html',
2 'title' => 'Package classes',
3 'html_init' => $html_init,
4 'name' => 'package classes',
6 'disabled_statuspos' => 2,
7 'query' => { 'table' => 'pkg_class',
9 'order_by' => 'ORDER BY classnum',
11 'count_query' => $count_query,
20 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
22 my $conf = new FS::Conf;
25 'Package classes define groups of packages, for taxation, ordering '.
26 'convenience and reporting.<BR><BR>'.
27 qq!<A HREF="${p}edit/pkg_class.html"><I>Add a package class</I></A><BR><BR>!;
29 my $count_query = 'SELECT COUNT(*) FROM pkg_class';
31 my $link = [ $p.'edit/pkg_class.html?', 'classnum' ];
33 my $header = [ '#', 'Class' ];
34 my $fields = [ 'classnum', 'classname' ];
35 my $links = [ $link, $link ];
37 if($conf->exists('cust_main-require_censustract')) {
38 push @{$fields}, 'fcc_ds0s';
39 push @{$header}, 'FCC form 477 voice-grade equivalents';
43 my $cat_query = 'SELECT COUNT(*) FROM pkg_class where categorynum IS NOT NULL';
44 my $sth = dbh->prepare($cat_query)
45 or die "Error preparing $cat_query: ". dbh->errstr;
47 or die "Error executing $cat_query: ". $sth->errstr;
48 if ($sth->fetchrow_arrayref->[0]) {
49 push @$header, 'Category';
50 push @$fields, 'categoryname';