Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2017-11-11 18:23:08 +01:00
commit 3b4cbf54d7
3 changed files with 4 additions and 3 deletions

View File

@ -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;
}

View File

@ -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]);

View File

@ -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]);