Fix list of tasks on time consumed
This commit is contained in:
parent
39f4eae07e
commit
79b15b81f2
@ -850,7 +850,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec
|
||||
* @param string $projectsrole Array of roles user has on project
|
||||
* @param string $tasksrole Array of roles user has on task
|
||||
* @param string $mine Show only task lines I am assigned to
|
||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
|
||||
* @param int $preselectedday Preselected day
|
||||
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
|
||||
* @param int $oldprojectforbreak Old project id of last project break
|
||||
@ -894,6 +894,11 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
{
|
||||
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project);
|
||||
|
||||
if ($restricteditformytask == 2 && empty($tasksrole[$lines[$i]->id])) // we have no role on task and we request to hide such cases
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
|
||||
{
|
||||
@ -1135,7 +1140,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
* @param string $projectsrole Array of roles user has on project
|
||||
* @param string $tasksrole Array of roles user has on task
|
||||
* @param string $mine Show only task lines I am assigned to
|
||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others
|
||||
* @param array $isavailable Array with data that say if user is available for several days for morning and afternoon
|
||||
* @param int $oldprojectforbreak Old project id of last project break
|
||||
* @return array Array with time spent for $fuser for each day of week on tasks in $lines and substasks
|
||||
@ -1179,6 +1184,11 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
{
|
||||
//dol_syslog("projectLinesPerWeek Found line ".$i.", a qualified task (i have role or want to show all tasks) with id=".$lines[$i]->id." project id=".$lines[$i]->fk_project);
|
||||
|
||||
if ($restricteditformytask == 2 && empty($tasksrole[$lines[$i]->id])) // we have no role on task and we request to hide such cases
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
|
||||
{
|
||||
|
||||
@ -117,6 +117,9 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$search_project_ref = '';
|
||||
$search_thirdparty = '';
|
||||
$search_declared_progress = '';
|
||||
|
||||
// We redefine $usertoprocess
|
||||
$usertoprocess=$user;
|
||||
}
|
||||
if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha'))
|
||||
{
|
||||
@ -344,7 +347,7 @@ if ($morewherefilter) // Get all task without any filter, so we can show total o
|
||||
}
|
||||
$projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id?$project->id:0), 0, $onlyopenedproject);
|
||||
$tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id?$project->id:0), 0, $onlyopenedproject);
|
||||
//var_dump($tasksarray);
|
||||
//var_dump($usertoprocess);
|
||||
//var_dump($projectsrole);
|
||||
//var_dump($taskrole);
|
||||
|
||||
@ -501,7 +504,7 @@ print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpent").($user
|
||||
print '<td class="center leftborder">'.$langs->trans("HourStart").'</td>';
|
||||
|
||||
// By default, we can edit only tasks we are assigned to
|
||||
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
|
||||
$restrictviewformytask=((! isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)) ? 2 : $conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED);
|
||||
|
||||
// Get if user is available or not for each day
|
||||
$isavailable=array();
|
||||
|
||||
@ -128,6 +128,9 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$search_project_ref = '';
|
||||
$search_thirdparty = '';
|
||||
$search_declared_progress = '';
|
||||
|
||||
// We redefine $usertoprocess
|
||||
$usertoprocess=$user;
|
||||
}
|
||||
if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha'))
|
||||
{
|
||||
@ -593,8 +596,7 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
|
||||
// By default, we can edit only tasks we are assigned to
|
||||
$restrictviewformytask=(empty($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)?1:0);
|
||||
|
||||
$restrictviewformytask=((! isset($conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED)) ? 2 : $conf->global->PROJECT_TIME_SHOW_TASK_NOT_ASSIGNED);
|
||||
if (count($tasksarray) > 0)
|
||||
{
|
||||
//var_dump($tasksarray); // contains only selected tasks
|
||||
|
||||
Loading…
Reference in New Issue
Block a user