From efaa2be3b81a7504e271b6b4e8c74ba413ca3453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 17 Mar 2021 18:38:24 +0100 Subject: [PATCH] fix php8 warnings --- htdocs/core/photos_resize.php | 2 +- htdocs/projet/stats/index.php | 21 +++++++++++---------- htdocs/projet/tasks/stats/index.php | 12 ++++++------ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 008e524f299..f03436c0043 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -142,7 +142,7 @@ if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'serv if ($result <= 0) { dol_print_error($db, 'Failed to load object'); } - $dir = $conf->project->multidir_output[$object->entity]; // By default + $dir = $conf->projet->multidir_output[$object->entity]; // By default } } elseif ($modulepart == 'propal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index f25e78bceda..afbc4f7c55b 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -99,7 +99,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $data1 = array(array(0=>$langs->trans("None"), 1=>1)); } - $filenamenb = $conf->project->dir_output."/stats/projectbystatus.png"; + $filenamenb = $conf->projet->dir_output."/stats/projectbystatus.png"; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=projectstats&file=projectbystatus.png'; $px = new DolGraph(); $mesg = $px->isGraphKo(); @@ -150,7 +150,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $data = $stats_project->getNbByMonthWithPrevYear($endyear, $startyear); //var_dump($data); -$filenamenb = $conf->project->dir_output."/stats/projectnbprevyear-".$year.".png"; +$filenamenb = $conf->projet->dir_output."/stats/projectnbprevyear-".$year.".png"; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=projectstats&file=projectnbprevyear-'.$year.'.png'; $px1 = new DolGraph(); @@ -182,7 +182,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) - $filenamenb = $conf->project->dir_output."/stats/projectamountprevyear-".$year.".png"; + $filenamenb = $conf->projet->dir_output."/stats/projectamountprevyear-".$year.".png"; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=projectstats&file=projectamountprevyear-'.$year.'.png'; $px2 = new DolGraph(); @@ -217,14 +217,15 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { //var_dump($data); // $data = array(array('Lib',val1,val2,val3),...) - $filenamenb = $conf->project->dir_output."/stats/projecttransrateprevyear-".$year.".png"; + $filenamenb = $conf->projet->dir_output."/stats/projecttransrateprevyear-".$year.".png"; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=projectstats&file=projecttransrateprevyear-'.$year.'.png'; $px3 = new DolGraph(); $mesg = $px3->isGraphKo(); if (!$mesg) { $px3->SetData($data); - $i = $startyear; $legend = array(); + $i = $startyear; + $legend = array(); while ($i <= $endyear) { $legend[] = $i; $i++; @@ -268,7 +269,7 @@ $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -complete_head_from_modules($conf, $langs, null, $head, $h, $type); +complete_head_from_modules($conf, $langs, null, $head, $h, 'projet_stats'); print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, ''); @@ -337,9 +338,9 @@ foreach ($data_all_year as $val) { print ' 0 ? '&userid='.$userid : '').'">'.$year.''; print ''.$val['nb'].''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''.($val['total'] ?price(price2num($val['total'], 'MT'), 1) : '0').''; - print ''.($val['avg'] ?price(price2num($val['avg'], 'MT'), 1) : '0').''; - print ''.($val['weighted'] ?price(price2num($val['weighted'], 'MT'), 1) : '0').''; + print ''.($val['total'] ? price(price2num($val['total'], 'MT'), 1) : '0').''; + print ''.($val['avg'] ? price(price2num($val['avg'], 'MT'), 1) : '0').''; + print ''.(isset($val['weighted']) ? price(price2num($val['weighted'], 'MT'), 1) : '0').''; } print ''; $oldyear = $year; @@ -350,7 +351,7 @@ print ''; print '
'; -$stringtoshow .= '
'; +$stringtoshow = ''; - print ''; + print ''; print ''; print ''; } print ''; - print ''; + print ''; print ''; print ''; $oldyear = $year; @@ -208,7 +208,7 @@ print ''; print '
'; -$stringtoshow .= '
'; if ($mesg) { print $mesg; } else { diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index 81c05fde59d..be6ac3c7802 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -90,7 +90,7 @@ if (!empty($year)) { $data = $stats_tasks->getNbByMonthWithPrevYear($endyear, $startyear); //var_dump($data); -$filenamenb = $conf->project->dir_output."/stats/tasknbprevyear-".$year.".png"; +$filenamenb = $conf->projet->dir_output."/stats/tasknbprevyear-".$year.".png"; $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=taskstats&file=tasknbprevyear-'.$year.'.png'; $px1 = new DolGraph(); @@ -134,12 +134,12 @@ if (!count($arrayyears)) { $h = 0; $head = array(); -$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/stats/index.php?mode='.$mode; +$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/stats/index.php?'; $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -complete_head_from_modules($conf, $langs, null, $head, $h, $type); +complete_head_from_modules($conf, $langs, null, $head, $h, 'projet_tasks_stats'); print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, ''); @@ -191,13 +191,13 @@ foreach ($data_all_year as $val) { $oldyear--; print '
0 ? '&userid='.$userid : '').'">'.$oldyear.' 0 ? '&userid='.$userid : '').'">'.$oldyear.'0
0 ? '&userid='.$userid : '').'">'.$year.' 0 ? '&userid='.$userid : '').'">'.$year.''.$val['nb'].'
'; +$stringtoshow = '
'; if ($mesg) { print $mesg; } else {