[freeside-commits] freeside/httemplate/edit access_group.html, NONE, 1.1 access_user.html, NONE, 1.1 agent_type.cgi, 1.14, 1.15 cust_bill_pay.cgi, 1.9, 1.10 cust_credit.cgi, 1.10, 1.11 cust_credit_bill.cgi, 1.9, 1.10 cust_main.cgi, 1.61, 1.62 cust_pkg.cgi, 1.10, 1.11 part_referral.cgi, 1.9, 1.10 part_virtual_field.cgi, 1.3, 1.4 svc_domain.cgi, 1.10, 1.11

Ivan,,, ivan at wavetail.420.am
Sun May 14 09:47:32 PDT 2006


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

Modified Files:
	agent_type.cgi cust_bill_pay.cgi cust_credit.cgi 
	cust_credit_bill.cgi cust_main.cgi cust_pkg.cgi 
	part_referral.cgi part_virtual_field.cgi svc_domain.cgi 
Added Files:
	access_group.html access_user.html 
Log Message:
first part of ACL and re-skinning work and some other small stuff

Index: cust_bill_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_bill_pay.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cust_bill_pay.cgi	29 Jun 2004 04:02:45 -0000	1.9
+++ cust_bill_pay.cgi	14 May 2006 16:47:30 -0000	1.10
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my($paynum, $amount, $invnum);
@@ -18,78 +17,76 @@
 
 my $p1 = popurl(1);
 
-print header("Apply Payment", '');
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-      "</FONT><BR><BR>"
-  if $cgi->param('error');
-print <<END;
-    <FORM ACTION="${p1}process/cust_bill_pay.cgi" METHOD=POST>
-END
+%><%= header("Apply Payment", '') %>
+
+<% if ( $cgi->param('error') ) { %>
+  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+  <BR><BR>
+<% } %>
 
+<FORM ACTION="<%= $p1 %>process/cust_bill_pay.cgi" METHOD=POST>
+
+<%
 my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
 die "payment $paynum not found!" unless $cust_pay;
 
 my $unapplied = $cust_pay->unapplied;
+%>
 
-print "Payment # <B>$paynum</B>".
-      qq!<INPUT TYPE="hidden" NAME="paynum" VALUE="$paynum">!.
-      '<BR>Date: <B>'. time2str("%D", $cust_pay->_date). '</B>'.
-      '<BR>Amount: $<B>'. $cust_pay->paid. '</B>'.
-      "<BR>Unapplied amount: \$<B>$unapplied</B>"
-      ;
+Payment #<B><%= $paynum %></B>
+<INPUT TYPE="hidden" NAME="paynum" VALUE="<%= $paynum %>">
+
+<BR>Date: <B><%= time2str("%D", $cust_pay->_date) %></B>
 
+<BR>Amount: $<B><%= $cust_pay->paid %></B>
+
+<BR>Unapplied amount: $<B><%= $unapplied %></B>
+
+<%
 my @cust_bill = grep $_->owed != 0,
                 qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } );
 
-print <<END;
+%>
+
 <SCRIPT>
 function changed(what) {
   cust_bill = what.options[what.selectedIndex].value;
-END
 
-foreach my $cust_bill ( @cust_bill ) {
+<% foreach my $cust_bill ( @cust_bill ) {
   my $invnum = $cust_bill->invnum;
   my $changeto = $cust_bill->owed < $unapplied
                    ? $cust_bill->owed 
                    : $unapplied;
-  print <<END;
+%>
   if ( cust_bill == $invnum ) {
-    what.form.amount.value = "$changeto";
+    what.form.amount.value = "<%= $changeto %>";
   }
-END
-}
+<% } %>
 
-print <<END;
   if ( cust_bill == "Refund" ) {
-    what.form.amount.value = "$unapplied";
+    what.form.amount.value = "<%= $unapplied %>";
   }
 }
 </SCRIPT>
-END
 
-print qq!<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">!,
-      '<OPTION VALUE="">';
-foreach my $cust_bill ( @cust_bill ) {
-  print '<OPTION'. ( $cust_bill->invnum eq $invnum ? ' SELECTED' : '' ).
-        ' VALUE="'. $cust_bill->invnum. '">'. $cust_bill->invnum.
-        ' -  '. time2str("%D",$cust_bill->_date).
-        ' - $'. $cust_bill->owed;
-}
-print qq!<OPTION VALUE="Refund">Refund!;
-print "</SELECT>";
+<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">
+<OPTION VALUE="">
 
