Removed a TODO
This commit is contained in:
parent
bcadc33e31
commit
8c03e46a83
@ -344,13 +344,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
{
|
||||
// Project ref
|
||||
print "<td>";
|
||||
if ($showlineingray) print '<i>';
|
||||
//if ($showlineingray) print '<i>';
|
||||
$projectstatic->id=$lines[$i]->fk_project;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
$projectstatic->public=$lines[$i]->public;
|
||||
if ($lines[$i]->public || in_array($lines[$i]->fk_project,$projectsArrayId) || ! empty($user->rights->projet->all->lire)) print $projectstatic->getNomUrl(1);
|
||||
else print $projectstatic->getNomUrl(1,'nolink');
|
||||
if ($showlineingray) print '</i>';
|
||||
//if ($showlineingray) print '</i>';
|
||||
print "</td>";
|
||||
|
||||
// Project status
|
||||
|
||||
@ -575,25 +575,60 @@ class Task extends CommonObject
|
||||
if ($mode == 0)
|
||||
{
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if ($filteronprojuser > 0)
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_type_contact as ctc";
|
||||
}
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
if ($filterontaskuser > 0)
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact as ec2";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2";
|
||||
}
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " AND t.fk_projet = p.rowid";
|
||||
}
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
if ($filteronprojuser > 0)
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_type_contact as ctc";
|
||||
}
|
||||
if ($filterontaskuser > 0)
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact as ec2";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
}
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
}
|
||||
else return 'BadValueForParameterMode';
|
||||
|
||||
if ($filteronprojuser > 0)
|
||||
{
|
||||
// TODO
|
||||
$sql.= " AND p.rowid = ec.element_id";
|
||||
$sql.= " AND ctc.rowid = ec.fk_c_type_contact";
|
||||
$sql.= " AND ctc.element = 'project'";
|
||||
$sql.= " AND ec.fk_socpeople = ".$filteronprojuser;
|
||||
$sql.= " AND ec.statut = 4";
|
||||
$sql.= " AND ctc.source = 'internal'";
|
||||
}
|
||||
if ($filterontaskuser > 0)
|
||||
{
|
||||
// TODO
|
||||
$sql.= " AND t.fk_projet = p.rowid";
|
||||
$sql.= " AND p.rowid = ec2.element_id";
|
||||
$sql.= " AND ctc2.rowid = ec2.fk_c_type_contact";
|
||||
$sql.= " AND ctc2.element = 'project_task'";
|
||||
$sql.= " AND ec2.fk_socpeople = ".$filterontaskuser;
|
||||
$sql.= " AND ec2.statut = 4";
|
||||
$sql.= " AND ctc2.source = 'internal'";
|
||||
}
|
||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||
if ($projectid) $sql.= " AND p.rowid in (".$projectid.")";
|
||||
|
||||
@ -318,7 +318,6 @@ if ($resql)
|
||||
}
|
||||
|
||||
// If the user can view prospects other than his'
|
||||
if ($mine) $search_user=$user->id;
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('ProjectsWithThisUserAsContact'). ': ';
|
||||
$includeonly='';
|
||||
|
||||
@ -128,7 +128,7 @@ if ($search_all) $morewherefilter.=natural_search(array_keys($fieldstosea
|
||||
if ($search_task_ref) $morewherefilter.=natural_search('t.ref', $search_task_ref);
|
||||
if ($search_task_label) $morewherefilter.=natural_search('t.label', $search_task_label);
|
||||
|
||||
$tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid, 0, $search_project, $search_status, $morewherefilter, $search_project_user, $search_task_user);
|
||||
$tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid, 0, $search_project, $search_status, $morewherefilter, $search_project_user, 0); // We don't use filter on task user. Because sometimes a task is assigned but not the parent one and we want to show also parent, so filtering is done during output
|
||||
$tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, ($tuser->id?$tuser:null), $projectstatic->id, 0, $search_status); // We load also tasks limited to a particular user
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -156,7 +156,6 @@ $moreforfilter.=$form->select_dolusers($search_project_user, 'search_project_use
|
||||
$moreforfilter.='</div>';
|
||||
|
||||
// If the user can view users
|
||||
if ($mine) $search_task_user=$user->id;
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('TasksWithThisUserAsContact'). ': ';
|
||||
$includeonly='';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user