-
- $hashref->{pkgpart}
- |
- $hashref->{pkg} |
- $hashref->{comment} |
- $hashref->{setup} |
- $hashref->{freq} |
- $hashref->{recur} |
-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="";
+<% include( 'elements/browse.html',
+ 'title' => 'Package Definitions',
+ 'menubar' => \@menubar,
+ 'html_init' => $html_init,
+ 'html_form' => $html_form,
+ 'html_posttotal' => $html_posttotal,
+ 'name' => 'package definitions',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 4,
+ 'agent_virt' => 1,
+ 'agent_null_right' => [ $edit, $edit_global ],
+ 'agent_null_right_link' => $edit_global,
+ 'agent_pos' => 7, #5?
+ 'query' => { 'select' => $select,
+ 'table' => 'part_pkg',
+ 'hashref' => \%hash,
+ 'extra_sql' => $extra_sql,
+ 'order_by' => "ORDER BY $orderby"
+ },
+ 'count_query' => $count_query,
+ 'header' => \@header,
+ 'fields' => \@fields,
+ 'links' => \@links,
+ 'align' => $align,
+ 'link_field' => 'pkgpart',
+ 'html_init' => $html_init,
+ 'html_foot' => $html_foot,
+ )
+%>
+<%def .style>
+
+
+%def>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+my $edit = 'Edit package definitions';
+my $edit_global = 'Edit global package definitions';
+my $acl_edit = $curuser->access_right($edit);
+my $acl_edit_global = $curuser->access_right($edit_global);
+my $acl_config = $curuser->access_right('Configuration'); #to edit services
+ #and agent types
+ #and bulk change
+my $acl_edit_bulk = $curuser->access_right('Bulk edit package definitions');
+
+die "access denied"
+ unless $acl_edit || $acl_edit_global;
+
+my $conf = new FS::Conf;
+my $taxclasses = $conf->exists('enable_taxclasses');
+my $taxvendor = $conf->config('tax_data_vendor');
+my $money_char = $conf->config('money_char') || '$';
+
+my $select = '*';
+my $orderby = 'pkgpart';
+my %hash = ();
+my $extra_count = '';
+my $family_pkgpart;
- print "
";
+if ( $cgi->param('active') ) {
+ $orderby = 'num_active DESC';
}
-print <Add new package |
-
-