1 <& elements/browse.html,
2 'title' => 'Agent Types',
3 'menubar' => [ 'Agents' => "${p}browse/agent.cgi" ],
4 'html_init' => $html_init,
5 'name' => 'agent types',
7 'disabled_statuspos' => 2,
8 'query' => { 'table' => 'agent_type',
10 'order_by' => 'ORDER BY typenum', # atype?
12 'count_query' => $count_query,
17 'fields' => [ 'typenum',
29 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
32 'Agent types define groups of packages that you can then assign to'.
33 ' particular agents.<BR><BR>'.
34 qq!<A HREF="${p}edit/agent_type.cgi"><I>Add a new agent type</I></A><BR><BR>!;
36 my $count_query = 'SELECT COUNT(*) FROM agent_type';
38 #false laziness w/access_user.html
39 my $packages_sub = sub {
40 my $agent_type = shift;
41 my @type_pkgs = $agent_type->type_pkgs_enabled;
42 return '(lots; edit agent type to view)' if scalar(@type_pkgs) > 32;
46 #my $part_pkg = $type_pkgs->part_pkg;
49 #'data' => $part_pkg->pkg. ' - '. $part_pkg->comment,
50 'data' => encode_entities($type_pkgs->pkg). ' - '.
51 ( $type_pkgs->custom ? '(CUSTOM) ' : '' ).
52 encode_entities($type_pkgs->comment),
54 'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart,
63 my $link = [ $p.'edit/agent_type.cgi?', 'typenum' ];