diff --git a/htdocs/comm/projet/fiche.php3 b/htdocs/comm/projet/fiche.php3
index ddb54792aa9..5389e8ca239 100644
--- a/htdocs/comm/projet/fiche.php3
+++ b/htdocs/comm/projet/fiche.php3
@@ -19,14 +19,23 @@
* $Source$
*
*/
-
require("./pre.inc.php3");
require("./project.class.php3");
require("../propal.class.php3");
+$db = new Db();
+
+if ($HTTP_POST_VARS["action"] == 'update')
+{
+ $projet = new Project($db);
+ $projet->id = $id;
+ $projet->ref = $HTTP_POST_VARS["ref"];
+ $projet->title = $HTTP_POST_VARS["title"];
+ $projet->update();
+}
+
llxHeader("","../");
-$db = new Db();
if ($action == 'create')
{
@@ -68,21 +77,21 @@ if ($action == 'create')
$projet->fetch($id);
$projet->societe->fetch($projet->societe->id);
-
if ($action == 'edit')
{
+ print '
';
}
else
{
print '';
- print '| Société | '.$projet->societe->nom.' |
';
+ print '| Société | '.$projet->societe->nom.' |
';
print '| Ref | '.$projet->ref.' |
';
print '| Titre | '.$projet->title.' |
';
@@ -134,7 +143,14 @@ if ($action == 'create')
print "";
- print "| Editer | ";
+ if ($action == "edit")
+ {
+ print "Annuler | ";
+ }
+ else
+ {
+ print "Editer | ";
+ }
print "- | ";
diff --git a/htdocs/comm/projet/project.class.php3 b/htdocs/comm/projet/project.class.php3
index e0ccc9d3d1f..55aadc1e747 100644
--- a/htdocs/comm/projet/project.class.php3
+++ b/htdocs/comm/projet/project.class.php3
@@ -42,16 +42,29 @@ class Project {
Function create($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) )
{
- print ''.$sql.'
'.$this->db->error();
-
- }
-
+ print ''.$sql.'
'.$this->db->error();
+ }
+ }
+ /*
+ *
+ *
+ *
+ */
+ Function update()
+ {
+ $sql = "UPDATE llx_projet ";
+ $sql .= " SET ref = '$this->ref', title = '$this->title'";
+ $sql .= " WHERE rowid = $this->id";
+
+ if (!$this->db->query($sql) )
+ {
+ print ''.$sql.'
'.$this->db->error();
+ }
}
/*
*