Update commonobject.class.php
This commit is contained in:
parent
8cb877c118
commit
a93cb8b572
@ -735,21 +735,24 @@ abstract class CommonObject
|
|||||||
$MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = getDolGlobalInt('MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP', 5);
|
$MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = getDolGlobalInt('MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP', 5);
|
||||||
|
|
||||||
$datas = $this->getTooltipContentArray($params);
|
$datas = $this->getTooltipContentArray($params);
|
||||||
|
$count = 0;
|
||||||
// Add extrafields
|
// Add extrafields
|
||||||
if (!empty($extrafields->attributes[$this->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$this->table_element]['label'])) {
|
||||||
if ($extrafields->attributes[$this->table_element]['count'] < $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) {
|
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
|
||||||
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
|
if ($count >= $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) {
|
||||||
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) {
|
$datas['more_extrafields'] = '<br>.../...';
|
||||||
$langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
break;
|
||||||
}
|
}
|
||||||
$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
|
if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) {
|
||||||
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
|
$langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]);
|
||||||
$datas[$key]= '<br><b><u>'. $labelextra . '</u></b>';
|
}
|
||||||
} else {
|
$labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]);
|
||||||
$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
|
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
|
||||||
$datas[$key]= '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
|
$datas[$key]= '<br><b><u>'. $labelextra . '</u></b>';
|
||||||
}
|
} else {
|
||||||
|
$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
|
||||||
|
$datas[$key]= '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
|
||||||
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user