-print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
+<% foreach my $cust_bill ( @cust_bill ) { %>
+
+  <OPTION<%= $cust_bill->invnum eq $invnum ? ' SELECTED' : '' %> VALUE="<%= $cust_bill->invnum %>"><%= $cust_bill->invnum %> - <%= time2str("%D", $cust_bill->_date) %> - $<%= $cust_bill->owed %>
+
+<% } %>
+
+<OPTION VALUE="Refund">Refund
+</SELECT>
+
+<BR>Amount $<INPUT TYPE="text" NAME="amount" VALUE="<%= $amount %>" SIZE=8 MAXLENGTH=8>
 
-print <<END;
 <BR>
-<INPUT TYPE="submit" VALUE="Apply">
-END
+<CENTER><INPUT TYPE="submit" VALUE="Apply"></CENTER>
 
-print <<END;
+</FORM>
 
-    </FORM>
-  </BODY>
+</BODY>
 </HTML>
-END
-
-%>

--- NEW FILE: access_user.html ---
<%= include( 'elements/edit.html',
                 'name'   => 'Internal User',
                 'table'  => 'access_user',
                 'fields' => [
                               'username',
                               { field=>'_password', type=>'password' },
                               'last',
                               'first',
                             ],
                 'labels' => { 
                               'usernum'   => 'User number',
                               'username'  => 'Username',
                               '_password' => 'Password',
                               'last'      => 'Last name',
                               'first'     => 'First name',
                             },
                 'viewall_dir' => 'browse',
                 'html_bottom' =>
                   sub {
                     my $access_user = shift;

                     '<BR>Internal Access Groups<BR>'.
                     ntable("#cccccc",2).
                     '<TR><TD>'.
                     include( '/elements/checkboxes-table.html',
                                'source_obj'   => $access_user,
                                'link_table'   => 'access_usergroup',
                                'target_table' => 'access_group',
                                'name_col'     => 'groupname',
                                'target_link'  => $p.'edit/access_group.html?',
                                #'disable-able' => 1,
                            ).
                     '</TR></TD></TABLE>'
                     ;
                   },
           )
%>

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main.cgi,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- cust_main.cgi	9 Apr 2006 23:39:49 -0000	1.61
+++ cust_main.cgi	14 May 2006 16:47:30 -0000	1.62
@@ -397,49 +397,66 @@
 
   if ( @part_pkg ) {
 
-#    print "<BR><BR>First package", &itable("#cccccc", "0 ALIGN=LEFT"),
-#apiabuse & undesirable wrapping
-    print "<BR>First package", &ntable("#cccccc"),
-          qq!<TR><TD COLSPAN=2><SELECT NAME="pkgpart_svcpart">!;
-
-    print qq!<OPTION VALUE="">(none)!;
+    #    print "<BR><BR>First package", &itable("#cccccc", "0 ALIGN=LEFT"),
+    #apiabuse & undesirable wrapping
 
-    foreach my $part_pkg ( @part_pkg ) {
-      print qq!<OPTION VALUE="!,
-#              $part_pkg->pkgpart. "_". $pkgpart{ $part_pkg->pkgpart }, '"';
-              $part_pkg->pkgpart. "_". $part_pkg->svcpart('svc_acct'), '"';
-      print " SELECTED" if $saved_pkgpart && ( $part_pkg->pkgpart == $saved_pkgpart );
-      print ">", $part_pkg->pkg, " - ", $part_pkg->comment;
-    }
-    print "</SELECT></TD></TR>";
+    %>
+    <BR>First package
+    <%= ntable("#cccccc") %>
+    
+      <TR>
+        <TD COLSPAN=2>
+          <SELECT NAME="pkgpart_svcpart">
+            <OPTION VALUE="">(none)
+    
+            <% foreach my $part_pkg ( @part_pkg ) { %>
+    
+              <OPTION VALUE="<%= $part_pkg->pkgpart. "_". $part_pkg->svcpart('svc_acct') %>"<%= ( $saved_pkgpart && $part_pkg->pkgpart == $saved_pkgpart ) ? ' SELECTED' : '' %>><%= $part_pkg->pkg. " - ". $part_pkg->comment %>
+    
+            <% } %>
+          </SELECT>
+        </TD>
+      </TR>
+    
+      <% 
+        #false laziness: (mostly) copied from edit/svc_acct.cgi
+        #$ulen = $svc_acct->dbdef_table->column('username')->length;
+        my $ulen = dbdef->table('svc_acct')->column('username')->length;
+        my $ulen2 = $ulen+2;
+        my $passwordmax = $conf->config('passwordmax') || 8;
+        my $pmax2 = $passwordmax + 2;
+      %>
+    
+      <TR>
+        <TD ALIGN="right">Username</TD>
+        <TD>
+          <INPUT TYPE="text" NAME="username" VALUE="<%= $username %>" SIZE=<%= $ulen2 %> MAXLENGTH=<%= $ulen %>>
+        </TD>
+      </TR>
+    
+      <TR>
+        <TD ALIGN="right">Password</TD>
+        <TD>
+          <INPUT TYPE="text" NAME="_password" VALUE="<%= $password %>" SIZE=<%= $pmax2 %> MAXLENGTH=<%= $passwordmax %>>
+          (blank to generate)
+        </TD>
+      </TR>
+    
+      <TR>
+        <TD ALIGN="right">Access number</TD>
+        <TD><%= FS::svc_acct_pop::popselector($popnum) %></TD>
+      </TR>
+    </TABLE>
+    
+  <% } %>
 
