From e5787d471e4d94f28cfb68db97b31eefbe35a651 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 18 Nov 2005 14:59:53 +0000 Subject: [PATCH] template-ize agent type edit and add comment to package listing --- httemplate/edit/agent_type.cgi | 66 +++++++++++++++++++++--------------------- 1 file 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 @@ - <% 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!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 + +

-foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { - print qq!
+ +<% foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { %> + +
+ $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"> -print qq!

!; + <%= $part_pkg->pkgpart %>: + <%= $part_pkg->pkg %> (<%= $part_pkg->comment %>) + +<% } %> + +

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