Example #1
0
                $mesg = '<div class="error">' . $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType") . '</div>';
            } else {
                $mesg = '<div class="error">' . $object->error . '</div>';
            }
        }
    } else {
        if ($action == 'swapstatut') {
            if ($object->fetch($id)) {
                $result = $object->swapContactStatus(GETPOST('ligne'));
            } else {
                dol_print_error($db);
            }
        } else {
            if ($action == 'deletecontact') {
                $object->fetch($id);
                $result = $object->delete_contact(GETPOST('lineid'));
                if ($result >= 0) {
                    header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
                    exit;
                } else {
                    dol_print_error($db);
                }
            }
        }
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("ContractCard"), "Contrat");
$form = new Form($db);