Fix css for etrafields text

This commit is contained in:
Laurent Destailleur 2024-07-15 18:50:26 +02:00
parent fcd2aeb026
commit 78ac402856
4 changed files with 16 additions and 4 deletions

View file

@ -1789,6 +1789,8 @@ class ExtraFields
$langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key];
$list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2');
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$cssview = $this->attributes[$extrafieldsobjectkey]['cssview'][$key];
$hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
if ($hidden) {
@ -2116,7 +2118,7 @@ class ExtraFields
$value = '';
}
} elseif ($type == 'text') {
$value = dol_htmlentitiesbr($value);
$value = '<div class="'.($cssview ? $cssview : 'shortmessagecut').'">'.dol_htmlentitiesbr($value).'</div>';
} elseif ($type == 'html') {
$value = dol_htmlentitiesbr($value);
} elseif ($type == 'password') {
@ -2143,8 +2145,6 @@ class ExtraFields
*/
public function getAlignFlag($key, $extrafieldsobjectkey = '')
{
global $conf, $langs;
$type = 'varchar';
if (!empty($extrafieldsobjectkey)) {
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];

View file

@ -2421,7 +2421,7 @@ CssOnEdit=CSS on edit pages
CssOnView=CSS on view pages
CssOnList=CSS on lists
HelpCssOnEditDesc=The CSS used when editing the field.<br>Example: "minwiwdth100 maxwidth500 widthcentpercentminusx"
HelpCssOnViewDesc=The CSS used when viewing the field.
HelpCssOnViewDesc=The CSS used when viewing the field.<br>Example: "longmessagecut"
HelpCssOnListDesc=The CSS used when field is inside a list table.<br>Example: "tdoverflowmax200"
RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents for receptions
MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions

View file

@ -1071,6 +1071,12 @@ td.wordbreak img, td.wordbreakimp img {
.text-warning{
color : <?php print $textWarning; ?>
}
/* CSS used for extrafield text */
.shortmessagecut {
max-height: 125px;
max-width: 100%;
overflow-y: auto;
}
.longmessagecut {
max-height: 250px;
max-width: 100%;

View file

@ -1256,6 +1256,12 @@ td.wordbreak img, td.wordbreakimp img {
.text-warning{
color : <?php print $textWarning; ?>
}
/* CSS used for extrafield text */
.shortmessagecut {
max-height: 125px;
max-width: 100%;
overflow-y: auto;
}
.longmessagecut {
max-height: 250px;
max-width: 100%;