Merge pull request #16771 from frederic34/projet_task_stats

fix php8 warnings
This commit is contained in:
Laurent Destailleur 2021-03-18 23:15:37 +01:00 committed by GitHub
commit b66173a111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 15 deletions

View File

@ -826,23 +826,29 @@ class Conf
unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
}
// For backward compatibility
// product is new use
if (isset($this->product)) {
// For backward compatibility
$this->produit = $this->product;
}
// invoice is new use, facture is old use still initialised
if (isset($this->facture)) {
$this->invoice = $this->facture;
}
// order is new use, commande is old use still initialised
if (isset($this->commande)) {
$this->order = $this->commande;
}
// contract is new use, contrat is old use still initialised
if (isset($this->contrat)) {
$this->contract = $this->contrat;
}
// category is new use, categorie is old use still initialised
if (isset($this->categorie)) {
$this->category = $this->categorie;
}
if (isset($this->project)) {
// project is new use, projet is old use still initialised
if (isset($this->projet) && !isset($this->project)) {
$this->project = $this->projet;
}

View File

@ -65,7 +65,7 @@ $includeuserlist = array();
llxHeader('', $langs->trans('Projects'));
$title = $langs->trans("ProjectsStatistics");
$dir = $conf->projet->dir_output.'/temp';
$dir = $conf->project->dir_output.'/temp';
print load_fiche_titre($title, '', 'project');
@ -224,7 +224,8 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
$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, 'project_stats');
print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1, '');
@ -337,9 +338,9 @@ foreach ($data_all_year as $val) {
print '<td class="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
print '<td class="right">'.$val['nb'].'</td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<td class="right">'.($val['total'] ?price(price2num($val['total'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['avg'] ?price(price2num($val['avg'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['weighted'] ?price(price2num($val['weighted'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['total'] ? price(price2num($val['total'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.($val['avg'] ? price(price2num($val['avg'], 'MT'), 1) : '0').'</td>';
print '<td class="right">'.(isset($val['weighted']) ? price(price2num($val['weighted'], 'MT'), 1) : '0').'</td>';
}
print '</tr>';
$oldyear = $year;
@ -350,7 +351,7 @@ print '</div>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$stringtoshow .= '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
$stringtoshow = '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
if ($mesg) {
print $mesg;
} else {

View File

@ -65,7 +65,7 @@ $includeuserlist = array();
llxHeader('', $langs->trans('Tasks'));
$title = $langs->trans("TasksStatistics");
$dir = $conf->projet->dir_output.'/temp';
$dir = $conf->project->dir_output.'/temp';
print load_fiche_titre($title, '', 'projecttask');
@ -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, 'project_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 '<tr class="oddeven" height="24">';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$oldyear.'</a></td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$oldyear.'</a></td>';
print '<td class="right">0</td>';
print '</tr>';
}
print '<tr class="oddeven" height="24">';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
print '<td class="right">'.$val['nb'].'</td>';
print '</tr>';
$oldyear = $year;
@ -208,7 +208,7 @@ print '</div>';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$stringtoshow .= '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
$stringtoshow = '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
if ($mesg) {
print $mesg;
} else {