-
- $hashref->{pkgpart}
- |
- $hashref->{pkg} |
- $hashref->{comment} |
- $hashref->{freq} |
- $hashref->{plan} |
- $plandata |
-END
-
- my($pkg_svc);
- my($n)="";
- foreach $pkg_svc ( @pkg_svc ) {
- my($svcpart)=$pkg_svc->getfield('svcpart');
- my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart });
- print $n,qq!!,
- $part_svc->getfield('svc')," | ",
- $pkg_svc->getfield('quantity')," | \n";
- $n="";
- }
-
- print "
";
+<% include( 'elements/browse.html',
+ 'title' => 'Package Definitions',
+ 'menubar' => [ 'Main Menu' => $p ],
+ 'html_init' => $html_init,
+ 'name' => 'package definitions',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 3,
+ 'agent_virt' => 1,
+ 'agent_null_right' => 'Edit global package definitions',
+ 'agent_pos' => 4,
+ 'query' => { 'select' => $select,
+ 'table' => 'part_pkg',
+ 'hashref' => {},
+ 'order_by' => "ORDER BY $orderby",
+ },
+ 'count_query' => $count_query,
+ 'header' => \@header,
+ 'fields' => \@fields,
+ 'links' => \@links,
+ 'align' => $align,
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit package definitions')
+ || $FS::CurrentUser::CurrentUser->access_right('Edit global package definitions');
+
+my $select = '*';
+my $orderby = 'pkgpart';
+if ( $cgi->param('active') ) {
+
+ $orderby = 'num_active DESC';
}
+ $select = "
-print <Add a new package definition |
-
-