From 100f59c1acfdf301bcba8ed7e1b00512fd5c7a35 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 6 Sep 2003 15:11:51 +0000 Subject: [PATCH] Ajout Function set_pdf_model($user, $modelpdf) --- htdocs/propal.class.php3 | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/propal.class.php3 b/htdocs/propal.class.php3 index 9c3799800bf..4808f5c2a2d 100644 --- a/htdocs/propal.class.php3 +++ b/htdocs/propal.class.php3 @@ -37,10 +37,11 @@ class Propal var $price; - Function Propal($DB, $soc_idp="") + Function Propal($DB, $soc_idp="", $propalid=0) { $this->db = $DB ; $this->socidp = $soc_idp; + $this->id = $propalid; $this->products = array(); $this->remise = 0; } @@ -456,6 +457,30 @@ class Propal } } } + /* + * + * + * + */ + Function set_pdf_model($user, $modelpdf) + { + if ($user->rights->propale->creer) + { + + $sql = "UPDATE llx_propal SET model_pdf = '$modelpdf'"; + $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; + + if ($this->db->query($sql) ) + { + return 1; + } + else + { + print $this->db->error() . ' in ' . $sql; + return 0; + } + } + } /* * *