From 68415322ecfaef55e885bea7ee2f9b7b044c5e28 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 29 Apr 2021 10:00:54 +0200 Subject: [PATCH 1/8] Fix v11 wrong alias in natural_search --- htdocs/adherents/type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4590254ebf6..65996fc7283 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -511,7 +511,7 @@ if ($rowid > 0) $sql .= " AND t.rowid = ".$object->id; if ($sall) { - $sql .= natural_search(array("f.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall); + $sql .= natural_search(array("d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall); } if ($status != '') { From 965eb2d6397025e8ddf72501d4f46185a1aed744 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 29 Apr 2021 22:57:39 +0200 Subject: [PATCH 2/8] Fix logical test always false subscription is an integer and is set to 0 or 1. So subscription is never equal to "yes" --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 838e7cd9a5c..dad19ffafcd 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -857,7 +857,7 @@ while ($i < min($num, $limit)) else { print ''; - if ($obj->subscription == 'yes') + if (!empty($obj->subscription)) { print $langs->trans("SubscriptionNotReceived"); if ($obj->statut > 0) print " ".img_warning(); From 4174ebd9c0023bdda8ad1d9899a8a1a003aeb19b Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 29 Apr 2021 23:11:51 +0200 Subject: [PATCH 3/8] Fix subscription =="yes" --- htdocs/adherents/type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4590254ebf6..81e387b8dbb 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -710,7 +710,7 @@ if ($rowid > 0) else { print ''; - if ($objp->subscription == 'yes') + if (!empty($objp->subscription)) { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) print " ".img_warning(); From 749aeeb233f26cdf1af9f3de6edcae140296af45 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 29 Apr 2021 23:16:21 +0200 Subject: [PATCH 4/8] Fix $objp->subscription =="yes" --- htdocs/societe/societecontact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 8874a62bc3b..4a8879c60bd 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -331,7 +331,7 @@ if ($id > 0 || ! empty($ref)) else { print ''; - if ($objp->subscription == 'yes') + if (!empty($objp->subscription)) { print $langs->trans("SubscriptionNotReceived"); if ($objp->statut > 0) print " ".img_warning(); From 5e98d9932156019c948c1d3e3b29011a8451a12a Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 30 Apr 2021 10:04:21 +0200 Subject: [PATCH 5/8] FIX SQL Error show_contacts : socialnetworks --- htdocs/core/lib/company.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 48ab350d60f..d71be0b723e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -902,11 +902,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') 't.email', ); //Social media - foreach ($socialnetworks as $key => $value) { - if ($value['active']) { - $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; - } - } +// foreach ($socialnetworks as $key => $value) { +// if ($value['active']) { +// $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; +// } +// } if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "t.lastname"; From 81b964db45b353abf21f54a8bb6e369e32f1b600 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 30 Apr 2021 08:12:24 +0000 Subject: [PATCH 6/8] Fixing style errors. --- htdocs/core/lib/company.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d71be0b723e..16f52ad80e3 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -902,11 +902,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') 't.email', ); //Social media -// foreach ($socialnetworks as $key => $value) { -// if ($value['active']) { -// $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; -// } -// } + // foreach ($socialnetworks as $key => $value) { + // if ($value['active']) { + // $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; + // } + // } if (!$sortorder) $sortorder = "ASC"; if (!$sortfield) $sortfield = "t.lastname"; From 6c1e0919c8c42789ab2993d61ae116b9c952a832 Mon Sep 17 00:00:00 2001 From: ATM john Date: Fri, 30 Apr 2021 12:20:43 +0200 Subject: [PATCH 7/8] Fix checkbox multiselect pre-selected value from get/post --- htdocs/core/class/extrafields.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ed85a328edc..07d80acd9aa 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1339,7 +1339,11 @@ class ExtraFields } elseif ($type == 'checkbox') { - $value_arr = explode(',', $value); + $value_arr = $value; + if (!is_array($value)) + { + $value_arr = explode(',', $value); + } $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%'); } elseif ($type == 'radio') From 33a20ae9a1f43dc7adcecdd32bf140ccf3973c8d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 May 2021 16:16:44 +0200 Subject: [PATCH 8/8] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 07d80acd9aa..3d55b12c35c 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1340,8 +1340,7 @@ class ExtraFields elseif ($type == 'checkbox') { $value_arr = $value; - if (!is_array($value)) - { + if (!is_array($value)) { $value_arr = explode(',', $value); } $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');