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

View File

@ -244,9 +244,9 @@ else
*/
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>';
}

View File

@ -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);