-    #false laziness: (mostly) copied from edit/svc_acct.cgi
-    #$ulen = $svc_acct->dbdef_table->column('username')->length;
-    my $ulen = dbdef->table('svc_acct')->column('username')->length;
-    my $ulen2 = $ulen+2;
-    my $passwordmax = $conf->config('passwordmax') || 8;
-    my $pmax2 = $passwordmax + 2;
-    print <<END;
-<TR><TD ALIGN="right">Username</TD>
-<TD><INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen></TD></TR>
-<TR><TD ALIGN="right">Password</TD>
-<TD><INPUT TYPE="text" NAME="_password" VALUE="$password" SIZE=$pmax2 MAXLENGTH=$passwordmax>
-(blank to generate)</TD></TR>
-END
+<% } %>
 
-    print '<TR><TD ALIGN="right">Access number</TD><TD>'
-          .
-          &FS::svc_acct_pop::popselector($popnum).
-          '</TD></TR></TABLE>'
-          ;
-  }
-}
+<INPUT TYPE="hidden" NAME="otaker" VALUE="<%= $cust_main->otaker %>">
+<BR>
+<INPUT TYPE="submit" NAME="submit" VALUE="<%= $custnum ?  "Apply Changes" : "Add Customer" %>">
+<BR>
+</FORM>
 
-my $otaker = $cust_main->otaker;
-print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!,
-      qq!<BR><INPUT TYPE="submit" NAME="submit" VALUE="!,
-      $custnum ?  "Apply Changes" : "Add Customer", qq!"><BR>!,
-      "</FORM></DIV></BODY></HTML>",
-;
+<%= include('/elements/footer.html') %>
 
-%>

--- NEW FILE: access_group.html ---
<%= include( 'elements/edit.html',
                 'name'   => 'Internal Access Group',
                 'table'  => 'access_group',
                 'labels' => { 
                               'groupnum'   => 'Group number',
                               'groupname'  => 'Group name',
                             },
                 'viewall_dir' => 'browse',
           )
%>

Index: svc_domain.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_domain.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- svc_domain.cgi	9 Jul 2003 14:39:36 -0000	1.10
+++ svc_domain.cgi	14 May 2006 16:47:30 -0000	1.11
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
@@ -66,33 +65,31 @@
 my $domain = $svc_domain->domain;
 
 my $p1 = popurl(1);
-print header("$action $svc", '');
 
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-      "</FONT>"
-  if $cgi->param('error');
+%>
 
-print <<END;
-    <FORM ACTION="${p1}process/svc_domain.cgi" METHOD=POST>
-      <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
-      <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
-      <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
-END
+<%= include('/elements/header.html', "$action $svc", '') %>
 
