Remove separator from extrafields in popup

This commit is contained in:
Laurent Destailleur 2023-04-29 20:04:51 +02:00
parent a8522f15b3
commit 404940a14e
3 changed files with 20 additions and 9 deletions

View File

@ -742,15 +742,19 @@ abstract class CommonObject
global $action, $extrafields, $langs, $hookmanager; global $action, $extrafields, $langs, $hookmanager;
// If there is too much extrafields, we do not include them into tooltip // If there is too much extrafields, we do not include them into tooltip
$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', 3);
$datas = $this->getTooltipContentArray($params); $datas = $this->getTooltipContentArray($params);
$count = 0; $count = 0;
// Add extrafields // Add extrafields
if (!empty($extrafields->attributes[$this->table_element]['label'])) { if (!empty($extrafields->attributes[$this->table_element]['label'])) {
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 ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
$datas['more_extrafields'] = '<br>.../...'; continue;
}
if ($count >= abs($MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP)) {
$datas['more_extrafields'] = '<br>...';
break; break;
} }
$enabled = 1; $enabled = 1;

View File

@ -520,6 +520,7 @@ if ($id > 0 || !empty($ref)) {
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
$numline = 1;
if ($num) { if ($num) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -714,6 +715,7 @@ if ($id > 0 || !empty($ref)) {
print '</tr>'; print '</tr>';
print '<!-- line for batch '.$numline.' -->';
print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'" data-remove="clear">'; print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'" data-remove="clear">';
print '<td>'; print '<td>';
print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">'; print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';
@ -772,6 +774,7 @@ if ($id > 0 || !empty($ref)) {
print '</tr>'; print '</tr>';
print '<!-- line no batch '.$numline.' -->';
print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'" data-remove="clear">'; print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'" data-remove="clear">';
print '<td colspan="'.$colspan.'">'; print '<td colspan="'.$colspan.'">';
print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">'; print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';
@ -854,6 +857,8 @@ if ($id > 0 || !empty($ref)) {
print "</tr>\n"; print "</tr>\n";
$j++; $j++;
$numline++;
} }
$suffix = "_".$j."_".$i; $suffix = "_".$j."_".$i;
} }
@ -882,6 +887,7 @@ if ($id > 0 || !empty($ref)) {
print '</tr>'; print '</tr>';
print '<!-- line for batch '.$numline.' (not dispatched line yet for this order line) -->';
print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'">'; print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'">';
print '<td>'; print '<td>';
print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">'; print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';
@ -940,6 +946,7 @@ if ($id > 0 || !empty($ref)) {
print '</tr>'; print '</tr>';
print '<!-- line no batch '.$numline.' (not dispatched line yet for this order line) -->';
print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'" data-remove="clear">'; print '<tr class="oddeven autoresettr" name="'.$type.$suffix.'" data-remove="clear">';
print '<td colspan="'.$colspan.'">'; print '<td colspan="'.$colspan.'">';
print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">'; print '<input id="fk_commandefourndet'.$suffix.'" name="fk_commandefourndet'.$suffix.'" type="hidden" value="'.$objp->rowid.'">';