Exemplo n.º 1
0
            }
        }
        if ($result > 0) {
            header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
            exit;
        } else {
            setEventMessages($object->error, $object->errors, 'errors');
        }
    } else {
        setEventMessages("NOT_AUTHOR", '', 'errors');
    }
}
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid) {
    $object = new ExpenseReport($db);
    $object->fetch($id);
    $result = $object->set_paid($id, $user);
    if ($result > 0) {
        // Define output language
        if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
            $outputlangs = $langs;
            $newlang = '';
            if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) {
                $newlang = GETPOST('lang_id', 'alpha');
            }
            if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
                $newlang = $object->thirdparty->default_lang;
            }
            if (!empty($newlang)) {
                $outputlangs = new Translate("", $conf);
                $outputlangs->setDefaultLang($newlang);
            }