if ($_POST['close'] == 'true') { header('Location: ' . $return_to); exit; } } } } else { if ($name == '') { $feedback = '<p class="Error">' . $error_missing_field . '</p>'; } elseif ($notes->get_note_by_name($name)) { $feedback = '<p class="Error">' . $pm_note_exists . '</p>'; } else { $acl_read = $GO_SECURITY->get_new_acl('note read'); $acl_write = $GO_SECURITY->get_new_acl('note write'); if ($acl_read > 0 && $acl_write > 0) { if (!($note_id = $notes->add_note($_POST['user_id'], $_POST['contact_id'], $_POST['project_id'], addslashes($_POST['file_path']), $_POST['catagory_id'], $_POST['responsible_user_id'], $due_date, $name, smart_addslashes($_POST['content']), $acl_read, $acl_write))) { $GO_SECURITY->delete_acl($acl_read); $GO_SECURITY->delete_acl($acl_write); $feedback = '<p class="Error">' . $strSaveError . '</p>'; } else { if ($_POST['contact_id'] > 0) { $addressbook = $ab->get_contact($_POST['contact_id']); $GO_SECURITY->copy_acl($addressbook['acl_read'], $acl_read); $GO_SECURITY->copy_acl($addressbook['acl_write'], $acl_write); } elseif ($_POST['project_id'] > 0) { $projects = new projects(); $project = $projects->get_project($_POST['project_id']); $GO_SECURITY->copy_acl($project['acl_read'], $acl_read); $GO_SECURITY->copy_acl($project['acl_write'], $acl_write); } elseif ($_POST['file_path'] != '') { require_once $GO_CONFIG->class_path . 'filesystem.class.inc';