diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index b95bed4d02e..9d992c7d953 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -43,7 +43,7 @@ if (!$user->admin) { $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html. -if ($action == 'test' || ($action == 'send' && $trackid = 'test')) { +if ($action == 'test' || ($action == 'send' && $trackid == 'test')) { $usersignature = dol_string_nohtmltag($usersignature, 2); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 355a6dc7684..055a24ac5fd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8210,6 +8210,10 @@ abstract class CommonObject if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) { continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list } elseif (($mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3 && abs($visibility) != 4) { + // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost + $ef_name = 'options_' . $key; + $ef_value = $this->array_options[$ef_name]; + $out .= '' . "\n"; continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation } elseif ($mode == 'view' && empty($visibility)) { continue; diff --git a/htdocs/core/tpl/extrafields_list_search_param.tpl.php b/htdocs/core/tpl/extrafields_list_search_param.tpl.php index 2ab5749b4e0..da123939c68 100644 --- a/htdocs/core/tpl/extrafields_list_search_param.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_param.tpl.php @@ -37,6 +37,16 @@ if (!empty($search_array_options) && is_array($search_array_options)) { // $extr $param .= '&'.$search_options_pattern.$tmpkey.'[]='.urlencode($val2); } } else { + // test if we have checkbox type, we add the _multiselect needed into param + $tmpkey = preg_replace('/'.$search_options_pattern.'/', '', $key); + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('checkbox', 'chkbxlst'))) { + $param .= '&'.$search_options_pattern.$tmpkey.'_multiselect='.urlencode($val); + } + // test if we have boolean type, we add the _booleand needed into param + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('boolean'))) { + $param .= '&'.$search_options_pattern.$tmpkey.'_boolean='.urlencode($val); + } + $param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val); } }