コード例 #1
0
ファイル: card.php プロジェクト: Samara94/dolibarr
    }
}
if ($action == 'set_paid') {
    if ($object->set_paid($id, $modepayment) >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
        exit;
    } else {
        setEventMessages($object->error, $object->errors, 'errors');
    }
}
// Remove file in doc form
if ($action == 'remove_file') {
    $object = new Don($db, 0, $_GET['id']);
    if ($object->fetch($id)) {
        require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
        $object->fetch_thirdparty();
        $langs->load("other");
        $upload_dir = $conf->don->dir_output;
        $file = $upload_dir . '/' . GETPOST('file');
        $ret = dol_delete_file($file, 0, 0, 0, $object);
        if ($ret) {
            setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
        } else {
            setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
        }
        $action = '';
    }
}
/*
 * Build doc
 */