-print qq!<INPUT TYPE="radio" NAME="action" VALUE="N"!;
-print ' CHECKED' if $kludge_action eq 'N';
-print qq!>New!;
-print qq!<BR><INPUT TYPE="radio" NAME="action" VALUE="M"!;
-print ' CHECKED' if $kludge_action eq 'M';
-print qq!>Transfer!;
+<% if ( $cgi->param('error') ) { %>
+  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+<% } %>
+
+<FORM ACTION="<%= $p1 %>process/svc_domain.cgi" METHOD=POST>
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%= $svcnum %>">
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%= $pkgnum %>">
+<INPUT TYPE="hidden" NAME="svcpart" VALUE="<%= $svcpart %>">
+
+<INPUT TYPE="radio" NAME="action" VALUE="N"<%= $kludge_action eq 'N' ? ' CHECKED' : '' %>>New
+<BR>
+
+<INPUT TYPE="radio" NAME="action" VALUE="M"<%= $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer
+
+<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="<%= $domain %>" SIZE=28 MAXLENGTH=63>
+
+<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="<%= $purpose %>" SIZE=64>
 
-print <<END;
-<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=63>
-<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="$purpose" SIZE=64>
 <P><INPUT TYPE="submit" VALUE="Submit">
-    </FORM>
-  </BODY>
-</HTML>
-END
 
-%>
+</FORM>
+
+<%= include('/elements/footer.html') %>

Index: part_virtual_field.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_virtual_field.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- part_virtual_field.cgi	12 Jan 2004 20:40:28 -0000	1.3
+++ part_virtual_field.cgi	14 May 2006 16:47:30 -0000	1.4
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 my ($vfieldpart, $part_virtual_field);
 
@@ -21,12 +20,14 @@
 my $action = $part_virtual_field->vfieldpart ? 'Edit' : 'Add';
 
 my $p1 = popurl(1);
-print header("$action Virtual Field Definition", '');
 
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-      "</FONT>"
-  if $cgi->param('error');
-%>
+%><%= include('/elements/header.html', "$action Virtual Field Definition") %>
+
+<% if ( $cgi->param('error') ) { %>
+  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+  <BR><BR>
+<% } %>
+
 <FORM ACTION="<%=$p1%>process/generic.cgi" METHOD="POST">
 
 <INPUT TYPE="hidden" NAME="table" VALUE="part_virtual_field">
@@ -83,10 +84,8 @@
 
 </FORM>
 
-<BR><BR>
+<BR>
 <FONT SIZE=-2>If you don't understand what <I>check_block</I> and 
 <I>list_source</I> mean, <B>LEAVE THEM BLANK</B>.  We mean it.</FONT>
 
-
-</BODY>
-</HTML>
+<%= include('/elements/footer.html') %>

Index: cust_credit_bill.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_credit_bill.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cust_credit_bill.cgi	10 Feb 2002 16:05:22 -0000	1.9
+++ cust_credit_bill.cgi	14 May 2006 16:47:30 -0000	1.10
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my($crednum, $amount, $invnum);
@@ -23,79 +22,78 @@
 
 my $p1 = popurl(1);
 
-print header("Apply Credit", '');
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-      "</FONT><BR><BR>"
-  if $cgi->param('error');
-print <<END;
-    <FORM ACTION="${p1}process/cust_credit_bill.cgi" METHOD=POST>
-END
+%><%=  header("Apply Credit", '') %>
+
+<% if ( $cgi->param('error') ) { %>
+  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+  <BR><BR>
+<% } %>
 
+<FORM ACTION="<%= $p1 %>process/cust_credit_bill.cgi" METHOD=POST>
+
+<%
 my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } );
 die "credit $crednum not found!" unless $cust_credit;
 
 my $credited = $cust_credit->credited;
+%>
 
