diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php
index 7296badfbd4..45e174ffbfd 100644
--- a/htdocs/lib/project.lib.php
+++ b/htdocs/lib/project.lib.php
@@ -250,20 +250,19 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$tasksrole)
$minutes = substr("00"."$minutes", -2);
print '
'.$heure." h ".$minutes." \n";
- if ($tasksrole[$lines[$i]->id] == 'TASKEXECUTIVE')
- {
- print '';
- print $form->select_date('',$lines[$i]->id,'','','',"addtime");
- print ' ';
- print ' ';
- print ' ';
- print " ";
- print ' ';
- }
- else
- {
- print ' ';
- }
+ $disabled=1;
+ // If at least one role for project
+ if (! empty($tasksrole[$lines[$i]->id])
+ && sizeof($tasksrole[$lines[$i]->id]) > 0) $disabled=0;
+
+ print '';
+ print $form->select_date('',$lines[$i]->id,'','','',"addtime");
+ print ' ';
+ print ' ';
+ print ' ';
+ print " ";
+ print ' ';
+
print "\n";
$inc++;
$level++;
diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php
index e57448d661a..be69a8acf9d 100644
--- a/htdocs/projet/tasks/fiche.php
+++ b/htdocs/projet/tasks/fiche.php
@@ -244,9 +244,9 @@ else
*/
print '';
- if ($user->rights->projet->creer)
+ if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{
- if ($userAccess)
+ if ($project->public || $userAccess)
{
print '
'.$langs->trans('AddTask').' ';
}
diff --git a/htdocs/projet/tasks/task.class.php b/htdocs/projet/tasks/task.class.php
index e77a59cf2a6..922cf502ba6 100644
--- a/htdocs/projet/tasks/task.class.php
+++ b/htdocs/projet/tasks/task.class.php
@@ -495,6 +495,7 @@ class Task extends CommonObject
$tasks[$i]->description = $obj->description;
$tasks[$i]->fk_parent = $obj->fk_task_parent;
$tasks[$i]->duration = $obj->duration_effective;
+ $tasks[$i]->public = $obj->public;
}
$i++;
@@ -561,7 +562,8 @@ class Task extends CommonObject
while ($i < $num)
{
$row = $this->db->fetch_row($resql);
- $tasksrole[$row[0]] = $row[1];
+ if (empty($tasksrole[$row[0]])) $tasksrole[$row[0]] = $row[1];
+ else $tasksrole[$row[0]].=','.$row[1];
$i++;
}
$this->db->free($resql);