diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php
index c216214606d..ed79978552f 100644
--- a/htdocs/adherents/stats/index.php
+++ b/htdocs/adherents/stats/index.php
@@ -189,8 +189,8 @@ foreach ($data as $val) {
//print '';
print '';
print '
0 | ';
- print '0 | ';
- print '0 | ';
+ print '0 | ';
+ print '0 | ';
print '';
}
print '';
@@ -200,8 +200,8 @@ foreach ($data as $val) {
//print '';
print '';
print '| '.$val['nb'].' | ';
- print ''.price(price2num($val['total'], 'MT'), 1).' | ';
- print ''.price(price2num($val['avg'], 'MT'), 1).' | ';
+ print ''.price(price2num($val['total'], 'MT'), 1).' | ';
+ print ''.price(price2num($val['avg'], 'MT'), 1).' | ';
print '
';
$oldyear = $year;
}
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index aebed5e3eb4..bd92dc084c7 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -316,14 +316,14 @@ if ($mode == 'supplier') {
}
print '| '.$cat_label.' | ';
print img_picto('', 'category', 'class="pictofixedwidth"');
-print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
+print $formother->select_categories($cat_type, $categ_id, 'categ_id', 0, 1, 'widthcentpercentminusx maxwidth300');
print ' |
';
// User
-print '| '.$langs->trans("CreatedBy").' | ';
+print ' |
| '.$langs->trans("CreatedBy").' | ';
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
// Status
-print ' |
| '.$langs->trans("Status").' | ';
+print ' |
| '.$langs->trans("Status").' | ';
if ($mode == 'customer') {
$liststatus = array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraft"),
@@ -388,11 +388,11 @@ foreach ($data as $val) {
print ' |
';
print '| 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.' | ';
print ''.$val['nb'].' | ';
- print ''.round($val['nb_diff']).' | ';
+ print ''.round($val['nb_diff']).'% | ';
print ''.price(price2num($val['total'], 'MT'), 1).' | ';
- print ''.round($val['total_diff']).' | ';
+ print ''.round($val['total_diff']).'% | ';
print ''.price(price2num($val['avg'], 'MT'), 1).' | ';
- print ''.round($val['avg_diff']).' | ';
+ print ''.round($val['avg_diff']).'% | ';
print '
';
$oldyear = $year;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 1f350d65fcf..8c2e55df7bc 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6971,7 +6971,7 @@ abstract class CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($this->db);
}
-
+var_dump($val);
$objectid = $this->id;
$label = $val['label'];
$type = $val['type'];
@@ -7018,7 +7018,7 @@ abstract class CommonObject
$langfile = $val['langfile'];
$list = $val['list'];
- $help = $val['help'];
+ $help = (empty($val['help']) ? '' : $val['help']);
$hidden = (($val['visible'] == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
if ($hidden) {
@@ -7044,9 +7044,9 @@ abstract class CommonObject
} elseif ($type == 'boolean') {
$morecss = '';
} else {
- if (round($size) < 12) {
+ if (is_numeric($size) && round($size) < 12) {
$morecss = 'minwidth100';
- } elseif (round($size) <= 48) {
+ } elseif (is_numeric($size) && round($size) <= 48) {
$morecss = 'minwidth200';
} else {
$morecss = 'minwidth400';
diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php
index ce8add98d54..5f8a9f628b5 100644
--- a/htdocs/expensereport/stats/index.php
+++ b/htdocs/expensereport/stats/index.php
@@ -274,8 +274,8 @@ foreach ($data as $val) {
print '';
print '| '.$oldyear.' | ';
print '0 | ';
- print '0 | ';
- print '0 | ';
+ print '0 | ';
+ print '0 | ';
print '
';
}
@@ -283,8 +283,8 @@ foreach ($data as $val) {
print '';
print '| '.$year.' | ';
print ''.$val['nb'].' | ';
- print ''.price(price2num($val['total'], 'MT'), 1).' | ';
- print ''.price(price2num($val['avg'], 'MT'), 1).' | ';
+ print ''.price(price2num($val['total'], 'MT'), 1).' | ';
+ print ''.price(price2num($val['avg'], 'MT'), 1).' | ';
print '
';
$oldyear = $year;
}
diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php
index c420e2fbe79..afd86f3ed07 100644
--- a/htdocs/projet/stats/index.php
+++ b/htdocs/projet/stats/index.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2015 Laurent Destailleur
+ * Copyright (C) 2015-2021 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -325,12 +325,12 @@ foreach ($data_all_year as $val) {
print '';
print '| 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$oldyear.' | ';
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
- print '0 | ';
- print '0 | ';
- print '0 | ';
- }
print '0 | ';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print '0 | ';
+ print '0 | ';
+ print '0 | ';
+ }
print '
';
}
@@ -338,9 +338,9 @@ foreach ($data_all_year as $val) {
print ' 0 ? '&socid='.$socid : '').($userid > 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 ''.(isset($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;