X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fagent_type.cgi;h=84f4b6599109d00b61681cd6bcea1c09bcfc861c;hb=d5cab3c80bef3d7e2c538e7488af1f3fb0008af9;hp=637c710ab5096b2390d6842e80bb38052c16bafa;hpb=5fc8c5edf574ab024d4646914b6432d458e2ffbd;p=freeside.git diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi index 637c710ab..84f4b6599 100755 --- a/httemplate/edit/agent_type.cgi +++ b/httemplate/edit/agent_type.cgi @@ -1,4 +1,3 @@ - <% my($agent_type); @@ -14,50 +13,60 @@ if ( $cgi->param('error') ) { $agent_type = new FS::agent_type {}; } my $action = $agent_type->typenum ? 'Edit' : 'Add'; -my $hashref = $agent_type->hashref; -print header("$action Agent Type", menubar( +%> + +<%= header("$action Agent Type", menubar( 'Main Menu' => "$p", 'View all agent types' => "${p}browse/agent_type.cgi", -)); +)) +%> -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); +<% if ( $cgi->param('error') ) { %> + Error: <%= $cgi->param('error') %> +<% } %> -print '
', - qq!!, - "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)"; + + +Agent Type #<%= $agent_type->typenum || "(NEW)" %> +

-print <
Agent Type -

Select which packages agents of this type may sell to customers
-END +Agent Type + +

+ +Select which packages agents of this type may sell to customers
+ +<% foreach my $part_pkg ( + qsearch({ 'table' => 'part_pkg', + 'hashref' => { 'disabled' => '' }, + 'select' => 'part_pkg.*', + 'addl_from' => 'LEFT JOIN type_pkgs USING ( pkgpart )', + 'extra_sql' => 'OR typenum = '. $agent_type->typenum, + }) + ) { +%> -foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { - print qq!
+ $agent_type->getfield('typenum'), - 'pkgpart' => $part_pkg->getfield('pkgpart'), + 'typenum' => $agent_type->typenum, + 'pkgpart' => $part_pkg->pkgpart, }) ? 'CHECKED ' - : '', - qq!VALUE="ON"> !, - qq!', $part_pkg->pkgpart. ": ". $part_pkg->getfield('pkg'), '', - ; -} + : '' + %> VALUE="ON"> + + <%= $part_pkg->pkgpart %>: + <%= $part_pkg->pkg %> - <%= $part_pkg->comment %> + <%= $part_pkg->disabled =~ /^Y/i ? ' (DISABLED)' : '' %> + +<% } %> -print qq!

!; +

+ +"> -print < -END - -%>