Fix: Wrong order
This commit is contained in:
parent
17048fbc32
commit
766cb6cf64
@ -249,19 +249,13 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject=1, &$taskro
|
|||||||
|
|
||||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||||
{
|
{
|
||||||
// Process line $lines[$i]
|
|
||||||
|
|
||||||
if ($parent == 0) $level = 0;
|
if ($parent == 0) $level = 0;
|
||||||
|
|
||||||
|
// Process line
|
||||||
|
// print "i:".$i."-".$lines[$i]->projectid.'<br>';
|
||||||
|
|
||||||
if ($lines[$i]->fk_parent == $parent)
|
if ($lines[$i]->fk_parent == $parent)
|
||||||
{
|
{
|
||||||
// Break on a new project
|
|
||||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
|
||||||
{
|
|
||||||
$var = !$var;
|
|
||||||
$lastprojectid=$lines[$i]->projectid;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show task line.
|
// Show task line.
|
||||||
$showline=1;
|
$showline=1;
|
||||||
$showlineingray=0;
|
$showlineingray=0;
|
||||||
@ -289,6 +283,13 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject=1, &$taskro
|
|||||||
|
|
||||||
if ($showline)
|
if ($showline)
|
||||||
{
|
{
|
||||||
|
// Break on a new project
|
||||||
|
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||||
|
{
|
||||||
|
$var = !$var;
|
||||||
|
$lastprojectid=$lines[$i]->projectid;
|
||||||
|
}
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">\n";
|
print "<tr ".$bc[$var].">\n";
|
||||||
|
|
||||||
// Ref of task
|
// Ref of task
|
||||||
|
|||||||
@ -518,8 +518,8 @@ class Project extends CommonObject
|
|||||||
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
if ($this->id) $sql .= " AND t.fk_projet =".$this->id;
|
||||||
if (is_object($usert)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
if (is_object($usert)) $sql .= " AND t.fk_projet = p.rowid AND ta.fk_projet_task = t.rowid AND ta.fk_user = ".$usert->id;
|
||||||
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
if (is_object($userp)) $sql .= " AND (p.fk_user_resp = ".$userp->id." OR p.fk_user_resp IS NULL OR p.fk_user_resp = -1)";
|
||||||
$sql.= " ORDER BY p.ref, t.title";
|
|
||||||
}
|
}
|
||||||
|
$sql.= " ORDER BY p.ref, t.title";
|
||||||
|
|
||||||
dol_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
dol_syslog("Project::getTasksArray sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
@ -96,8 +96,8 @@ print '<td>'.$langs->trans("LabelTask").'</td>';
|
|||||||
print '<td>'.$langs->trans("Project").'</td>';
|
print '<td>'.$langs->trans("Project").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
// Show all lines in taskarray (recusrive function to go down on tree)
|
// Show all lines in taskarray (recursive function to go down on tree)
|
||||||
$j=0;
|
$j=0; $level=0;
|
||||||
$nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 1, $tasksrole);
|
$nboftaskshown=PLines($j, 0, $tasksarray, $level, true, 1, $tasksrole);
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user