From 878ba07fcd0575956066b13a3998ef1f9381853c Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Wed, 4 May 2016 12:24:15 +0200
Subject: [PATCH] NEW The note on time spent can be entered when using the view
 per day.

---
 htdocs/core/lib/project.lib.php   | 5 +++++
 htdocs/projet/activity/perday.php | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 479e46258be..7cb0e35e463 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -666,6 +666,11 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
 				else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));
 				print '</td>';
 
+				print '<td align="right">';
+				print '<textarea name="'.$lines[$i]->id.'note" rows="2" id="note">';
+				print '</textarea>';
+				print '</td>';
+				
 				print "</tr>\n";
 			}
 
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 7e23fe123d0..ada7e0bb7d4 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2005      Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2015 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2016 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005-2010 Regis Houssin        <regis.houssin@capnetworks.com>
  * Copyright (C) 2010      François Legastelois <flegastelois@teclib.com>
  *
@@ -192,9 +192,10 @@ if ($action == 'addtime' && $user->rights->projet->creer)
     	foreach($timespent_duration as $key => $val)
     	{
 	        $object->fetch($key);
-		    $object->progress = GETPOST($key . 'progress', 'int');
+		    $object->progress = GETPOST($key.'progress', 'int');
 	        $object->timespent_duration = $val;
 	        $object->timespent_fk_user = $user->id;
+	        $object->timespent_note = GETPOST($key.'note');
 	        if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0)	// If hour was entered
 	        {
 	        	$object->timespent_date = dol_mktime(GETPOST($key."hour"),GETPOST($key."min"),0,$monthofday,$dayofday,$yearofday);
@@ -385,6 +386,7 @@ if ($usertoprocess->id == $user->id) print '<td align="right">'.$langs->trans("T
 else print '<td align="right">'.$langs->trans("TimeSpentByUser").'</td>';
 print '<td align="center">'.$langs->trans("HourStart").'</td>';
 print '<td align="center" colspan="2">'.$langs->trans("Duration").'</td>';
+print '<td>'.$langs->trans("Note").'</td>';
 print "</tr>\n";
 
 // By default, we can edit only tasks we are assigned to
-- 
GitLab