예제 #1
0
    if ($don->set_encaisse($id) >= 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
        exit;
    } else {
        $mesg = $don->error;
    }
}
/*
 * Build doc
 */
if ($action == 'builddoc') {
    $object = new Don($db);
    $object->fetch($id);
    // Save last template used to generate document
    if (GETPOST('model')) {
        $object->setDocModel($user, GETPOST('model', 'alpha'));
    }
    // Define output language
    $outputlangs = $langs;
    $newlang = '';
    if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) {
        $newlang = $_REQUEST['lang_id'];
    }
    if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
        $newlang = $object->client->default_lang;
    }
    if (!empty($newlang)) {
        $outputlangs = new Translate("", $conf);
        $outputlangs->setDefaultLang($newlang);
    }
    $result = don_create($db, $object->id, '', $object->modelpdf, $outputlangs);
예제 #2
0
파일: fiche.php 프로젝트: nrjacker4/crm-php
if ($action == 'set_encaisse') {
    if ($don->set_encaisse($id) >= 0) {
        Header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
        exit;
    } else {
        $mesg = $don->error;
    }
}
/*
 * Build doc
 */
if ($action == 'builddoc') {
    $donation = new Don($db);
    $donation->fetch($id);
    if ($_REQUEST['model']) {
        $donation->setDocModel($user, $_REQUEST['model']);
    }
    // Define output language
    $outputlangs = $langs;
    $newlang = '';
    if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) {
        $newlang = $_REQUEST['lang_id'];
    }
    if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
        $newlang = $donation->client->default_lang;
    }
    if (!empty($newlang)) {
        $outputlangs = new Translate("", $conf);
        $outputlangs->setDefaultLang($newlang);
    }
    $result = don_create($db, $donation->id, '', $donation->modelpdf, $outputlangs);