From 7e8d06e8b830ac59db27d12b7cf2ead3bac48ec1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Jan 2021 14:10:08 +0100 Subject: [PATCH 1/3] Fix update default contact type --- htdocs/contact/card.php | 4 +--- htdocs/contact/class/contact.class.php | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 8c21e4dbfbe..f88560159b0 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -400,9 +400,7 @@ if (empty($reshook)) $object->note_public = (string) GETPOST("note_public", 'restricthtml'); $object->note_private = (string) GETPOST("note_private", 'restricthtml'); - if (GETPOSTISSET("roles")) { - $object->roles = GETPOST("roles", 'array'); - } + $object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index b4555ba4dfd..075e44deead 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1747,14 +1747,14 @@ class Contact extends CommonObject if (count($this->roles) > 0) { foreach ($this->roles as $keyRoles => $valRoles) { $idrole = 0; - if (is_array($idrole)) { + if (is_array($valRoles)) { $idrole = $valRoles['id']; } else { $idrole = $valRoles; } $socid = 0; - if (is_array($idrole)) { + if (is_array($valRoles)) { $socid = $valRoles['socid']; } else { $socid = $this->socid; From 791f5f3f62ce99105504a4bd37464fbc92b279f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jan 2021 13:50:06 +0100 Subject: [PATCH 2/3] Fix css --- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/theme/eldy/global.inc.php | 9 +++++++++ htdocs/theme/md/style.css.php | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index ef7ff63a1c5..31681fb072c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1690,7 +1690,7 @@ class FormFile $fulllink = $urlwithroot.'/document.php'.($paramlink ? '?'.$paramlink : ''); print img_picto($langs->trans("FileSharedViaALink"), 'globe').' '; - print ''; + print ''; } //if (! empty($useinecm) && $useinecm != 6) print ''; } else { $tmpaction = 'view'; - $parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 53dfb1cd5f9..e3a39c5d8b1 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -438,8 +438,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; - $fieldlist = explode(',', $tabfield[$id]); // Line for title @@ -496,7 +494,6 @@ if ($id) else print $valuetoshow; print ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index bb192f0a693..1d3e8bccdd7 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -407,8 +407,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; - $fieldlist = explode(',', $tabfield[$id]); // Line for title @@ -437,7 +435,6 @@ if ($id) else print $valuetoshow; print ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 62e95b2c001..1a6a4f272c0 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -236,7 +236,7 @@ $tabsqlsort[3] = "country ASC, code ASC"; $tabsqlsort[4] = "code ASC"; $tabsqlsort[5] = "label ASC"; $tabsqlsort[6] = "a.type ASC, a.module ASC, a.position ASC, a.code ASC"; -$tabsqlsort[7] = "country ASC, code ASC, a.libelle ASC"; +$tabsqlsort[7] = "c.label ASC, a.code ASC, a.libelle ASC"; $tabsqlsort[8] = "country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ' t.position ASC,' : '')." libelle ASC"; $tabsqlsort[9] = "label ASC"; $tabsqlsort[10] = "country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC"; @@ -1069,6 +1069,7 @@ if ($id) elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code); elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code); elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code); + elseif ($search_code != '' && $id == 7) $sql .= natural_search("a.code", $search_code); elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code); if ($sortfield) @@ -1107,7 +1108,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; $withentity = null; $fieldlist = explode(',', $tabfield[$id]); @@ -1214,7 +1214,6 @@ if ($id) else $tdsoffields .= $valuetoshow; $tdsoffields .= ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } if ($id == 4) $tdsoffields .= ''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 0ca4be65910..3ebbd9300bc 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -435,9 +435,6 @@ if ($id) // Form to add a new line if ($tabname[$id]) { - $alabelisused = 0; - $var = false; - $fieldlist = explode(',', $tabfield[$id]); // Line for title @@ -461,7 +458,6 @@ if ($id) } else print $valuetoshow; print ''; } - if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1; } print ''; @@ -469,7 +465,7 @@ if ($id) print ''; // Line to enter new values - print ""; + print ''; $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. @@ -570,7 +566,7 @@ if ($id) print ' '; } else { $tmpaction = 'view'; - $parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); + $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook = $hookmanager->executeHooks('viewWebsiteFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors;