first part of ACL and re-skinning work and some other small stuff
[freeside.git] / httemplate / edit / cust_main.cgi
index e10c85f..bb2a861 100755 (executable)
@@ -70,7 +70,11 @@ my $action = $custnum ? 'Edit' : 'Add';
 
 <!-- top -->
 
-<%= header("Customer $action", '', ' onUnload="myclose()"') %>
+<%= include('/elements/header.html',
+      "Customer $action",
+      '',
+      ' onUnload="myclose()"'
+) %>
 
 <% if ( $error ) { %>
 <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $error %></FONT>
@@ -234,7 +238,10 @@ Service address
 
 <!-- billing info -->
 
-<%= include('cust_main/billing.html', $cust_main ) %>
+<%= include( 'cust_main/billing.html', $cust_main,
+               'invoicing_list' => \@invoicing_list,
+           )
+%>
 
 <SCRIPT>
 function bottomfixup(what) {
@@ -268,7 +275,8 @@ function bottomfixup(what) {
 
   var billing_bottomvars = new Array(
     'tax',
-    'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX'
+    'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX',
+    'spool_cdr'
   );
 
   for ( f=0; f < topvars.length; f++ ) {
@@ -345,7 +353,8 @@ function copyelement(from, to) {
      'paid',
      
      'tax',
-     'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX'
+     'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX',
+     'spool_cdr'
    ) {
 %>
   <INPUT TYPE="hidden" NAME="<%= $hidden %>" VALUE="">
@@ -388,49 +397,66 @@ unless ( $custnum ) {
 
   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 "<BR><BR>First package", &itable("#cccccc", "0 ALIGN=LEFT"),
+    #apiabuse & undesirable wrapping
+
+    %>
+    <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>
+    
+  <% } %>
 
-    print qq!<OPTION VALUE="">(none)!;
+<% } %>
 
-    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>";
-
-    #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') %>
 
-%>