コード例 #1
0
ファイル: card.php プロジェクト: Samara94/dolibarr
        }
    }
}
if ($action == 'update' && $user->rights->expensereport->creer) {
    $object = new ExpenseReport($db);
    $object->fetch($id);
    $object->date_debut = $date_start;
    $object->date_fin = $date_end;
    if ($object->fk_statut < 3) {
        $object->fk_user_validator = GETPOST('fk_user_validator', 'int');
    }
    $object->fk_c_paiement = GETPOST('fk_c_paiement', 'int');
    $object->note_public = GETPOST('note_public');
    $object->note_private = GETPOST('note_private');
    $object->fk_user_modif = $user->id;
    $result = $object->update($user);
    if ($result > 0) {
        header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $_POST['id']);
        exit;
    } else {
        setEventMessages($object->error, $object->errors, 'errors');
    }
}
if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->creer) {
    $object = new ExpenseReport($db);
    $object->fetch($id);
    $result = $object->setValidate($user);
    if ($result > 0) {
        // Define output language
        if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
            $outputlangs = $langs;