X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fagent_type.cgi;h=b4e4fcf99f109395502156aca79588d4c8b2c31b;hp=318d0b6ea92e432530ac8af3afaacec3d83ff877;hb=15777da47bab33e8f0021e6dd9aa6b434fa9be30;hpb=655b4043942c7d361224d283accb4c2a02ef7359 diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi index 318d0b6ea..b4e4fcf99 100755 --- a/httemplate/browse/agent_type.cgi +++ b/httemplate/browse/agent_type.cgi @@ -1,37 +1,3 @@ -% -% -%my $html_init = -% 'Agent types define groups of packages that you can then assign to'. -% ' particular agents.

'. -% qq!Add a new agent type

!; -% -%my $count_query = 'SELECT COUNT(*) FROM agent_type'; -% -%#false laziness w/access_user.html -%my $packages_sub = sub { -% my $agent_type = shift; -% -% [ map { -% my $type_pkgs = $_; -% #my $part_pkg = $type_pkgs->part_pkg; -% [ -% { -% #'data' => $part_pkg->pkg. ' - '. $part_pkg->comment, -% 'data' => $type_pkgs->pkg. ' - '. $type_pkgs->comment, -% 'align' => 'left', -% 'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart, -% }, -% ]; -% } -% -% $agent_type->type_pkgs_enabled -% ]; -% -%}; -% -%my $link = [ $p.'edit/agent_type.cgi?', 'typenum' ]; -% -% <% include( 'elements/browse.html', 'title' => 'Agent Types', 'menubar' => [ #'Main menu' => $p, @@ -58,3 +24,40 @@ ], ) %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $html_init = +'Agent types define groups of packages that you can then assign to'. +' particular agents.

'. +qq!Add a new agent type

!; + +my $count_query = 'SELECT COUNT(*) FROM agent_type'; + +#false laziness w/access_user.html +my $packages_sub = sub { +my $agent_type = shift; + +[ map { + my $type_pkgs = $_; + #my $part_pkg = $type_pkgs->part_pkg; + [ + { + #'data' => $part_pkg->pkg. ' - '. $part_pkg->comment, + 'data' => $type_pkgs->pkg. ' - '. $type_pkgs->comment, + 'align' => 'left', + 'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart, + }, + ]; + } + + $agent_type->type_pkgs_enabled +]; + +}; + +my $link = [ $p.'edit/agent_type.cgi?', 'typenum' ]; + +