-print "Credit # <B>$crednum</B>".
-      qq!<INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!.
-      '<BR>Date: <B>'. time2str("%D", $cust_credit->_date). '</B>'.
-      '<BR>Amount: $<B>'. $cust_credit->amount. '</B>'.
-      "<BR>Unapplied amount: \$<B>$credited</B>".
-      '<BR>Reason: <B>'. $cust_credit->reason. '</B>'
-      ;
+Credit #<B><%= $crednum %></B>
+<INPUT TYPE="hidden" NAME="crednum" VALUE="<%= $crednum %>">
+
+<BR>Date: <B><%= time2str("%D", $cust_credit->_date) %></B>
+
+<BR>Amount: $<B><%= $cust_credit->amount %></B>
+
+<BR>Unapplied amount: $<B><%= $credited %></B>
 
+<BR>Reason: <B><%= $cust_credit->reason %></B>
+
+<%
 my @cust_bill = grep $_->owed != 0,
                 qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } );
 
-print <<END;
+%>
+
 <SCRIPT>
 function changed(what) {
   cust_bill = what.options[what.selectedIndex].value;
-END
 
-foreach my $cust_bill ( @cust_bill ) {
+<% foreach my $cust_bill ( @cust_bill ) {
   my $invnum = $cust_bill->invnum;
   my $changeto = $cust_bill->owed < $cust_credit->credited
                    ? $cust_bill->owed 
                    : $cust_credit->credited;
-  print <<END;
+%>
   if ( cust_bill == $invnum ) {
-    what.form.amount.value = "$changeto";
+    what.form.amount.value = "<%= $changeto %>";
   }
-END
-}
+<% } %>
 
-print <<END;
   if ( cust_bill == "Refund" ) {
-    what.form.amount.value = "$credited";
+    what.form.amount.value = "<%= $credited %>";
   }
 }
 </SCRIPT>
-END
 
-print qq!<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">!,
-      '<OPTION VALUE="">';
-foreach my $cust_bill ( @cust_bill ) {
-  print '<OPTION'. ( $cust_bill->invnum eq $invnum ? ' SELECTED' : '' ).
-        ' VALUE="'. $cust_bill->invnum. '">'. $cust_bill->invnum.
-        ' -  '. time2str("%D",$cust_bill->_date).
-        ' - $'. $cust_bill->owed;
-}
-print qq!<OPTION VALUE="Refund">Refund!;
-print "</SELECT>";
+<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">
+<OPTION VALUE="">
 
-print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
+<% foreach my $cust_bill ( @cust_bill ) { %>
+
+<OPTION<%= $cust_bill->invnum eq $invnum ? ' SELECTED' : '' %> VALUE="<%= $cust_bill->invnum %>"><%= $cust_bill->invnum %> - <%= time2str("%D",$cust_bill->_date) %> - $<%= $cust_bill->owed %>
+
+<% } %>
+
+<OPTION VALUE="Refund">Refund
+</SELECT>
+
+<BR>Amount $<INPUT TYPE="text" NAME="amount" VALUE="<%= $amount %>" SIZE=8 MAXLENGTH=8>
 
-print <<END;
 <BR>
-<INPUT TYPE="submit" VALUE="Apply">
-END
+<CENTER><INPUT TYPE="submit" VALUE="Apply"></CENTER>
 
-print <<END;
+</FORM>
 
-    </FORM>
-  </BODY>
+</BODY>
 </HTML>
-END
-
-%>

Index: cust_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_credit.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cust_credit.cgi	10 Feb 2002 16:05:22 -0000	1.10
+++ cust_credit.cgi	14 May 2006 16:47:30 -0000	1.11
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my $conf = new FS::Conf;
@@ -25,39 +24,57 @@
 
 my $p1 = popurl(1);
 
-print header("Post Credit", '');
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-      "</FONT>"
-  if $cgi->param('error');
-print <<END, small_custview($custnum, $conf->config('countrydefault'));
-    <FORM ACTION="${p1}process/cust_credit.cgi" METHOD=POST>
-    <INPUT TYPE="hidden" NAME="crednum" VALUE="">
-    <INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">
-    <INPUT TYPE="hidden" NAME="paybatch" VALUE="">
-    <INPUT TYPE="hidden" NAME="_date" VALUE="$_date">
-    <INPUT TYPE="hidden" NAME="credited" VALUE="">
-    <INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">
-END
+%>
 
-print '<BR><BR>Credit'. ntable("#cccccc", 2).
-      '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'.
-      time2str("%D",$_date).  '</TD></TR>';
+<%= header("Post Credit", '') %>
 
