diff options
author | ivan <ivan> | 2005-11-18 14:59:53 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-11-18 14:59:53 +0000 |
commit | e5787d471e4d94f28cfb68db97b31eefbe35a651 (patch) | |
tree | 7f059610e3f3753280b5cb4d6a8112457cfb39cc | |
parent | d6734800d8e66b13a8f8793f1867cbe20e0c1303 (diff) |
template-ize agent type edit and add comment to package listing
-rwxr-xr-x | httemplate/edit/agent_type.cgi | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi index 637c710ab..684216335 100755 --- a/httemplate/edit/agent_type.cgi +++ b/httemplate/edit/agent_type.cgi @@ -1,4 +1,3 @@ -<!-- mason kludge --> <% my($agent_type); @@ -14,50 +13,51 @@ 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!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'), - "</FONT>" - if $cgi->param('error'); +<% if ( $cgi->param('error') ) { %> + <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT> +<% } %> -print '<FORM ACTION="', popurl(1), 'process/agent_type.cgi" METHOD=POST>', - qq!<INPUT TYPE="hidden" NAME="typenum" VALUE="$hashref->{typenum}">!, - "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)"; +<FORM ACTION="<%= popurl(1) %>process/agent_type.cgi" METHOD=POST> +<INPUT TYPE="hidden" NAME="typenum" VALUE="<%= $agent_type->typenum %>"> +Agent Type #<%= $agent_type->typenum || "(NEW)" %> +<BR><BR> -print <<END; -<BR><BR>Agent Type <INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="$hashref->{atype}"> -<BR><BR>Select which packages agents of this type may sell to customers<BR> -END +Agent Type +<INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="<%= $agent_type->atype %>"> +<BR><BR> -foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { - print qq!<BR><INPUT TYPE="checkbox" NAME="pkgpart!, - $part_pkg->getfield('pkgpart'), qq!" !, - # ( 'CHECKED 'x scalar( +Select which packages agents of this type may sell to customers<BR> + +<% foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { %> + + <BR> + <INPUT TYPE="checkbox" NAME="pkgpart<%= $part_pkg->pkgpart %>" <%= qsearchs('type_pkgs',{ - 'typenum' => $agent_type->getfield('typenum'), - 'pkgpart' => $part_pkg->getfield('pkgpart'), + 'typenum' => $agent_type->typenum, + 'pkgpart' => $part_pkg->pkgpart, }) ? 'CHECKED ' - : '', - qq!VALUE="ON"> !, - qq!<A HREF="${p}edit/part_pkg.cgi?!, $part_pkg->pkgpart, - '">', $part_pkg->pkgpart. ": ". $part_pkg->getfield('pkg'), '</A>', - ; -} + : '' + %> VALUE="ON"> -print qq!<BR><BR><INPUT TYPE="submit" VALUE="!, - $hashref->{typenum} ? "Apply changes" : "Add agent type", - qq!">!; + <A HREF="<%= $p %>edit/part_pkg.cgi?<%= $part_pkg->pkgpart %>"><%= $part_pkg->pkgpart %>: + <%= $part_pkg->pkg %> (<%= $part_pkg->comment %>)</A> + +<% } %> + +<BR><BR> + +<INPUT TYPE="submit" VALUE="<%= $agent_type->typenum ? "Apply changes" : "Add agent type" %>"> -print <<END; </FORM> </BODY> </HTML> -END - -%> |