?> " /> <?php module_form::prevent_exit(array('valid_exits' => array('.submit_button'))); $required = array('fields' => array('name' => 'Name')); if (module_config::c('user_email_required', 1)) { $required['fields']['email'] = true; } module_form::set_required($required); // check if this customer is linked to anyone else. and isn't the primary $contact_links = array(); if ((int) $user_id > 0 && $use_master_key == 'customer_id') { $this_one_is_linked_primary = false; $contact_links = module_user::get_contact_customer_links($user['user_id']); if (count($contact_links)) { // check if this user is primary. $this_one_is_linked_primary = $user['linked_parent_user_id'] == $user_id; $c = array(); foreach ($contact_links as $contact_link) { $other_contact = module_user::get_user($contact_link['user_id']); if ($this_one_is_linked_primary && !$other_contact['linked_parent_user_id']) { // hack to ensure data validity $other_contact['linked_parent_user_id'] = $user_id; update_insert('user_id', $other_contact['user_id'], 'user', array('linked_parent_user_id' => $user_id)); } $c[] = module_customer::link_open($contact_link['customer_id'], true); } if ($this_one_is_linked_primary) { ?>