-print qq!<TR><TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">\$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8></TD></TR>!;
+<% if ( $cgi->param('error') ) { %>
+  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+  <BR><BR>
+<% } %>
+
+<!-- <%= small_custview($custnum, $conf->config('countrydefault')) %> -->
+
+<FORM ACTION="<%= $p1 %>process/cust_credit.cgi" METHOD=POST>
+<INPUT TYPE="hidden" NAME="crednum" VALUE="">
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $custnum %>">
+<INPUT TYPE="hidden" NAME="paybatch" VALUE="">
+<INPUT TYPE="hidden" NAME="_date" VALUE="<%= $_date %>">
+<INPUT TYPE="hidden" NAME="credited" VALUE="">
+<INPUT TYPE="hidden" NAME="otaker" VALUE="<%= $otaker %>">
 
+Credit
+
+<%= ntable("#cccccc", 2) %>
+
+  <TR>
+    <TD ALIGN="right">Date</TD>
+    <TD BGCOLOR="#ffffff"><%= time2str("%D",$_date) %></TD>
+  </TR>
+
+  <TR>
+    <TD ALIGN="right">Amount</TD>
+    <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="amount" VALUE="<%= $amount %>" SIZE=8 MAXLENGTH=8></TD>
+  </TR>
+
+<%
 #print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
+%>
 
-print qq!<TR><TD ALIGN="right">Reason</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="$reason"></TD></TR>!;
+  <TR>
+    <TD ALIGN="right">Reason</TD>
+    <TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="<%= $reason %>" SIZE=32></TD>
+  </TR>
 
-print qq!<TR><TD ALIGN="right">Auto-apply<BR>to invoices</TD><TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>!;
+  <TR>
+    <TD ALIGN="right">Auto-apply<BR>to invoices</TD>
+    <TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>
+  </TR>
 
-print <<END;
 </TABLE>
+
 <BR>
-<INPUT TYPE="submit" VALUE="Post credit">
+<CENTER><INPUT TYPE="submit" VALUE="Post credit"></CENTER>
     </FORM>
   </BODY>
 </HTML>
-END
-
-%>

Index: agent_type.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent_type.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- agent_type.cgi	31 Jan 2006 04:26:54 -0000	1.14
+++ agent_type.cgi	14 May 2006 16:47:30 -0000	1.15
@@ -14,9 +14,7 @@
 }
 my $action = $agent_type->typenum ? 'Edit' : 'Add';
 
