$object->fetch($id); $result = $object->deleteline(GETPOST('lineid'), $user); if ($result >= 0) { header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); exit; } else { $mesg = $object->error; } } else { if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) { $object->fetch($id); $result = $object->validate($user); } else { if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) { $object->fetch($id); $result = $object->cloture($user); } else { if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) { $object->fetch($id); $object->fetch_thirdparty(); $result = $object->delete($user); if ($result >= 0) { header("Location: index.php"); return; } else { $mesg = '<div class="error">' . $object->error . '</div>'; } } else { if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) { if (GETPOST('newcid') > 0) { $contractline = new ContratLigne($db);