Option to ignore old CDRs, RT#81480
[freeside.git] / httemplate / edit / cust_main-contacts.html
index bae58bd..317257b 100644 (file)
@@ -1,41 +1,73 @@
-<% include('elements/edit.html',
-     'name_singular'   => 'customer contacts', #yes, we're editing all of them
-     'table'           => 'cust_main',
-     'post_url'       => popurl(1). 'process/cust_main-contacts.html',
-     'labels'          => { 'custnum'     => ' ', #XXX supress this line entirely, its being redundant
-                            'contactnum'  => 'Contact',
-                            #'locationnum' => '&nbsp;',
-                          },
-     'fields'          => [
+<%doc>
+
+Hmm, this is now entirely redundant with edit/cust_main/contacts_new.html, and
+this one isn't being maintained well.  :/
+
+</%doc>
+
+<SCRIPT>
+  function checkPasswordValidation(fieldid)  {
+    var validationResult = document.getElementById(fieldid+'_result').innerHTML;
+    if (validationResult.match(/Password valid!/)) {
+      return true;
+    }
+    else {
+      return false;
+    }
+  }
+</SCRIPT>
+
+<& '/elements/validate_password_js.html', &>
+
+<& elements/edit.html,
+     'name_singular'    => 'customer contacts', #yes, we're editing all of them
+     'table'            => 'cust_main',
+     'post_url'         => popurl(1). 'process/cust_main-contacts.html',
+     'no_pkey_display'  => 1,
+     'submit_id'        => 'submit',
+     'labels'           => {
+                             'contactnum'  => ' ', #'Contact',
+                             #'locationnum' => '&nbsp;',
+                           },
+     'fields'           => [
        { 'field'             => 'contactnum',
          'type'              => 'contact',
          'colspan'           => 6,
+         'custnum'           => $custnum,
          'm2m_method'        => 'cust_contact',
          'm2m_dstcol'        => 'contactnum',   
-         'm2_label'          => 'Contact',
+         'm2_label'          => ' ', #'Contact',
          'm2_error_callback' => $m2_error_callback,
        },
      ],
-     #'new_callback'    => $new_callback,
-     #'edit_callback'   => $edit_callback,
-     #'error_callback'  => $error_callback,
-     'agent_virt'      => 1,
+     #'new_callback'     => $new_callback,
+     #'edit_callback'    => $edit_callback,
+     #'error_callback'   => $error_callback,
+     'agent_virt'       => 1,
+     'html_table_class' => 'fsinnerbox',
      'menubar'          => [], #remove "view all" link
 
      #XXX it would be nice if this could instead be after the error but before
      # the table
-     'html_init'        => include('/elements/small_custview.html',
-                                     $custnum,
-                                     $conf->config('countrydefault') || 'US',
-                                     1, #no balance
-                                  ),
-   )
-%>
+     'html_init'       => include('/elements/small_custview.html',
+                                    $custnum,
+                                    $conf->config('countrydefault') || 'US',
+                                    1, #no balance
+                                 ).
+                          '<BR>',
+&>
 <%init>
 
 my $curuser = $FS::CurrentUser::CurrentUser;
 my $conf = new FS::Conf;
 
+if ( $cgi->param('redirect') ) {
+  my $session = $cgi->param('redirect');
+  my $pref = $curuser->option("redirect$session");
+  die "unknown redirect session $session\n" unless length($pref);
+  $cgi = new CGI($pref);
+}
+
 my $custnum;
 if ( $cgi->param('error') ) {
   $custnum = scalar($cgi->param('custnum'));
@@ -75,7 +107,7 @@ my $m2_error_callback = sub {
   my($cgi, $object) = @_;
 
   #process_o2m fields in process/cust_main-contacts.html
-  my @fields = qw( first last title comment );
+  my @fields = FS::contact->cgi_contact_fields;
   my @gfields = ( '', map "_$_", @fields );
 
   map {