Esempio n. 1
0
    }
    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>';
        }
    }
} else {
    if ($action == 'swapstatut' && $user->rights->propale->creer) {
        if ($object->fetch($id) > 0) {
            $result = $object->swapContactStatus(GETPOST('ligne'));
        } else {
            dol_print_error($db);
        }
    } else {
        if ($action == 'deletecontact' && $user->rights->propale->creer) {
            $object->fetch($id);
            $result = $object->delete_contact($lineid);
            if ($result >= 0) {
                Header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
                exit;
            } else {
                dol_print_error($db);
            }
        } else {
            if ($action == 'setaddress' && $user->rights->propale->creer) {