$GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read); $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write); } } else { $GO_SECURITY->delete_acl($acl_read); $GO_SECURITY->delete_acl($acl_write); $feedback = "<p class=\"Error\">" . $strSaveError . "</p>"; } } elseif (isset($new_company_id) && $new_company_id != $company_id) { $company_id = $new_company_id; } //translate the given birthdayto gmt unix time $birthday = date_to_db_date($_POST['birthday']); $group_id = isset($_POST['group_id']) ? $_POST['group_id'] : '0'; if ($_POST['contact_id'] > 0) { if ($ab->update_contact($_POST['contact_id'], $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $initials, $title, $_POST['sex'], $birthday, $email, $work_phone, $home_phone, $fax, $cellular, $country, $state, $city, $zip, $address, $company_id, $work_fax, $department, $function, $comment, $group_id, $_POST['color'])) { if ($_POST['close'] == 'true') { header('Location: ' . $return_to); exit; } } else { $feedback = "<p class=\"Error\">" . $strSaveError . "</p>"; } } else { $acl_read = $GO_SECURITY->get_new_acl('contact read'); $acl_write = $GO_SECURITY->get_new_acl('contact write'); if ($acl_read > 0 && $acl_write > 0 && ($contact_id = $ab->add_contact($_POST['source_id'], $GO_SECURITY->user_id, $_POST['addressbook_id'], $first_name, $middle_name, $last_name, $_POST['initials'], $_POST['title'], $_POST['sex'], $birthday, $email, $work_phone, $home_phone, $fax, $cellular, $country, $state, $city, $zip, $address, $company_id, $work_fax, $department, $function, $comment, $group_id, $_POST['color'], $acl_read, $acl_write))) { if ($addressbook = $ab->get_addressbook($addressbook_id)) { $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read); $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write); }