diff --git a/htdocs/comm/projet/project.class.php3 b/htdocs/comm/projet/project.class.php3 index fb0f38e9528..e0ccc9d3d1f 100644 --- a/htdocs/comm/projet/project.class.php3 +++ b/htdocs/comm/projet/project.class.php3 @@ -1,8 +1,5 @@ - * - * $Id$ - * $Source$ +/* Copyright (C) 2002-2003 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +15,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ @@ -29,10 +29,11 @@ class Project { var $socidp; var $societe; - Function Project($DB) { - $this->db = $DB; - $this->societe = new Societe($DB); - } + Function Project($DB) + { + $this->db = $DB; + $this->societe = new Societe($DB); + } /* * * @@ -42,8 +43,8 @@ class Project { Function create($creatorid) { - $sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat) "; - $sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid) ;"; + $sql = "INSERT INTO llx_projet (ref, title, fk_soc, fk_user_creat, dateo) "; + $sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid, now()) ;"; if (!$this->db->query($sql) ) { @@ -58,55 +59,64 @@ class Project { * */ - Function fetch($rowid) { - - $sql = "SELECT fk_soc, title, ref FROM llx_projet WHERE rowid=$rowid;"; - - if ($this->db->query($sql) ) { - if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); - - $this->id = $rowid; - $this->ref = $obj->ref; - $this->title = $obj->title; - $this->societe->id = $obj->fk_soc; - $this->db->free(); - } - } else { - print $this->db->error(); + Function fetch($rowid) + { + + $sql = "SELECT fk_soc, title, ref FROM llx_projet WHERE rowid=$rowid;"; + + if ($this->db->query($sql) ) + { + if ($this->db->num_rows()) + { + $obj = $this->db->fetch_object(0); + + $this->id = $rowid; + $this->ref = $obj->ref; + $this->title = $obj->title; + $this->societe->id = $obj->fk_soc; + $this->db->free(); + } + } + else + { + print $this->db->error(); + } } - } /* * * * */ - Function get_propal_list() { - $propales = array(); - $sql = "SELECT rowid FROM llx_propal WHERE fk_projet=$this->id;"; - - if ($this->db->query($sql) ) { - $nump = $this->db->num_rows(); - if ($nump) { - $i = 0; - while ($i < $nump) { - $obj = $this->db->fetch_object($i); - - $propales[$i] = $obj->rowid; - - $i++; + Function get_propal_list() + { + $propales = array(); + $sql = "SELECT rowid FROM llx_propal WHERE fk_projet=$this->id;"; + + if ($this->db->query($sql) ) + { + $nump = $this->db->num_rows(); + if ($nump) + { + $i = 0; + while ($i < $nump) + { + $obj = $this->db->fetch_object($i); + + $propales[$i] = $obj->rowid; + + $i++; + } + $this->db->free(); + /* + * Retourne un tableau contenant la liste des propales associees + */ + return $propales; + } + } + else + { + print $this->db->error() . '
' .$sql; } - $this->db->free(); - /* - * Retourne un tableau contenant la liste des propales associees - */ - return $propales; - } - } else { - print $this->db->error() . '
' .$sql; } - - - } } ?>