From 0146be0d157198eb1f6f65419e3cbdb2388e8a3d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jun 2022 18:13:21 +0200 Subject: [PATCH 1/4] fix: filter status do not work on peruser action comm --- htdocs/comm/action/peruser.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index f74974a26d9..5adf5946f35 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -99,7 +99,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOST("search_status", 'alpha') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' $type = GETPOST("search_type", 'alpha') ?GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); $maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -153,9 +153,10 @@ if ($end_d < $begin_d) { $end_d = $begin_d + 1; } -if ($status == '' && !GETPOSTISSET('status')) { +if ($status == '' && !GETPOSTISSET('search_status')) { $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } + if (empty($mode) && !GETPOSTISSET('mode')) { $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); } @@ -512,7 +513,7 @@ print '
'; if (empty($search_status)) { $search_status = ''; } -print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); +print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
'; @@ -623,6 +624,7 @@ if ($type) { $sql .= " AND ca.id = ".((int) $type); } if ($status == '0') { + $sql .= " AND a.percent = 0"; } if ($status == '-1') { From 70892c18c5e7f1163bf8c05701be20d3c28cb65a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jun 2022 18:14:15 +0200 Subject: [PATCH 2/4] fix: filter status do not work on peruser action comm --- htdocs/comm/action/peruser.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 5adf5946f35..82c15392349 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -624,7 +624,6 @@ if ($type) { $sql .= " AND ca.id = ".((int) $type); } if ($status == '0') { - $sql .= " AND a.percent = 0"; } if ($status == '-1') { From 48fdfe26fa78c0066d3896a3b257d505757a9e2e Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:44:00 +0200 Subject: [PATCH 3/4] Fix: rollback on success create_individual Fix: Societe::create_individual rollback on success --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0f7ad23acb0..beb0f699246 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1078,7 +1078,7 @@ class Societe extends CommonObject } } - if (!empty($error)) { + if (empty($error)) { dol_syslog(get_class($this)."::create_individual success"); $this->db->commit(); } else { From c9049a9c85fac248c6cdf81f70298c90c0d619c2 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 8 Jun 2022 12:35:31 +0200 Subject: [PATCH 4/4] Fix non numeric warning --- htdocs/product/class/productcustomerprice.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index a9444d1c569..64db4a4eb55 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -135,7 +135,7 @@ class Productcustomerprice extends CommonObject $this->price_base_type = trim($this->price_base_type); } if (isset($this->tva_tx)) { - $this->tva_tx = trim($this->tva_tx); + $this->tva_tx = (float) $this->tva_tx; } if (isset($this->recuperableonly)) { $this->recuperableonly = trim($this->recuperableonly); @@ -621,7 +621,7 @@ class Productcustomerprice extends CommonObject $this->price_base_type = trim($this->price_base_type); } if (isset($this->tva_tx)) { - $this->tva_tx = trim($this->tva_tx); + $this->tva_tx = (float) $this->tva_tx; } if (isset($this->recuperableonly)) { $this->recuperableonly = trim($this->recuperableonly);