Example #1
0
            setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
        } else {
            setEventMessage($object->error, 'errors');
        }
    }
} else {
    if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer) {
        if ($object->fetch($id)) {
            $result = $object->swapContactStatus(GETPOST('ligne'));
        } else {
            dol_print_error($db);
        }
    } else {
        if ($action == 'deletecontact' && $user->rights->fournisseur->commande->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);
            }
        }
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("Order"), "Commande");
$form = new Form($db);
$formcompany = new FormCompany($db);
Example #2
0
        $result = $commande->update_contact($_GET["ligne"], $statut, $id_type_contact);
        if ($result >= 0) {
            $db->commit();
        } else {
            dol_print_error($db, "result={$result}");
            $db->rollback();
        }
    } else {
        dol_print_error($db);
    }
}
// Efface un contact
if ($_GET["action"] == 'deleteline' && $user->rights->fournisseur->commande->creer) {
    $commande = new CommandeFournisseur($db);
    $commande->fetch($_GET["id"]);
    $result = $commande->delete_contact($_GET["lineid"]);
    if ($result >= 0) {
        Header("Location: contact.php?id=" . $commande->id);
        exit;
    } else {
        dol_print_error($db);
    }
}
/*
 * View
 */
llxHeader('', $langs->trans("Order"), "Commande");
$html = new Form($db);
$formcompany = new FormCompany($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);