2 function checkPasswordValidation(fieldid) {
3 var validationResult = document.getElementById(fieldid+'_result').innerHTML;
4 if (validationResult.match(/Password valid!/)) {
13 <& elements/edit.html,
14 'name_singular' => 'customer contacts', #yes, we're editing all of them
15 'table' => 'cust_main',
16 'post_url' => popurl(1). 'process/cust_main-contacts.html',
17 'no_pkey_display' => 1,
18 'labels' => { 'custnum' => ' ', #XXX supress this line entirely, its being redundant
19 'contactnum' => ' ', #'Contact',
20 #'locationnum' => ' ',
23 { 'field' => 'contactnum',
26 'custnum' => $custnum,
27 'm2m_method' => 'cust_contact',
28 'm2m_dstcol' => 'contactnum',
29 'm2_label' => ' ', #'Contact',
30 'm2_error_callback' => $m2_error_callback,
33 #'new_callback' => $new_callback,
34 #'edit_callback' => $edit_callback,
35 #'error_callback' => $error_callback,
37 'menubar' => [], #remove "view all" link
39 #XXX it would be nice if this could instead be after the error but before
41 'html_init' => include('/elements/small_custview.html',
43 $conf->config('countrydefault') || 'US',
49 my $curuser = $FS::CurrentUser::CurrentUser;
50 my $conf = new FS::Conf;
53 if ( $cgi->param('error') ) {
54 $custnum = scalar($cgi->param('custnum'));
57 unless $curuser->access_right(($custnum ? 'Edit' : 'New'). ' customer'); #contacts?
59 } elsif ( $cgi->keywords ) { #editing
60 $custnum = ($cgi->keywords)[0];
63 unless $curuser->access_right('Edit customer');
65 } else { #new customer
67 #this doesn't really work here, we're an edit only
68 die "guru meditation #32";
71 unless $curuser->access_right('New customer');
75 #my $new_callback = sub {
76 # my( $cgi, $prospect_main, $fields_listref, $opt_hashref ) = @_;
79 #my $edit_callback = sub {
80 # my( $cgi, $prospect_main, $fields_listref, $opt_hashref ) = @_;
83 #my $error_callback = sub {
84 # my( $cgi, $prospect_main, $fields_listref, $opt_hashref ) = @_;
87 my $m2_error_callback = sub {
88 my($cgi, $object) = @_;
90 #process_o2m fields in process/cust_main-contacts.html
91 my @fields = qw( first last title comment );
92 my @gfields = ( '', map "_$_", @fields );
95 if ( /^contactnum(\d+)$/ ) {
97 if ( grep $cgi->param("contactnum$num$_"), @gfields ) {
98 my $x = new FS::contact {
99 'contactnum' => scalar($cgi->param("contactnum$num")),
100 map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @fields,