diff --git a/htdocs/don.class.php b/htdocs/don.class.php
index 84bf172d671..5e698007a7d 100644
--- a/htdocs/don.class.php
+++ b/htdocs/don.class.php
@@ -70,7 +70,10 @@ class Don
print "
" . $this->errorstr[$i];
}
}
-
+ /*
+ *
+ *
+ */
Function check($minimum=0)
{
$err = 0;
diff --git a/htdocs/fichinter/fichinter.class.php3 b/htdocs/fichinter/fichinter.class.php3
index b6d35fede6a..09fd58454b4 100644
--- a/htdocs/fichinter/fichinter.class.php3
+++ b/htdocs/fichinter/fichinter.class.php3
@@ -1,8 +1,5 @@
- *
- * $Id$
- * $Source$
*
* 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$
+ *
*/
class Fichinter {
@@ -29,87 +29,102 @@ class Fichinter {
var $date;
var $duree;
var $note;
+ var $projet_id;
-
- Function Fichinter($DB, $soc_idp="") {
- $this->db = $DB ;
- $this->socidp = $soc_idp;
- $this->products = array();
- }
-
- Function add_product($idproduct) {
- if ($idproduct > 0) {
- $i = sizeof($this->products);
- $this->products[$i] = $idproduct;
+ Function Fichinter($DB, $soc_idp="")
+ {
+ $this->db = $DB ;
+ $this->socidp = $soc_idp;
+ $this->products = array();
+ }
+
+ Function add_product($idproduct)
+ {
+ if ($idproduct > 0)
+ {
+ $i = sizeof($this->products);
+ $this->products[$i] = $idproduct;
+ }
}
- }
/*
*
*
*
*/
- Function create() {
- /*
- * Insertion dans la base
- */
+ Function create()
+ {
+ /*
+ * Insertion dans la base
+ */
if (!strlen($this->duree)) { $this->duree = 0; }
- $sql = "INSERT INTO llx_fichinter (fk_soc, datei, datec, ref, fk_user_author, note, duree) ";
- $sql .= " VALUES ($this->socidp, $this->date, now(), '$this->ref', $this->author, '$this->note', $this->duree)";
+ $sql = "INSERT INTO llx_fichinter (fk_soc, datei, datec, ref, fk_user_author, note, duree, fk_projet) ";
+ $sql .= " VALUES ($this->socidp, $this->date, now(), '$this->ref', $this->author, '$this->note', $this->duree, $this->projet_id)";
$sqlok = 0;
- if (! $this->db->query($sql) ) {
- print $this->db->error() . '
'.$sql;
- }
- return $this->db->last_insert_id();
- }
- /*
- *
- *
- *
- */
- Function update($id) {
- /*
- * Insertion dans la base
- */
- $sql = "UPDATE llx_fichinter SET ";
- $sql .= " datei = $this->date,";
- $sql .= " note = '$this->note',";
- $sql .= " duree = $this->duree";
- $sql .= " WHERE rowid = $id";
-
- if (! $this->db->query($sql) ) {
-
- print $this->db->error() . '
'.$sql;
- }
- return 1;
- }
- /*
- *
- *
- *
- */
- Function fetch($rowid) {
-
- $sql = "SELECT ref,note,fk_statut,duree,".$this->db->pdate(datei)."as di FROM llx_fichinter WHERE rowid=$rowid;";
-
- if ($this->db->query($sql) ) {
- if ($this->db->num_rows()) {
- $obj = $this->db->fetch_object(0);
-
- $this->id = $rowid;
- $this->date = $obj->di;
- $this->duree = $obj->duree;
- $this->ref = $obj->ref;
- $this->note = $obj->note;
- $this->statut = $obj->fk_statut;
-
- $this->db->free();
+ if (! $this->db->query($sql) )
+ {
+ print $this->db->error() . '
'.$sql;
}
- } else {
- print $this->db->error();
- }
- }
+ return $this->db->last_insert_id();
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function update($id)
+ {
+ /*
+ * Insertion dans la base
+ */
+ $sql = "UPDATE llx_fichinter SET ";
+ $sql .= " datei = $this->date,";
+ $sql .= " note = '$this->note',";
+ $sql .= " duree = $this->duree";
+ $sql .= ", fk_projet = $this->projet_id";
+ $sql .= " WHERE rowid = $id";
+
+ if (! $this->db->query($sql) )
+ {
+
+ print $this->db->error() . '
'.$sql;
+ }
+ return 1;
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function fetch($rowid)
+ {
+
+ $sql = "SELECT ref,note,fk_soc,fk_statut,duree,".$this->db->pdate(datei)."as di, fk_projet FROM llx_fichinter WHERE rowid=$rowid;";
+
+ if ($this->db->query($sql) )
+ {
+ if ($this->db->num_rows())
+ {
+ $obj = $this->db->fetch_object(0);
+
+ $this->id = $rowid;
+ $this->date = $obj->di;
+ $this->duree = $obj->duree;
+ $this->ref = $obj->ref;
+ $this->note = $obj->note;
+ $this->societe_id = $obj->fk_soc;
+ $this->projet_id = $obj->fk_projet;
+ $this->statut = $obj->fk_statut;
+
+ $this->db->free();
+ }
+ }
+ else
+ {
+ print $this->db->error();
+ }
+ }
/*
*
*
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index e3d67e837ea..ccc8be0d97b 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -30,7 +30,7 @@ class Form {
$this->db = $DB;
return 1;
- }
+ }
/*
*
*
@@ -82,6 +82,42 @@ class Form {
}
/*
+ *
+ *
+ */
+ Function select_array($name, $array, $id='')
+ {
+ print '";
+
+ }
+ /*
* Renvoie la chaîne de caractère décrivant l'erreur
*
*
diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3
index c7de7218201..c2982c1f1e2 100644
--- a/htdocs/lib/functions.inc.php3
+++ b/htdocs/lib/functions.inc.php3
@@ -284,8 +284,13 @@ function print_oui_non($value)
*
*
*/
-function print_date_select()
+function print_date_select($set_time='')
{
+ if (! isset($set_time))
+ {
+ $set_time = time();
+ }
+
$strmonth[1] = "Janvier";
$strmonth[2] = "Février";
$strmonth[3] = "Mars";
@@ -300,8 +305,8 @@ function print_date_select()
$strmonth[12] = "Décembre";
$smonth = 1;
- $syear = date("Y", time());
- $cday = date("d", time());
+ $syear = date("Y", $set_time);
+ $cday = date("d", $set_time);
print "";
- $cmonth = date("n", time());
+
+ $cmonth = date("n", $set_time);
print "