From da1a5490e2961d31b233e3047f296db0dd3e6984 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Jun 2006 16:29:49 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20la=20s=E9lection=20du=20mod=E8le=20pdf?= =?UTF-8?q?=20n'=E9tait=20pas=20enregistr=E9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/commande.class.php | 2 +- htdocs/commande/fiche.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 0895805e1ff..cca2a0c6c09 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -962,7 +962,7 @@ class Commande { $sql = "UPDATE ".MAIN_DB_PREFIX."commande SET model_pdf = '$modelpdf'"; - $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; + $sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;"; if ($this->db->query($sql) ) { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index cf8f17aed1f..b04af32e253 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -321,6 +321,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post */ $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); $outputlangs->setDefaultLang($_REQUEST['lang_id']); + $commande = new Commande($db, 0, $_GET['id']); + $commande->set_pdf_model($user, $_POST['model']); $result=commande_pdf_create($db, $_REQUEST['id'],$_REQUEST['model'],$outputlangs); if ($result <= 0) {