} if ($result >= 0) { header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); exit; } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } else { setEventMessages(null, $object->errors, 'errors'); } } } else { if ($action == 'swapstatut' && $user->rights->lead->write) { if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); } } else { if ($action == 'deletecontact' && $user->rights->lead->write) { $result = $object->delete_contact($lineid); if ($result >= 0) { header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); exit; } else { dol_print_error($db); } } } } /* * View