From 3b90dce0cb08ed922ca83127c1a24df3568da339 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Charl=C3=A8ne=20Benke?=
<1179011+defrance@users.noreply.github.com>
Date: Sat, 9 Dec 2023 10:39:13 +0100
Subject: [PATCH 1/2] if $totalarray['type'] not present we consider it as
number
in many list the $totalarray['type'] is not present so we add a default value, the time that all list.php are corrected
---
htdocs/core/tpl/list_print_total.tpl.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php
index f5156da7caf..4e1763837dd 100644
--- a/htdocs/core/tpl/list_print_total.tpl.php
+++ b/htdocs/core/tpl/list_print_total.tpl.php
@@ -14,6 +14,10 @@ if (isset($totalarray['pos'])) {
while ($i < $totalarray['nbfield']) {
$i++;
if (!empty($totalarray['pos'][$i])) {
+ // if $totalarray['type'] not present we consider it as number
+ if (empty($totalarray['type'][$i])) {
+ $totalarray['type'][$i] = 'number';
+ }
switch ($totalarray['type'][$i]) {
case 'duration':
print '
';
From c54fd9a9dd20fe9e5db77c65bb9bfebcc22ff2bf Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Mon, 11 Dec 2023 15:02:59 +0100
Subject: [PATCH 2/2] Update list_print_total.tpl.php
---
htdocs/core/tpl/list_print_total.tpl.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php
index 4e1763837dd..88aff7cce82 100644
--- a/htdocs/core/tpl/list_print_total.tpl.php
+++ b/htdocs/core/tpl/list_print_total.tpl.php
@@ -16,17 +16,17 @@ if (isset($totalarray['pos'])) {
if (!empty($totalarray['pos'][$i])) {
// if $totalarray['type'] not present we consider it as number
if (empty($totalarray['type'][$i])) {
- $totalarray['type'][$i] = 'number';
+ $totalarray['type'][$i] = 'real';
}
switch ($totalarray['type'][$i]) {
case 'duration':
print '| ';
- print(!empty($totalarray['val'][$totalarray['pos'][$i]]) ? convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]], 'allhourmin') : 0);
+ print (!empty($totalarray['val'][$totalarray['pos'][$i]]) ? convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]], 'allhourmin') : 0);
print ' | ';
break;
- case 'string':
+ case 'string': // This type is no more used. type is now varchar(x)
print '';
- print(!empty($totalarray['val'][$totalarray['pos'][$i]]) ? $totalarray['val'][$totalarray['pos'][$i]] : '');
+ print (!empty($totalarray['val'][$totalarray['pos'][$i]]) ? $totalarray['val'][$totalarray['pos'][$i]] : '');
print ' | ';
break;
case 'stock':
|