From a5dcf433f6d3e7452c2b3894bbb9c12def8c7c62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Feb 2010 00:17:03 +0000 Subject: [PATCH] A lot of fix in project module --- htdocs/lib/project.lib.php | 27 +++++++++++++-------------- htdocs/projet/tasks/fiche.php | 4 ++-- htdocs/projet/tasks/task.class.php | 4 +++- 3 files changed, 18 insertions(+), 17 deletions(-) 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);