diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index d803b55c875..4dab8237c16 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -62,8 +62,10 @@ $month=GETPOST('remonth')?GETPOST('remonth'):(GETPOST("month","int")?GETPOST("mo
$day=GETPOST('reday')?GETPOST('reday'):(GETPOST("day","int")?GETPOST("day","int"):date("d"));
$day = (int) $day;
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
-$search_project_ref = GETPOST('search_project_ref', 'alpha');
-
+$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');
$monthofday=GETPOST('addtimemonth');
$dayofday=GETPOST('addtimeday');
@@ -84,7 +86,10 @@ $object=new Task($db);
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$action = '';
+ $search_task_ref = '';
+ $search_task_label = '';
$search_project_ref = '';
+ $search_thirdparty = '';
}
if (GETPOST("button_search_x") || GETPOST("button_search.x") || GETPOST("button_search"))
{
@@ -293,6 +298,9 @@ if ($id)
$onlyopenedproject=1; // or -1
$morewherefilter='';
+if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref);
+if ($search_task_label) $morewherefilter.=natural_search("t.label", $search_task_label);
+if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty);
$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter); // We want to see all task of opened project i am allowed to see, not only mine. Later only mine will be editable later.
$projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id?$project->id:0), 0, $onlyopenedproject);
$tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id?$project->id:0), 0, $onlyopenedproject);
@@ -416,10 +424,11 @@ print '
'.$langs->trans("Note").' ';
print "\n";
print '';
-print ' ';
-print ' ';
+print ' ';
+print ' ';
print ' ';
-if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ' ';
+if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) print ' ';
+print ' ';
print ' ';
print ' ';
print ' ';
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index c64105bca62..cf018ddf153 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -63,7 +63,10 @@ $month=GETPOST('remonth')?GETPOST('remonth','int'):(GETPOST("month")?GETPOST("mo
$day=GETPOST('reday')?GETPOST('reday','int'):(GETPOST("day")?GETPOST("day","int"):date("d"));
$day = (int) $day;
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
-$search_project_ref = GETPOST('search_project_ref', 'alpha');
+$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');
$startdayarray=dol_get_first_day_week($day, $month, $year);
@@ -98,7 +101,10 @@ $object=new Task($db);
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
{
$action = '';
+ $search_task_ref = '';
+ $search_task_label = '';
$search_project_ref = '';
+ $search_thirdparty = '';
}
if (GETPOST("button_search_x") || GETPOST("button_search.x") || GETPOST("button_search"))
{
@@ -290,6 +296,9 @@ if ($id)
$onlyopenedproject=1; // or -1
$morewherefilter='';
+if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref);
+if ($search_task_label) $morewherefilter.=natural_search("t.label", $search_task_label);
+if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty);
$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter); // We want to see all task of opened project i am allowed to see, not only mine. Later only mine will be editable later.
$projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, 0, ($project->id?$project->id:0), 0, $onlyopenedproject);
$tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0, $usertoprocess, ($project->id?$project->id:0), 0, $onlyopenedproject);
@@ -415,10 +424,10 @@ print ' ';
print " \n";
print '';
-print ' ';
-print ' ';
+print ' ';
+print ' ';
print ' ';
-if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ' ';
+if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ' ';
print ' ';
print ' ';
print ' ';
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 27099ef4d91..15e3b154b20 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -623,7 +623,7 @@ class Task extends CommonObject
* @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists
* @param string $filteronprojref Filter on project ref
* @param string $filteronprojstatus Filter on project status
- * @param string $morewherefilter Add more filter into where SQL request
+ * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...')
* @param string $filteronprojuser Filter on user that is a contact of project
* @param string $filterontaskuser Filter on user assigned to task
* @return array Array of tasks