This commit is contained in:
Regis Houssin 2006-06-16 11:34:38 +00:00
parent d74450310d
commit 41f996f80d
2 changed files with 6 additions and 3 deletions

View File

@ -435,10 +435,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
*/
if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer)
{
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
$propal = new Propal($db);
$propal->fetch($_GET['propalid']);
if ($_POST['model']) $propal->set_pdf_model($user, $_POST['model']);
propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf);
propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf, $outputlangs);
}

View File

@ -666,8 +666,9 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
$facture = new Facture($db, 0, $_GET['facid']);
$facture->set_pdf_model($user, $_POST['model']);
$result=facture_pdf_create($db, $_REQUEST['facid'], '', $_REQUEST['model'], $outputlangs);
$facture->fetch($_GET['facid']);
if ($_REQUEST['model']) $facture->set_pdf_model($user, $_REQUEST['model']);
$result=facture_pdf_create($db, $_REQUEST['facid'], '', $facture->modelpdf, $outputlangs);
if ($result <= 0)
{
dolibarr_print_error($db,$result);