X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg.cgi;h=0b83fc000fc2773e9ab430b3f956426efddf2e89;hp=5acf17ef2125e878e028c30bb2e078f465707dd4;hb=eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd;hpb=32b5d3a31f112a381f0a15ac5e3a2204242f3405
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index 5acf17ef2..0b83fc000 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -1,20 +1,20 @@
<% include( 'elements/browse.html',
- 'title' => 'Package Definitions',
- 'menubar' => [ 'Main Menu' => $p ],
- 'html_init' => $html_init,
- 'html_posttotal' => $posttotal,
- 'name' => 'package definitions',
- 'query' => { 'select' => $select,
- 'table' => 'part_pkg',
- 'hashref' => \%search,
- 'extra_sql' => "ORDER BY $orderby",
- },
- 'count_query' => $count_query,
- 'header' => \@header,
- 'fields' => \@fields,
- 'links' => \@links,
- 'align' => $align,
- 'style' => \@style,
+ 'title' => 'Package Definitions',
+ 'menubar' => [ 'Main Menu' => $p ],
+ 'html_init' => $html_init,
+ 'name' => 'package definitions',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 3,
+ 'query' => { 'select' => $select,
+ 'table' => 'part_pkg',
+ 'hashref' => {},
+ 'extra_sql' => "ORDER BY $orderby",
+ },
+ 'count_query' => $count_query,
+ 'header' => \@header,
+ 'fields' => \@fields,
+ 'links' => \@links,
+ 'align' => $align,
)
%>
<%init>
@@ -22,14 +22,6 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-#false laziness w/access_user.html
-my %search = ();
-my $search = '';
-unless ( $cgi->param('showdisabled') ) {
- %search = ( 'disabled' => '' );
- $search = "( disabled = '' OR disabled IS NULL )";
-}
-
my $select = '*';
my $orderby = 'pkgpart';
if ( $cgi->param('active') ) {
@@ -72,18 +64,6 @@ my $html_init;
!;
#}
-my $posttotal;
-if ( $cgi->param('showdisabled') ) {
- $cgi->param('showdisabled', 0);
- $posttotal = '( hide disabled packages )';
- $cgi->param('showdisabled', 1);
-} else {
- $cgi->param('showdisabled', 1);
- $posttotal = '( show disabled packages )';
- $cgi->param('showdisabled', 0);
-}
-
-
# ------
my $link = [ $p.'edit/part_pkg.cgi?', 'pkgpart' ];
@@ -92,20 +72,6 @@ my @header = ( '#', 'Package', 'Comment' );
my @fields = ( 'pkgpart', 'pkg', 'comment' );
my $align = 'rll';
my @links = ( $link, $link, '' );
-my @style = ( '', '', '' );
-
-#false laziness w/access_user.html
-#unless ( $cgi->param('showdisabled') ) { #its been reversed already
-if ( $cgi->param('showdisabled') ) { #its been reversed already
- push @header, 'Status';
- push @fields, sub { shift->disabled
- ? 'DISABLED'
- : 'Active'
- };
- push @links, '';
- $align .= 'c';
- push @style, 'b';
-}
unless ( 0 ) { #already showing only one class or something?
push @header, 'Class';
@@ -255,7 +221,5 @@ $align .= 'lrl'; #rr';
# --------
my $count_query = 'SELECT COUNT(*) FROM part_pkg';
-$count_query .= " WHERE $search"
- if $search;
%init>