diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php
index 16023eae844..dbf221ddb24 100644
--- a/htdocs/commonobject.class.php
+++ b/htdocs/commonobject.class.php
@@ -721,8 +721,15 @@ class CommonObject
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
- if ($this->table_element == 'fichinter') $sql.= " SET note_private = '".addslashes($note)."'";
- else $sql.= " SET note = '".addslashes($note)."'";
+ // TODO uniformize fields note_private
+ if ($this->table_element == 'fichinter' || $this->table_element == 'projet' || $this->table_element == 'projet_task')
+ {
+ $sql.= " SET note_private = '".addslashes($note)."'";
+ }
+ else
+ {
+ $sql.= " SET note = '".addslashes($note)."'";
+ }
$sql.= " WHERE rowid =". $this->id;
dol_syslog("CommonObject::update_note sql=".$sql, LOG_DEBUG);
diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php
index 36712e7ed0a..1b166d44988 100644
--- a/htdocs/lib/project.lib.php
+++ b/htdocs/lib/project.lib.php
@@ -57,6 +57,11 @@ function project_prepare_head($object)
$head[$h][2] = 'element';
$h++;
}
+
+ $head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id;
+ $head[$h][1] = $langs->trans('Notes');
+ $head[$h][2] = 'note';
+ $h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
@@ -105,6 +110,11 @@ function task_prepare_head($object)
$head[$h][1] = $langs->trans("Affectations");
$head[$h][2] = 'contact';
$h++;
+
+ $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id;
+ $head[$h][1] = $langs->trans('Notes');
+ $head[$h][2] = 'note';
+ $h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
new file mode 100644
index 00000000000..1d609f0b36d
--- /dev/null
+++ b/htdocs/projet/note.php
@@ -0,0 +1,236 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * \file htdocs/projet/note.php
+ * \ingroup project
+ * \brief Fiche d'information sur un projet
+ * \version $Id$
+ */
+
+require('./pre.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
+
+$langs->load('projects');
+
+$id = isset($_GET["id"])?$_GET["id"]:'';
+
+// Security check
+if ($user->societe_id) $socid=$user->societe_id;
+$result = restrictedArea($user, 'projet', $id);
+
+
+
+/******************************************************************************/
+/* Actions */
+/******************************************************************************/
+
+if ($_POST["action"] == 'update_public' && $user->rights->projet->creer)
+{
+ $project = new Project($db);
+ $project->fetch($_GET['id']);
+
+ $db->begin();
+
+ $res=$project->update_note_public($_POST["note_public"],$user);
+ if ($res < 0)
+ {
+ $mesg='
";
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
new file mode 100644
index 00000000000..0dc99d3f996
--- /dev/null
+++ b/htdocs/projet/tasks/note.php
@@ -0,0 +1,244 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * \file htdocs/projet/tasks/note.php
+ * \ingroup project
+ * \brief Fiche d'information sur une tache
+ * \version $Id$
+ */
+
+require('./pre.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/projet/tasks/task.class.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
+
+$langs->load('projects');
+
+$id = isset($_GET["id"])?$_GET["id"]:'';
+
+// Security check
+if ($user->societe_id) $socid=$user->societe_id;
+if (!$user->rights->projet->task->lire) accessforbidden();
+//$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification
+
+
+
+/******************************************************************************/
+/* Actions */
+/******************************************************************************/
+
+if ($_POST["action"] == 'update_public' && $user->rights->projet->task->creer)
+{
+ $task = new Task($db);
+ $task->fetch($_GET['id']);
+
+ $db->begin();
+
+ $res=$task->update_note_public($_POST["note_public"],$user);
+ if ($res < 0)
+ {
+ $mesg='
';
+ }
+}
+$db->close();
+
+llxFooter('$Date$ - $Revision: 1.15 ');
+?>
diff --git a/htdocs/projet/tasks/task.class.php b/htdocs/projet/tasks/task.class.php
index e4a99d43fe4..4fa20f8d17d 100644
--- a/htdocs/projet/tasks/task.class.php
+++ b/htdocs/projet/tasks/task.class.php
@@ -36,8 +36,8 @@ class Task extends CommonObject
var $db; //!< To store db handler
var $error; //!< To return error code (or message)
var $errors=array(); //!< To return several error codes (or messages)
- var $element='project_task'; //!< Id that identify managed objects
- var $table_element='project_task'; //!< Name of table without prefix where object is stored
+ var $element='project_task'; //!< Id that identify managed objects
+ var $table_element='projet_task'; //!< Name of table without prefix where object is stored
var $id;
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index cc2e741ece0..2213707c091 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -114,6 +114,7 @@ if ($taskid)
{
$task = new Task($db);
$projectstatic = new Project($db);
+ $userstatic = new User($db);
if ($task->fetch($taskid) >= 0 )
{
@@ -143,15 +144,18 @@ if ($taskid)
print '
';
- /* List of time spent */
-
+ /*
+ * List of time spent
+ */
$sql = "SELECT t.task_date, t.task_duration, t.fk_user, u.login, u.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " , ".MAIN_DB_PREFIX."user as u";