Merge branch 'ent-4578-No-se-registran-los-nombres-de-los-items-text-en-reports' into 'develop'

Fixed visual bug in item names from report template

See merge request artica/pandorafms!2707
This commit is contained in:
Daniel Rodriguez 2019-10-03 17:35:03 +02:00
commit 6802b32d93
2 changed files with 40 additions and 16 deletions

View File

@ -233,6 +233,8 @@ switch ($action) {
$style = json_decode(io_safe_output($item['style']), true);
$name_from_template = $style['name_label'];
$show_in_same_row = $style['show_in_same_row'];
$show_in_landscape = $style['show_in_landscape'];
$hide_notinit_agents = $style['hide_notinit_agents'];
@ -869,18 +871,33 @@ $class = 'databox filters';
</td>
<td style="">
<?php
html_print_input_text(
'name',
$name,
'',
80,
100,
false,
false,
false,
'',
'fullwidth'
);
if ($name_from_template != '') {
html_print_input_text(
'name',
$name_from_template,
'',
80,
100,
false,
false,
false,
'',
'fullwidth'
);
} else {
html_print_input_text(
'name',
$name,
'',
80,
100,
false,
false,
false,
'',
'fullwidth'
);
}
?>
</td>
</tr>

View File

@ -489,11 +489,18 @@ foreach ($items as $item) {
$row[4] = '-';
}
if ($item['name'] == '' && $item['description'] == '') {
$row[5] = '-';
} else {
$text = empty($item['name']) ? $item['description'] : $item['name'];
$style = json_decode(io_safe_output($item['style']), true);
if ($style['name_label'] != '') {
$text = empty($style['name_label']) ? $item['description'] : $style['name_label'];
$row[5] = ui_print_truncate_text($text, 'description', true, true);
} else {
if ($item['name'] == '' && $item['description'] == '') {
$row[5] = '-';
} else {
$text = empty($item['name']) ? $item['description'] : $item['name'];
$row[5] = ui_print_truncate_text($text, 'description', true, true);
}
}
$row[6] = '';