From 4912f6a7205865df407b391e939a74e3f4218f1b Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sat, 19 Nov 2022 22:15:58 +0100 Subject: [PATCH 1/5] Fix #22675 - avoid warning when weight is empty --- htdocs/core/lib/functions2.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 9808fbb28b9..6582665ce73 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1755,6 +1755,7 @@ function weight_convert($weight, &$from_unit, $to_unit) * weigh_convert(320, $f, 0) retournera 0.32 * */ + $weight = is_numeric($weight) ? $weight : 0; while ($from_unit <> $to_unit) { if ($from_unit > $to_unit) { $weight = $weight * 10; From 92647d30e74c145837b12da230ce1190e2d7d6ff Mon Sep 17 00:00:00 2001 From: Christian Humpel Date: Mon, 21 Nov 2022 00:07:50 +0100 Subject: [PATCH 2/5] Fix #22768 remove "natural_search" on status and fk_parent_line. --- htdocs/mrp/mo_list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index e0b9a8f90da..2b0cdaa0c4d 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -174,6 +174,9 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if ($key == 'status'){ + $search[$key] = -1; + } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { $search[$key.'_dtstart'] = ''; $search[$key.'_dtend'] = ''; @@ -247,7 +250,7 @@ foreach ($search as $key => $val) { if ($key == 'status' && $search[$key] == -1) { continue; } - if ($key == 'fk_parent_line') { + if ($key == 'fk_parent_line' && $search[$key] != '') { $sql .= natural_search('moparent.ref', $search[$key], 0); continue; } From b5cafeefcf6e1d80fece565767e24edef87fece6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 20 Nov 2022 23:16:19 +0000 Subject: [PATCH 3/5] Fixing style errors. --- htdocs/mrp/mo_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 2b0cdaa0c4d..eacd731237c 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -174,7 +174,7 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; - if ($key == 'status'){ + if ($key == 'status') { $search[$key] = -1; } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { From 322124690c0df1af909b1ac49d627ad63c97b65b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Nov 2022 14:47:31 +0100 Subject: [PATCH 4/5] Fix sql syntax error --- htdocs/comm/propal/class/propal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c459ea7b84a..3717ed361b8 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -4418,8 +4418,8 @@ class PropaleLigne extends CommonObjectLine $sql .= ", qty='".price2num($this->qty)."'"; $sql .= ", subprice=".price2num($this->subprice).""; $sql .= ", remise_percent=".price2num($this->remise_percent).""; - $sql .= ", price=".price2num($this->price).""; // TODO A virer - $sql .= ", remise=".price2num($this->remise).""; // TODO A virer + $sql .= ", price=".(float) price2num($this->price).""; // TODO A virer + $sql .= ", remise=".(float) price2num($this->remise).""; // TODO A virer $sql .= ", info_bits='".$this->db->escape($this->info_bits)."'"; if (empty($this->skip_update_total)) { $sql .= ", total_ht=".price2num($this->total_ht).""; From af413cb09f49f4cecc1b6221896bc217184c8b3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Nov 2022 15:12:46 +0100 Subject: [PATCH 5/5] Fix #yogosha13195 --- htdocs/comm/action/index.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 2afad30c454..e313c1207cb 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -277,11 +277,11 @@ if (empty($conf->global->AGENDA_DISABLE_EXT)) { // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' $listofextcals[] = array( 'src' => getDolGlobalString($source), - 'name' => getDolGlobalString($name), - 'offsettz' => (!empty($conf->global->$offsettz) ? $conf->global->$offsettz : 0), - 'color' => getDolGlobalString($color), - 'default' => getDolGlobalString($default), - 'buggedfile' => (isset($conf->global->buggedfile) ? $conf->global->buggedfile : 0) + 'name' => dol_string_nohtmltag(getDolGlobalString($name)), + 'offsettz' => (int) getDolGlobalInt($offsettz, 0), + 'color' => dol_string_nohtmltag(getDolGlobalString($color)), + 'default' => dol_string_nohtmltag(getDolGlobalString($default)), + 'buggedfile' => dol_string_nohtmltag(getDolGlobalString('buggedfile', '')) ); } } @@ -302,11 +302,11 @@ if (empty($user->conf->AGENDA_DISABLE_EXT)) { // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' $listofextcals[] = array( 'src' => $user->conf->$source, - 'name' => $user->conf->$name, - 'offsettz' => (!empty($user->conf->$offsettz) ? $user->conf->$offsettz : 0), - 'color' => $user->conf->$color, - 'default' => $user->conf->$default, - 'buggedfile' => (isset($user->conf->buggedfile) ? $user->conf->buggedfile : 0) + 'name' => dol_string_nohtmltag($user->conf->$name), + 'offsettz' => (int) (empty($user->conf->$offsettz) ? 0 : $user->conf->$offsettz), + 'color' => dol_string_nohtmltag($user->conf->$color), + 'default' => dol_string_nohtmltag($user->conf->$default), + 'buggedfile' => dol_string_nohtmltag(isset($user->conf->buggedfile) ? $user->conf->buggedfile : '') ); } } @@ -613,7 +613,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on $default = ''; } - $s .= '
 
'; + $s .= '
 
'; } } @@ -636,8 +636,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on if (!preg_match('/showbirthday=/i', $newparam)) { $newparam .= '&showbirthday=1'; } - $link = 'trans("AgendaShowBirthdayEvents");