-%>
-
-<%= include("/elements/header.html","$action Agent Type", menubar(
+%><%= include("/elements/header.html","$action Agent Type", menubar(
   'Main Menu' => "$p",
   'View all agent types' => "${p}browse/agent_type.cgi",
 ))
@@ -29,47 +27,29 @@
 <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>
+<BR>
 
 Agent Type
 <INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="<%= $agent_type->atype %>">
 <BR><BR>
 
 Select which packages agents of this type may sell to customers<BR>
+<%= ntable("#cccccc", 2) %><TR><TD>
+<%= include('/elements/checkboxes-table.html',
+              'source_obj'    => $agent_type,
+              'link_table'    => 'type_pkgs',
+              'target_table'  => 'part_pkg',
+              'name_callback' => sub { $_[0]->pkg. ' - '. $_[0]->comment; },
+              'target_link'   => $p.'edit/part_pkg.cgi?',
+              'disable-able'  => 1,
 
-<% foreach my $part_pkg (
-     qsearch({ 'table'     => 'part_pkg',
-               'hashref'   => { 'disabled' => '' },
-               'select'    => 'part_pkg.*',
-               'addl_from' => 'LEFT JOIN type_pkgs USING ( pkgpart )',
-               'extra_sql' => ( $agent_type->typenum
-                                  ? 'OR typenum = '. $agent_type->typenum
-                                  : ''
-                              ),
-            })
-   ) {
+           )
 %>
-
-  <BR>
-  <INPUT TYPE="checkbox" NAME="pkgpart<%= $part_pkg->pkgpart %>" <%=
-        qsearchs('type_pkgs',{
-          'typenum' => $agent_type->typenum,
-          'pkgpart' => $part_pkg->pkgpart,
-        })
-          ? 'CHECKED '
-          : ''
-  %> VALUE="ON">
-
-  <A HREF="<%= $p %>edit/part_pkg.cgi?<%= $part_pkg->pkgpart %>"><%= $part_pkg->pkgpart %>: 
-  <%= $part_pkg->pkg %> - <%= $part_pkg->comment %></A>
-  <%= $part_pkg->disabled =~ /^Y/i ? ' (DISABLED)' : '' %>
-
-<% } %>
-
-<BR><BR>
+</TD></TR></TABLE>
+<BR>
 
 <INPUT TYPE="submit" VALUE="<%= $agent_type->typenum ? "Apply changes" : "Add agent type" %>">
 
     </FORM>
-  </BODY>
-</HTML>
+
+<%= include('/elements/footer.html') %>

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_pkg.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cust_pkg.cgi	22 Feb 2005 18:26:01 -0000	1.10
+++ cust_pkg.cgi	14 May 2006 16:47:30 -0000	1.11
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my %pkg = ();
@@ -29,48 +28,62 @@
 }
 
 my $p1 = popurl(1);
-print header("Add/Edit Packages", '');
 
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-      "</FONT>"
-  if $cgi->param('error');
+%><%= include('/elements/header.html', "Add/Edit Packages", '') %>
 
-print qq!<FORM ACTION="${p1}process/cust_pkg.cgi" METHOD=POST>!;
+<% if ( $cgi->param('error') ) { %>
+  <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+<% } %>
 
-print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
+<FORM ACTION="<%= $p1 %>process/cust_pkg.cgi" METHOD=POST>
+
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $custnum %>">
 
+<%
 #current packages
-my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } );
+my @cust_pkg = qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } );
 
 if (@cust_pkg) {
-  print <<END;
-Current packages - select to remove (services are moved to a new package below)
-<TABLE>
-  <TR STYLE="background-color: #cccccc;">
-    <TH COLSPAN="2">Pkg #</TH>
-    <TH>Package description</TH>
-  </TR>
-<BR><BR>
-END
+%>
 
-  foreach (sort { $all_pkg{$a->getfield('pkgpart')} cmp $all_pkg{$b->getfield('pkgpart')} } @cust_pkg) {
+  Current packages - select to remove (services are moved to a new package below)
+  <TABLE>
+    <TR STYLE="background-color: #cccccc;">
+      <TH COLSPAN="2">Pkg #</TH>
+      <TH>Package description</TH>
+    </TR>
+  <BR><BR>
+
+  <%
+
+  foreach ( sort {     $all_pkg{ $a->getfield('pkgpart') }
+                   cmp $all_pkg{ $b->getfield('pkgpart') }
+                 }
+                 @cust_pkg
+          )
+  {
     my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') );
     my $checked = $remove_pkg{$pkgnum} ? ' CHECKED' : '';
-    print <<END;
-  <TR>
-    <TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum"${checked}></TD>
-    <TD ALIGN="right">$pkgnum:</TD>\n
-    <TD>$all_pkg{$pkgpart} - $all_comment{$pkgpart}</TD>
-  </TR>
-END
-  }
-  print qq!</TABLE><BR><BR>!;
-}
 
-print <<END;
-Order new packages<BR><BR>
-END
+  %>
+
+    <TR>
+      <TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="<%= $pkgnum %>"<%= $checked %>></TD>
+      <TD ALIGN="right"><%= $pkgnum %>:</TD>
+      <TD><%= $all_pkg{$pkgpart} %> - <%= $all_comment{$pkgpart} %></TD>
+    </TR>
+
+  <% } %>
+
+  </TABLE>
+  <BR><BR>
 
+<% } %>
+
+Order new packages
+<BR><BR>
+
+<%
 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
 my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum });
 
@@ -79,13 +92,15 @@
 
 my $count = 0;
 my $pkgparts = 0;
-print <<END;
+%>
+
 <TABLE>
   <TR STYLE="background-color: #cccccc;">
     <TH>Qty.</TH>
     <TH COLSPAN="2">Package Description</TH>
   </TR>
