diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 6a8ef760a04..e11fd409a6e 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -327,16 +327,28 @@ function project_admin_prepare_head()
* @param int $projectsListId List of id of project allowed to user (string separated with comma)
* @param int $addordertick Add a tick to move task
* @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project)
+ * @param string $filterprogresscalc filter text
* @return void
*/
-function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0)
+function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId='', $addordertick=0, $projectidfortotallink=0, $filterprogresscalc='')
{
- global $user, $bc, $langs, $conf;
+ global $user, $bc, $langs, $conf, $db;
global $projectstatic, $taskstatic;
$lastprojectid=0;
$projectsArrayId=explode(',',$projectsListId);
+ if ($filterprogresscalc!=='') {
+ foreach ($lines as $key=>$line) {
+ if (!empty($line->planned_workload) && !empty($line->duration)) {
+ $filterprogresscalc = str_replace(' = ', ' == ', $filterprogresscalc);
+ if (!eval($filterprogresscalc)) {
+ unset($lines[$key]);
+ }
+ }
+ }
+ $lines=array_values($lines);
+ }
$numlines=count($lines);
@@ -519,6 +531,27 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
}
print '';
+ // Contacts of task
+ if (! empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST))
+ {
+ print '
';
- $start = dol_print_date($object->date_start,'day');
+ $start = dol_print_date($object->date_start,'dayhour');
print ($start?$start:'?');
- $end = dol_print_date($object->date_end,'day');
+ $end = dol_print_date($object->date_end,'dayhour');
print ' - ';
print ($end?$end:'?');
if ($object->hasDelay()) print img_warning("Late");
@@ -417,7 +506,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
- if (empty($reshook))
+ if (empty($reshook) && ! empty($extrafields_task->attribute_label))
{
print $object->showOptionals($extrafields_task,'edit');
}
@@ -496,7 +585,7 @@ else if ($id > 0 || ! empty($ref))
// Get list of tasks in tasksarray and taskarrayfiltered
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
$filteronthirdpartyid = $socid;
- $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0);
+ $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0,'',-1,$morewherefilter);
// We load also tasks limited to a particular user
$tmpuser=new User($db);
if ($search_user_id > 0) $tmpuser->fetch($search_user_id);
@@ -510,26 +599,75 @@ else if ($id > 0 || ! empty($ref))
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}
+ // Filter on categories
+ $moreforfilter='';
+ if (count($tasksarray) > 0)
+ {
+ $moreforfilter.='