diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index e9e06708f7c..4da32edd666 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -844,7 +844,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
}
print '';
}*/
- if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
+ if (count($arrayfields) > 0 && !empty($arrayfields['c.budget_amount']['checked'])) {
print '
';
print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
$total_budget_amount += $lines[$i]->budget_amount;
@@ -856,8 +856,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print ' | ';
foreach (array('internal', 'external') as $source) {
$tab = $lines[$i]->liste_contact(-1, $source);
- $num = count($tab);
- if (!empty($num)) {
+ $numcontact = count($tab);
+ if (!empty($numcontact)) {
foreach ($tab as $contacttask) {
//var_dump($contacttask);
if ($source == 'internal') {
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 4078afb20c0..5b421abe010 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -198,6 +198,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
// Add non object fields to fields for list
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23);
+$arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120);
$arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'position'=> 116, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106);
// Force some fields according to search_usage filter...
if (GETPOST('search_usage_opportunity')) {
@@ -911,7 +912,7 @@ if (!empty($arrayfields['p.public']['checked'])) {
// Opp status
if (!empty($arrayfields['p.fk_opp_status']['checked'])) {
print ' | ';
- print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 0, 1, 0, 'maxwidth100');
+ print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 0, 1, 0, 'maxwidth100', 1);
print ' | ';
}
if (!empty($arrayfields['p.opp_amount']['checked'])) {
@@ -933,6 +934,10 @@ if (!empty($arrayfields['p.budget_amount']['checked'])) {
print '';
print '';
}
+if (!empty($arrayfields['c.assigned']['checked'])) {
+ print '';
+ print ' | ';
+}
if (!empty($arrayfields['p.usage_opportunity']['checked'])) {
print '';
print $form->selectyesno('search_usage_opportunity', $search_usage_opportunity, 1, false, 1);
@@ -1003,7 +1008,7 @@ if (!empty($arrayfields['p.fk_statut']['checked'])) {
$arrayofstatus[$key] = $langs->trans($val);
}
$arrayofstatus['99'] = $langs->trans("NotClosed").' ('.$langs->trans('Draft').' + '.$langs->trans('Opened').')';
- print $form->selectarray('search_status', $arrayofstatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'minwidth75imp maxwidth150 selectarrowonleft');
+ print $form->selectarray('search_status', $arrayofstatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'minwidth75imp maxwidth125 selectarrowonleft');
print ajax_combobox('search_status');
print ' | ';
}
@@ -1052,6 +1057,9 @@ if (!empty($arrayfields['opp_weighted_amount']['checked'])) {
if (!empty($arrayfields['p.budget_amount']['checked'])) {
print_liste_field_titre($arrayfields['p.budget_amount']['label'], $_SERVER["PHP_SELF"], 'p.budget_amount', "", $param, '', $sortfield, $sortorder, 'right ');
}
+if (!empty($arrayfields['c.assigned']['checked'])) {
+ print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ', '');
+}
if (!empty($arrayfields['p.usage_opportunity']['checked'])) {
print_liste_field_titre($arrayfields['p.usage_opportunity']['label'], $_SERVER["PHP_SELF"], 'p.usage_opportunity', "", $param, '', $sortfield, $sortorder, 'right ');
}
@@ -1312,6 +1320,35 @@ while ($i < min($num, $limit)) {
$totalarray['pos'][$totalarray['nbfield']] = 'p.budget_amount';
}
}
+ // Contacts of project
+ if (!empty($arrayfields['c.assigned']['checked'])) {
+ print '';
+ foreach (array('internal', 'external') as $source) {
+ $tab = $object->liste_contact(-1, $source);
+ $numcontact = count($tab);
+ if (!empty($numcontact)) {
+ foreach ($tab as $contactproject) {
+ //var_dump($contacttask);
+ if ($source == 'internal') {
+ $c = new User($db);
+ } else {
+ $c = new Contact($db);
+ }
+ $c->fetch($contactproject['id']);
+ if (!empty($c->photo)) {
+ print $c->getNomUrl(-2).' ';
+ } else {
+ if (get_class($c) == 'User') {
+ print $c->getNomUrl(2, '', 0, 0, 24, 1);//.' ';
+ } else {
+ print $c->getNomUrl(2);//.' ';
+ }
+ }
+ }
+ }
+ }
+ print ' | ';
+ }
// Usage opportunity
if (!empty($arrayfields['p.usage_opportunity']['checked'])) {
print '';
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index e8c938d2156..dc482c1c60c 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -811,9 +811,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
print ' |