From 3765a89283a815bc4f30cef1359fcaaf26922af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 13:57:04 +0200 Subject: [PATCH 1/5] fix warnings in task list --- htdocs/projet/tasks/list.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 53b1a85e889..1d7d967c20c 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -67,8 +67,9 @@ $search_task_user = GETPOST('search_task_user', 'int'); $search_task_progress = GETPOST('search_task_progress'); $search_task_budget_amount = GETPOST('search_task_budget_amount'); $search_societe = GETPOST('search_societe'); +$search_opp_status = GETPOST("search_opp_status", 'alpha'); -$mine = $_REQUEST['mode'] == 'mine' ? 1 : 0; +$mine = (GETPOSTISSET('mode') && GETPOST('mode', 'alpha') == 'mine') ? 1 : 0; if ($mine) { $search_task_user = $user->id; $mine = 0; } @@ -346,7 +347,7 @@ $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tt ON tt.fk_task = t.rowid"; } -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } if ($search_project_user > 0) { @@ -864,7 +865,29 @@ if (!empty($arrayfields['t.billed']['checked'])) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$totalarray = array(); +$totalarray['nbfield'] = 0; +$totalarray['val'] = array(); +$totalarray['val']['t.planned_workload'] = 0; +$totalarray['val']['t.duration_effective'] = 0; +$totalarray['val']['t.progress'] = 0; +$totalarray['val']['t.budget_amount'] = 0; +$totalarray['totalplannedworkload'] = 0; +$totalarray['totaldurationeffective'] = 0; +$totalarray['totaldurationdeclared'] = 0; +$totalarray['totaltobillfield'] = array(); +$totalarray['totalbilledfield'] = 0; +$totalarray['totalbudget_amountfield'] = 0; +$totalarray['totalbudgetamount'] = 0; +$totalarray['totaltobill'] = 0; +$totalarray['totalbilled'] = 0; +$parameters = array( + 'arrayfields'=>$arrayfields, + 'param'=>$param, + 'sortfield'=>$sortfield, + 'sortorder'=>$sortorder, + 'totalarray' => $totalarray, +); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['t.datec']['checked'])) { @@ -887,7 +910,6 @@ if (!empty($conf->global->PROJECT_TIMES_SPENT_FORMAT)) { } $i = 0; -$totalarray = array(); while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -1148,7 +1170,7 @@ while ($i < min($num, $limit)) { } $totalarray['val']['t.budget_amount'] += $obj->budget_amount; if (!$i) { - $totalarray['totalbudget_amount'] = $totalarray['nbfield']; + $totalarray['totalbudget_amountfield'] = $totalarray['nbfield']; } $totalarray['totalbudgetamount'] += $obj->budget_amount; print ''; @@ -1269,7 +1291,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota print ''.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).''; } elseif ($totalarray['totalbilledfield'] == $i) { print ''.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).''; - } elseif ($totalarray['totalbudget_amount'] == $i) { + } elseif ($totalarray['totalbudget_amountfield'] == $i) { print ''.price($totalarray['totalbudgetamount'], 0, $langs, 1, 0, 0, $conf->currency).''; } else { print ''; From 5ef5075f8fb4ea705be1971e6e56f44b380ddbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 14:00:05 +0200 Subject: [PATCH 2/5] fix warnings in task list --- htdocs/projet/tasks/list.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 1d7d967c20c..fa9d18bf2a5 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -69,9 +69,10 @@ $search_task_budget_amount = GETPOST('search_task_budget_amount'); $search_societe = GETPOST('search_societe'); $search_opp_status = GETPOST("search_opp_status", 'alpha'); -$mine = (GETPOSTISSET('mode') && GETPOST('mode', 'alpha') == 'mine') ? 1 : 0; +$mine = GETPOST('mode', 'alpha') == 'mine' ? 1 : 0; if ($mine) { - $search_task_user = $user->id; $mine = 0; + $search_task_user = $user->id; + $mine = 0; } $search_date_startday = GETPOST('search_date_startday', 'int'); @@ -882,11 +883,11 @@ $totalarray['totalbudgetamount'] = 0; $totalarray['totaltobill'] = 0; $totalarray['totalbilled'] = 0; $parameters = array( - 'arrayfields'=>$arrayfields, - 'param'=>$param, - 'sortfield'=>$sortfield, - 'sortorder'=>$sortorder, - 'totalarray' => $totalarray, + 'arrayfields' => $arrayfields, + 'param' => $param, + 'sortfield' => $sortfield, + 'sortorder' => $sortorder, + 'totalarray' => &$totalarray, ); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 5f198c78a9ca21795438302055277f7f5b109cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 14:08:44 +0200 Subject: [PATCH 3/5] fix warnings in task list --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index fa9d18bf2a5..b40031f5f25 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -636,7 +636,7 @@ if ($search_all) { print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; } -$morehtmlfilter = ''; +$moreforfilter = ''; // Filter on categories if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { From 8cd4b0bc83ef9f3d007bfbd68ec095a4c0225757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 14:25:05 +0200 Subject: [PATCH 4/5] fix warnings in task list --- htdocs/projet/tasks/list.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index b40031f5f25..eefa1f05a5a 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -863,25 +863,27 @@ if (!empty($arrayfields['t.tobill']['checked'])) { if (!empty($arrayfields['t.billed']['checked'])) { print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); } +// Hook fields +$totalarray = array( + 'nbfield' => 0, + 'val' => array( + 't.planned_workload' => 0, + 't.duration_effective' => 0, + 't.progress' => 0, + 't.budget_amount' => 0, + ), + 'totalplannedworkload' => 0, + 'totaldurationeffective' => 0, + 'totaldurationdeclared' => 0, + 'totaltobillfield' => 0, + 'totalbilledfield' => 0, + 'totalbudget_amountfield' => 0, + 'totalbudgetamount' => 0, + 'totaltobill' => 0, + 'totalbilled' => 0, +); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; -// Hook fields -$totalarray = array(); -$totalarray['nbfield'] = 0; -$totalarray['val'] = array(); -$totalarray['val']['t.planned_workload'] = 0; -$totalarray['val']['t.duration_effective'] = 0; -$totalarray['val']['t.progress'] = 0; -$totalarray['val']['t.budget_amount'] = 0; -$totalarray['totalplannedworkload'] = 0; -$totalarray['totaldurationeffective'] = 0; -$totalarray['totaldurationdeclared'] = 0; -$totalarray['totaltobillfield'] = array(); -$totalarray['totalbilledfield'] = 0; -$totalarray['totalbudget_amountfield'] = 0; -$totalarray['totalbudgetamount'] = 0; -$totalarray['totaltobill'] = 0; -$totalarray['totalbilled'] = 0; $parameters = array( 'arrayfields' => $arrayfields, 'param' => $param, From db44f4082b37c720ea41dc05c3da063cb56ee51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Oct 2021 14:26:43 +0200 Subject: [PATCH 5/5] fix warnings in task list --- htdocs/projet/tasks/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index eefa1f05a5a..efb74f1036d 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -863,7 +863,6 @@ if (!empty($arrayfields['t.tobill']['checked'])) { if (!empty($arrayfields['t.billed']['checked'])) { print_liste_field_titre($arrayfields['t.billed']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center '); } -// Hook fields $totalarray = array( 'nbfield' => 0, 'val' => array( @@ -884,6 +883,7 @@ $totalarray = array( ); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields $parameters = array( 'arrayfields' => $arrayfields, 'param' => $param,