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; + } + } + } /**