A lot of fix in project module

This commit is contained in:
Laurent Destailleur 2010-02-21 00:17:03 +00:00
parent a3bb3f2cee
commit a5dcf433f6
3 changed files with 18 additions and 17 deletions

View File

@ -250,20 +250,19 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$tasksrole)
$minutes = substr("00"."$minutes", -2); $minutes = substr("00"."$minutes", -2);
print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n"; print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n";
if ($tasksrole[$lines[$i]->id] == 'TASKEXECUTIVE') $disabled=1;
{ // If at least one role for project
print '<td nowrap="nowrap">'; if (! empty($tasksrole[$lines[$i]->id])
print $form->select_date('',$lines[$i]->id,'','','',"addtime"); && sizeof($tasksrole[$lines[$i]->id]) > 0) $disabled=0;
print '&nbsp;<input size="4" type="text" class="flat" name="task'.$lines[$i]->id.'" value="">';
print '&nbsp;<input type="submit" class="button" value="'.$langs->trans("Add").'">'; print '<td nowrap="nowrap">';
print '</td>'; print $form->select_date('',$lines[$i]->id,'','','',"addtime");
print "<td>&nbsp;"; print '&nbsp;<input size="4" type="text" class="flat"'.($disabled?' disabled="true"':'').' name="task'.$lines[$i]->id.'" value="">';
print '</td>'; print '&nbsp;<input type="submit" class="button"'.($disabled?' disabled="true"':'').' value="'.$langs->trans("Add").'">';
} print '</td>';
else print "<td>&nbsp;";
{ print '</td>';
print '<td colspan="2">&nbsp;</td>';
}
print "</tr>\n"; print "</tr>\n";
$inc++; $inc++;
$level++; $level++;

View File

@ -244,9 +244,9 @@ else
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->rights->projet->creer) if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{ {
if ($userAccess) if ($project->public || $userAccess)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$project->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$project->id.'&action=create'.$param.'">'.$langs->trans('AddTask').'</a>';
} }

View File

@ -495,6 +495,7 @@ class Task extends CommonObject
$tasks[$i]->description = $obj->description; $tasks[$i]->description = $obj->description;
$tasks[$i]->fk_parent = $obj->fk_task_parent; $tasks[$i]->fk_parent = $obj->fk_task_parent;
$tasks[$i]->duration = $obj->duration_effective; $tasks[$i]->duration = $obj->duration_effective;
$tasks[$i]->public = $obj->public;
} }
$i++; $i++;
@ -561,7 +562,8 @@ class Task extends CommonObject
while ($i < $num) while ($i < $num)
{ {
$row = $this->db->fetch_row($resql); $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++; $i++;
} }
$this->db->free($resql); $this->db->free($resql);