From ceb10ce850790fe802cc81d96a30b349b370a637 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Jul 2006 14:31:41 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Il=20fallait=20g=E9n=E9rer=202=20fois=20?= =?UTF-8?q?le=20document=20quand=20on=20changeait=20de=20mod=E8le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/commande.class.php | 46 ++++++++++---------- htdocs/facture.class.php | 48 ++++++++++----------- htdocs/fourn/fournisseur.commande.class.php | 47 ++++++++++---------- 3 files changed, 72 insertions(+), 69 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 44f51f8035f..78fff6d1856 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -933,30 +933,32 @@ class Commande extends CommonObject } } - /* - * - * - * - */ + + /** + * \brief Positionne modele derniere generation + * \param user Objet use qui modifie + * \param modelpdf Nom du modele + */ function set_pdf_model($user, $modelpdf) { - if ($user->rights->commande->creer) - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."commande SET model_pdf = '$modelpdf'"; - $sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;"; - - if ($this->db->query($sql) ) - { - return 1; - } - else - { - dolibarr_print_error($this->db); - return 0; - } - } - } + if ($user->rights->commande->creer) + { + + $sql = "UPDATE ".MAIN_DB_PREFIX."commande SET model_pdf = '$modelpdf'"; + $sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;"; + + if ($this->db->query($sql) ) + { + $this->modelpdf=$modelpdf; + return 1; + } + else + { + dolibarr_print_error($this->db); + return 0; + } + } + } /** * \brief Reinitialise le tableau lignes diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index a9dc6105dcf..81462cd112b 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -1030,31 +1030,31 @@ class Facture extends CommonObject } } - /* - * - * - * - */ - function set_pdf_model($user, $modelpdf) - { - if ($user->rights->facture->creer) - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET model_pdf = '$modelpdf'"; - $sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;"; - - if ($this->db->query($sql) ) - { - return 1; - } - else - { - dolibarr_print_error($this->db); - return 0; - } - } - } + /** + * \brief Positionne modele derniere generation + * \param user Objet use qui modifie + * \param modelpdf Nom du modele + */ + function set_pdf_model($user, $modelpdf) + { + if ($user->rights->facture->creer) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET model_pdf = '$modelpdf'"; + $sql .= " WHERE rowid = $this->id AND fk_statut < 2 ;"; + + if ($this->db->query($sql) ) + { + $this->modelpdf=$modelpdf; + return 1; + } + else + { + dolibarr_print_error($this->db); + return 0; + } + } + } /** * \brief Ajoute un produit dans les tableaux products, products_qty, products_date_start|end diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php index d776966212d..3d648824ef2 100644 --- a/htdocs/fourn/fournisseur.commande.class.php +++ b/htdocs/fourn/fournisseur.commande.class.php @@ -780,29 +780,30 @@ class CommandeFournisseur extends Commande } /** - * - * - * - */ - function set_pdf_model($user, $modelpdf) - { - if ($user->rights->fournisseur->commande->creer) - { - - $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET model_pdf = '$modelpdf'"; - $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; - - if ($this->db->query($sql) ) - { - return 1; - } - else - { - dolibarr_print_error($this->db); - return 0; - } - } - } + * \brief Positionne modele derniere generation + * \param user Objet use qui modifie + * \param modelpdf Nom du modele + */ + function set_pdf_model($user, $modelpdf) + { + if ($user->rights->fournisseur->commande->creer) + { + + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET model_pdf = '$modelpdf'"; + $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; + + if ($this->db->query($sql) ) + { + $this->modelpdf=$modelpdf; + return 1; + } + else + { + dolibarr_print_error($this->db); + return 0; + } + } + } /**