diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index aa5044da610..012a71f21a0 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -62,6 +62,7 @@ $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');
$monthofday=GETPOST('addtimemonth');
@@ -79,6 +80,17 @@ $object=new Task($db);
* Actions
*/
+// Purge criteria
+if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+{
+ $action = '';
+ $search_project_ref = '';
+}
+if (GETPOST("button_search_x") || GETPOST("button_search.x") || GETPOST("button_search"))
+{
+ $action = '';
+}
+
if (GETPOST('submitdateselect'))
{
$daytoparse = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
@@ -253,6 +265,8 @@ $formproject=new FormProjets($db);
$projectstatic=new Project($db);
$project = new Project($db);
$taskstatic = new Task($db);
+$thirdpartystatic = new Societe($db);
+
$prev = dol_getdate($daytoparse - (24 * 3600));
$prev_year = $prev['year'];
@@ -278,7 +292,8 @@ if ($id)
}
$onlyopenedproject=1; // or -1
-$tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, '', $onlyopenedproject); // We want to see all task of opened project i am allowed to see, not only mine. Later only mine will be editable later.
+$morewherefilter='';
+$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);
//var_dump($tasksarray);
@@ -290,12 +305,14 @@ llxHeader("",$title,"");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'title_project');
-$param=($mode?'&mode='.$mode:'');
+$param='';
+$param.=($mode?'&mode='.$mode:'');
+$param.=($search_project_ref?'&search_project_ref='.$search_project_ref:'');
// Show navigation bar
-$nav ="".img_previous($langs->trans("Previous"))."\n";
+$nav =''.img_previous($langs->trans("Previous"))."\n";
$nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"day")." \n";
-$nav.="".img_next($langs->trans("Next"))."\n";
+$nav.=''.img_next($langs->trans("Next"))."\n";
$nav.=" (".$langs->trans("Today").")";
$nav.='
'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
$nav.=' ';
@@ -362,6 +379,9 @@ print "\n";
//print '';
//print '';
//print '';
+
+print '
| '.$langs->trans("Project").' | '; print ''.$langs->trans("RefTask").' | '; print ''.$langs->trans("LabelTask").' | '; +print ''.$langs->trans("ProjectRef").' | '; +if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) +{ + print ''.$langs->trans("ThirdParty").' | '; +} print ''.$langs->trans("PlannedWorkload").' | '; print ''.$langs->trans("ProgressDeclared").' | '; print ''.$langs->trans("TimeSpent").' | '; @@ -389,6 +412,25 @@ print ''.$langs->trans("Duration").' | '; print ''.$langs->trans("Note").' | '; print "|||
| '; +print ' | '; +print ' | '; +if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ' | '; +print ' | '; +print ' | '; +print ' | '; +print ' | '; +print ' | '; +print ' | '; +// Action column +print ' | '; +$searchpitco=$form->showFilterAndCheckAddButtons(0); +print $searchpitco; +print ' | '; +print "||
| '.$langs->trans("RefTask").' | '; +print ''.$langs->trans("LabelTask").' | '; +print ''.$langs->trans("ProjectRef").' | '; if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) { print ''.$langs->trans("ThirdParty").' | '; } -print ''.$langs->trans("Project").' | '; -print ''.$langs->trans("RefTask").' | '; -print ''.$langs->trans("LabelTask").' | '; print ''.$langs->trans("PlannedWorkload").' | '; print ''.$langs->trans("ProgressDeclared").' | '; print ''.$langs->trans("TimeSpent").' | '; @@ -389,10 +408,29 @@ $startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['fi for($i=0;$i<7;$i++) { - print ''.dol_print_date($startday + ($i * 3600 * 24), '%a').' '.dol_print_date($startday + ($i * 3600 * 24), 'dayreduceformat').' | ';
+ print ''.dol_print_date($startday + ($i * 3600 * 24), '%a').' '.dol_print_date($startday + ($i * 3600 * 24), 'dayreduceformat').' | ';
}
print ''; +print " |
| '; +print ' | '; +print ' | '; +if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) print ' | '; +print ' | '; +print ' | '; +print ' | '; +print ' | '; +for($i=0;$i<7;$i++) +{ + print ' | '; +} +// Action column +print ' | '; +$searchpitco=$form->showFilterAndCheckAddButtons(0); +print $searchpitco; +print ' | '; print "