-END
+
+<%
 #foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
 foreach my $pkgpart ( sort { $agent_pkgs{$a} cmp $agent_pkgs{$b} }
                              keys(%agent_pkgs) ) {
@@ -93,38 +108,43 @@
   next unless exists $pkg{$pkgpart}; #skip disabled ones
   #print qq!<TR>! if ( $count == 0 );
   my $value = $cgi->param("pkg$pkgpart") || 0;
-  print <<END;
+%>
+
   <TR>
-    <TD><INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="$value" SIZE="2" MAXLENGTH="2"></TD>
-    <TD ALIGN="right">$pkgpart:</TD>
-    <TD>$pkg{$pkgpart} - $comment{$pkgpart}</TD>
+    <TD>
+      <INPUT TYPE="text" NAME="<%= "pkg$pkgpart" %>" VALUE="<%= $value %>" SIZE="2" MAXLENGTH="2">
+    </TD>
+    <TD ALIGN="right"><%= $pkgpart %>:</TD>
+    <TD><%= $pkg{$pkgpart} %> - <%= $comment{$pkgpart}%></TD>
   </TR>
-END
+
+<%
   $count ++ ;
   #if ( $count == 2 ) {
   #  print qq!</TR>\n! ;
   #  $count = 0;
   #}
 }
-print qq!</TABLE>!;
+%>
 
-unless ( $pkgparts ) {
-  my $p2 = popurl(2);
-  my $typenum = $agent->typenum;
-  my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
-  my $atype = $agent_type->atype;
-  print <<END;
-(No <a href="${p2}browse/part_pkg.cgi">package definitions</a>, or agent type
-<a href="${p2}edit/agent_type.cgi?$typenum">$atype</a> not allowed to purchase
-any packages.)
-END
-}
+</TABLE>
 
-#submit
-print <<END;
-<P><INPUT TYPE="submit" VALUE="Order">
-    </FORM>
-  </BODY>
-</HTML>
-END
+<% unless ( $pkgparts ) {
+     my $p2 = popurl(2);
+     my $typenum = $agent->typenum;
+     my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
+     my $atype = $agent_type->atype;
 %>
+
+     (No <A HREF="<%= $p2 %>browse/part_pkg.cgi">package definitions</A>,
+     or agent type
+     <A HREF="<%= $p2 %>edit/agent_type.cgi?<%= $typenum %>"><%= $atype %></a>
+     is not allowed to purchase any packages.)
+
+<% } %>
+
+<P><INPUT TYPE="submit" VALUE="Order">
+
+</FORM>
+
+<%= include('/elements/footer.html') %>

Index: part_referral.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_referral.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- part_referral.cgi	30 Mar 2002 02:35:15 -0000	1.9
+++ part_referral.cgi	14 May 2006 16:47:30 -0000	1.10
@@ -1,4 +1,3 @@
-<!-- mason kludge -->
 <%
 
 my $part_referral;
@@ -17,32 +16,29 @@
 my $hashref = $part_referral->hashref;
 
 my $p1 = popurl(1);
-print header("$action Advertising source", menubar(
+
+%><%= include('/elements/header.html', "$action Advertising source", menubar(
   'Main Menu' => popurl(2),
   'View all advertising sources' => popurl(2). "browse/part_referral.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 qq!<FORM ACTION="${p1}process/part_referral.cgi" METHOD=POST>!;
+<FORM ACTION="<%= $p1 %>process/part_referral.cgi" METHOD=POST>
 
-print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$hashref->{refnum}">!;
+<INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $hashref->{refnum} %>">
+
+<%
 #print "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)";
+%>
 
-print <<END;
-Advertising source <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="$hashref->{referral}">
-END
+Advertising source <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="<%= $hashref->{referral} %>">
 
-print qq!<BR><INPUT TYPE="submit" VALUE="!,
-      $hashref->{refnum} ? "Apply changes" : "Add advertising source",
-      qq!">!;
+<BR>
+<INPUT TYPE="submit" VALUE="<%= $hashref->{refnum} ? "Apply changes" : "Add advertising source" %>">
 
-print <<END;
-    </FORM>
-  </BODY>
-</HTML>
-END
+</FORM>
 
-%>
+<%= include('/elements/footer.html') %>



More information about the freeside-commits mailing list