if ($result >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
        exit;
    } else {
        if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
            $langs->load("errors");
            $mesg = '<div class="error">' . $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType") . '</div>';
        } else {
            $mesg = '<div class="error">' . $object->error . '</div>';
        }
    }
}
// bascule du statut d'un contact
if ($action == 'swapstatut' && $user->rights->contrat->creer) {
    if ($object->fetch($id)) {
        $result = $object->swapContactStatus(GETPOST('ligne'));
    } else {
        dol_print_error($db, $object->error);
    }
}
// Efface un contact
if ($action == 'deletecontact' && $user->rights->contrat->creer) {
    $object->fetch($id);
    $result = $object->delete_contact($_GET["lineid"]);
    if ($result >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
        exit;
    }
}
/*
 * View