diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 81167eebc5e..d42f67f075a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1969,7 +1969,7 @@ class Adherent extends CommonObject $this->fullname=$this->getFullName($langs); // For avoid ldap error when firstname and lastname are empty - if ($this->morphy == 'mor' && empty($this->fullname)) { + if ($this->morphy == 'mor' && (empty($this->fullname) || $this->fullname == $this->societe)) { $this->fullname = $this->societe; $this->lastname = $this->societe; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7f73630f7f6..4138607de28 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5620,7 +5620,7 @@ abstract class CommonObject foreach($extrafields->attribute_label as $key=>$label) { if (empty($extrafields->attribute_list[$key])) continue; // 0 = Never visible field - if (($mode == 'create' || $mode == 'edit') && abs($extrafields->attribute_list[$key]) != 1) continue; // <> -1 and <> 1 = not visible on forms, only on list + if (($mode == 'create' || $mode == 'edit') && abs($extrafields->attribute_list[$key]) != 1 && abs($extrafields->attribute_list[$key]) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list // Load language if required if (! empty($extrafields->attributes[$this->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index b57025e3dd6..589a7b56e0e 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -43,7 +43,8 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][ foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { // Discard if extrafield is a hidden field on form - if (abs($extrafields->attributes[$object->table_element]['list'][$key]) != 1) continue; + if (empty($extrafields->attributes[$object->table_element]['list'][$key])) continue; // 0 = Never visible field + if (abs($extrafields->attributes[$object->table_element]['list'][$key]) != 1 && abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list // Load language if required if (! empty($extrafields->attributes[$object->table_element]['langfile'][$key])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$key]);