diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f2b173f60585c..a85fbb38bd43e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8232,7 +8232,8 @@ public function showOptionals($extrafields, $mode = 'view', $params = null, $key // Output value of the current field if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { - $extrafields_collapse_num = ''; + $extrafields_collapse_num = $key; + /* $extrafield_param = $extrafields->attributes[$this->table_element]['param'][$key]; if (!empty($extrafield_param) && is_array($extrafield_param)) { $extrafield_param_list = array_keys($extrafield_param['options']); @@ -8245,10 +8246,15 @@ public function showOptionals($extrafields, $mode = 'view', $params = null, $key } } } + */ // if colspan=0 or 1, the second column is not extended, so the separator must be on 2 columns $out .= $extrafields->showSeparator($key, $this, ($colspan ? $colspan + 1 : 2), $display_type, $mode); + + $lastseparatorkeyfound = $key; } else { + $collapse_group = $extrafields_collapse_num.(!empty($this->id) ? '_'.$this->id : ''); + $class = (!empty($extrafields->attributes[$this->table_element]['hidden'][$key]) ? 'hideobject ' : ''); $csstyle = ''; if (is_array($params) && count($params) > 0) { @@ -8319,13 +8325,13 @@ public function showOptionals($extrafields, $mode = 'view', $params = null, $key $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); if ($display_type == 'card') { - $out .= '