[freeside-commits] freeside/httemplate/edit agent_type.cgi, 1.10, 1.11

Ivan,,, ivan at wavetail.420.am
Fri Nov 18 06:59:55 PST 2005


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv13278

Modified Files:
	agent_type.cgi 
Log Message:
template-ize agent type edit and add comment to package listing

Index: agent_type.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent_type.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- agent_type.cgi	22 Apr 2002 21:18:10 -0000	1.10
+++ agent_type.cgi	18 Nov 2005 14:59:53 -0000	1.11
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my($agent_type);
@@ -14,50 +13,51 @@
   $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
-
-%>



More information about the freeside-commits mailing list