예제 #1
0
파일: card.php 프로젝트: Albertopf/prueba
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$object = new Deplacement($db);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('tripsandexpensescard', 'globalcard'));
$permissionnote = $user->rights->deplacement->creer;
// Used by the include of actions_setnotes.inc.php
/*
 * Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
if ($action == 'validate' && $user->rights->deplacement->creer) {
    $object->fetch($id);
    if ($object->statut == 0) {
        $result = $object->setStatut(1);
        if ($result > 0) {
            header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
            exit;
        } else {
            setEventMessages($object->error, $object->errors, 'errors');
        }
    }
} else {
    if ($action == 'classifyrefunded' && $user->rights->deplacement->creer) {
        $object->fetch($id);
        if ($object->statut == 1) {
            $result = $object->setStatut(2);
            if ($result > 0) {
                header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
                exit;