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;
// 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);
$count = 0;
// Add extrafields
if (!empty($extrafields->attributes[$this->table_element]['label'])) {
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
if ($count >= $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) {
$datas['more_extrafields'] = '<br>.../...';
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
continue;
}
if ($count >= abs($MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP)) {
$datas['more_extrafields'] = '<br>...';
break;
}
$enabled = 1;

View File

@ -8785,13 +8785,13 @@ class Form
}
/**
* Render list of categories linked to object with id $id and type $type
* Render list of categories linked to object with id $id and type $type
*
* @param int $id Id of object
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated.
* @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended)
* @param int $nolink 1=Do not add html links
* @return string String with categories
* @param int $id Id of object
* @param string $type Type of category ('member', 'customer', 'supplier', 'product', 'contact'). Old mode (0, 1, 2, ...) is deprecated.
* @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended)
* @param int $nolink 1=Do not add html links
* @return string String with categories
*/
public function showCategories($id, $type, $rendermode = 0, $nolink = 0)
{

View File

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