diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index ab044618556..dd79af04bcb 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -91,6 +91,7 @@ ListDonationsAssociatedProject=List of donations associated with the project
ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project
ListActionsAssociatedProject=List of events associated with the project
ListTaskTimeUserProject=List of time consumed on tasks of project
+ListTaskTimeForTask=List of time consumed on task
ActivityOnProjectToday=Activity on project today
ActivityOnProjectYesterday=Activity on project yesterday
ActivityOnProjectThisWeek=Activity on project this week
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 44bed2119d2..57294fda1de 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -410,17 +410,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
dol_fiche_end();
-
print '
';
// Link to create time
- if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes))
- {
+ //if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes))
+ //{
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{
- if ($object->public || $userWrite > 0)
+ if ($projectstatic->public || $userWrite > 0)
{
- $linktocreatetime = ''.$langs->trans('AddTimeSpent').'';
+ $linktocreatetime = ''.$langs->trans('AddTimeSpent').'';
}
else
{
@@ -431,7 +430,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
{
$linktocreatetime = ''.$langs->trans('AddTime').'';
}
- }
+ //}
}
}
@@ -531,14 +530,17 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
dol_fiche_end();
+ $title=$langs->trans("ListTaskTimeForTask");
+ //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
+ print load_fiche_titre($title, $linktocreatetime, 'title_generic.png');
+
+
/*
* Form to add time spent on task
*/
- if ($user->rights->projet->lire)
+ if ($action == 'createtime' && $object->id > 0 && $user->rights->projet->lire)
{
- print '
';
-
print ''."\n";
print '