Fixed visual bug in item names from report template

This commit is contained in:
manuel 2019-09-05 10:44:18 +02:00
parent a4739e4891
commit e4d014923b
2 changed files with 40 additions and 16 deletions

View File

@ -232,6 +232,8 @@ switch ($action) {
$style = json_decode(io_safe_output($item['style']), true); $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_same_row = $style['show_in_same_row'];
$show_in_landscape = $style['show_in_landscape']; $show_in_landscape = $style['show_in_landscape'];
$hide_notinit_agents = $style['hide_notinit_agents']; $hide_notinit_agents = $style['hide_notinit_agents'];
@ -868,18 +870,33 @@ $class = 'databox filters';
</td> </td>
<td style=""> <td style="">
<?php <?php
html_print_input_text( if ($name_from_template != '') {
'name', html_print_input_text(
$name, 'name',
'', $name_from_template,
80, '',
100, 80,
false, 100,
false, false,
false, false,
'', false,
'fullwidth' '',
); 'fullwidth'
);
} else {
html_print_input_text(
'name',
$name,
'',
80,
100,
false,
false,
false,
'',
'fullwidth'
);
}
?> ?>
</td> </td>
</tr> </tr>

View File

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