diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index 9c7573a011f..b4e8c05e4ee 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -21,7 +21,7 @@ */ require("./pre.inc.php3"); -require("./propal.class.php3"); +require("./propal_model_pdf.class.php3"); $db = new Db(); @@ -75,14 +75,16 @@ if ($action == 'create') print 'Société'.$objsoc->nom.''; - print ''; - print "Commentaires :
"; - print ''; + print ''; + print "Commentaires"; print "Date"; print_date_select(); - print ""; + print ""; + print ''; + print ''; + print 'Auteur'.$user->fullname.''; print "Num\n"; /* @@ -154,9 +156,13 @@ if ($action == 'create') print 'Cette societe n\'a pas de projet.
'; print 'Créer un projet'; } - print ''; - - print ""; + print ''; + print 'Modèle'; + print ''; + $html = new Form($db); + $modelpdf = new Propal_Model_pdf($db); + $html->select_array("modelpdf",$modelpdf->liste_array(),PROPALE_ADDON_PDF); + print ""; /* * @@ -187,19 +193,13 @@ if ($action == 'create') print_titre("Services/Produits"); - print ""; + print '
'; - print ""; - print "\n"; - - print ""; - print "\n"; - - print ""; - print "\n"; - - print ""; - print "\n"; + for ($i = 1 ; $i < 5 ; $i++) + { + print ''; + print ''; + } print "\n"; diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index 4888afebdeb..615d5d38ad2 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -54,14 +54,17 @@ if ($action == 'add') { $propal = new Propal($db, $socidp); - $propal->remise = $remise; - $propal->datep = $db->idate(mktime(12, 1 , 1, $remonth, $reday, $reyear)); - - $propal->contactid = $contactidp; - $propal->projetidp = $projetidp; + $propal->remise = $HTTP_POST_VARS["remise"]; + $propal->datep = $db->idate(mktime(12, 1 , 1, + $HTTP_POST_VARS["remonth"], + $HTTP_POST_VARS["reday"], + $HTTP_POST_VARS["reyear"])); + $propal->contactid = $HTTP_POST_VARS["contactidp"]; + $propal->projetidp = $HTTP_POST_VARS["projetidp"]; + $propal->modelpdf = $HTTP_POST_VARS["modelpdf"]; $propal->author = $user->id; - $propal->note = $note; + $propal->note = $HTTP_POST_VARS["note"]; $propal->ref = $ref; @@ -88,7 +91,9 @@ if ($action == 'add') if ($action == 'pdf') { - propale_pdf_create($db, $propalid); + $propal = new Propal($db); + $propal->fetch($propalid); + propale_pdf_create($db, $propalid, $propal->modelpdf); } if ($action == 'setstatut') diff --git a/htdocs/propal.class.php3 b/htdocs/propal.class.php3 index 80ce7e7552e..0e853a525ca 100644 --- a/htdocs/propal.class.php3 +++ b/htdocs/propal.class.php3 @@ -132,8 +132,8 @@ class Propal /* * Insertion dans la base */ - $sql = "INSERT INTO llx_propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note) "; - $sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0, $this->datep, now(), '$this->ref', $this->author, '$this->note')"; + $sql = "INSERT INTO llx_propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note, model_pdf) "; + $sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0, $this->datep, now(), '$this->ref', $this->author, '$this->note','$this->modelpdf')"; $sqlok = 0; if ( $this->db->query($sql) ) @@ -256,7 +256,7 @@ class Propal Function fetch($rowid) { - $sql = "SELECT ref,total,price,remise,tva,fk_soc,".$this->db->pdate(datep)."as dp "; + $sql = "SELECT ref,total,price,remise,tva,fk_soc,".$this->db->pdate(datep)."as dp, model_pdf "; $sql .= " FROM llx_propal WHERE rowid=$rowid;"; if ($this->db->query($sql) ) @@ -275,7 +275,8 @@ class Propal $this->total_ht = $obj->price; $this->total_tva = $obj->tva; $this->total_ttc = $obj->total; - $this->socidp = $obj->fk_soc; + $this->socidp = $obj->fk_soc; + $this->modelpdf = $obj->model_pdf; $this->lignes = array(); $this->db->free();
Remise :