Esempio n. 1
0
            dol_print_error($db);
        }
    } else {
        if ($action == 'deletecontact' && $user->rights->societe->creer) {
            $object->fetch($id);
            $result = $object->delete_contact($_GET["lineid"]);
            if ($result >= 0) {
                header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
                exit;
            } else {
                dol_print_error($db);
            }
        } else {
            if ($action == 'setaddress' && $user->rights->societe->creer) {
                $object->fetch($id);
                $result = $object->setDeliveryAddress($_POST['fk_address']);
                if ($result < 0) {
                    dol_print_error($db, $object->error);
                }
            }
        }
    }
}
/*
 * View
 */
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('', $langs->trans("ThirdParty"), $help_url);
$form = new Form($db);
$formcompany = new FormCompany($db);
$formother = new FormOther($db);