From 45c8bbbf74f76995de5bd6cdd6a81db9feb42f8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Apr 2018 12:42:02 +0200 Subject: [PATCH] NEW Can filter on progression in timesheet --- htdocs/projet/activity/perday.php | 5 ++++- htdocs/projet/activity/perweek.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index dbf99903110..9e1c743f77f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -70,6 +70,7 @@ $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); $search_project_ref=GETPOST('search_project_ref', 'alpha'); $search_thirdparty=GETPOST('search_thirdparty', 'alpha'); +$search_declared_progress=GETPOST('search_declared_progress', 'alpha'); $monthofday=GETPOST('addtimemonth'); $dayofday=GETPOST('addtimeday'); @@ -113,6 +114,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; + $search_declared_progress = ''; } if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { @@ -331,6 +333,7 @@ if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_proje if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); +if ($search_declared_progress) $morewherefilter.=natural_search("t.progress", $search_declared_progress, 1); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks @@ -469,7 +472,7 @@ if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print 'global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 37c5b789669..61656d79eb5 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -70,6 +70,7 @@ $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); $search_project_ref=GETPOST('search_project_ref', 'alpha'); $search_thirdparty=GETPOST('search_thirdparty', 'alpha'); +$search_declared_progress=GETPOST('search_declared_progress', 'alpha'); $startdayarray=dol_get_first_day_week($day, $month, $year); @@ -124,6 +125,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; + $search_declared_progress = ''; } if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { @@ -290,6 +292,7 @@ if ($action == 'addtime' && $user->rights->projet->lire) $param.=($search_project_ref?'&search_project_ref='.$search_project_ref:''); $param.=($search_usertoprocessid > 0?'&search_usertoprocessid='.$search_usertoprocessid:''); $param.=($search_thirdparty?'&search_thirdparty='.$search_thirdparty:''); + $param.=($search_declared_progress?'&search_declared_progress='.$search_declared_progress:''); $param.=($search_task_ref?'&search_task_ref='.$search_task_ref:''); $param.=($search_task_label?'&search_task_label='.$search_task_label:''); @@ -333,6 +336,7 @@ if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_proje if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); +if ($search_declared_progress) $morewherefilter.=natural_search("t.progress", $search_declared_progress, 1); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks @@ -502,7 +506,7 @@ if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print 'global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; for ($idw=0;$idw<7;$idw++)