#12566 changes in view events

This commit is contained in:
Daniel Cebrian 2023-12-11 17:01:40 +01:00
parent ea474ecd89
commit 1a9bdf97d1
4 changed files with 57 additions and 17 deletions

View File

@ -6420,7 +6420,12 @@ function event_print_graph(
$color[] = '#82b92f'; $color[] = '#82b92f';
} }
} else { } else {
$interval_length = (int) ($period / $num_intervals); if ($num_intervals > 0) {
$interval_length = (int) ($period / $num_intervals);
} else {
$interval_length = 0;
}
$intervals = []; $intervals = [];
$intervals[0] = $start_utimestamp; $intervals[0] = $start_utimestamp;
for ($i = 0; $i < $num_intervals; $i++) { for ($i = 0; $i < $num_intervals; $i++) {

View File

@ -7179,11 +7179,7 @@ function ui_print_comments($comment, $truncate_limit=255)
$comment['comment'] = io_safe_output($comment['comment']); $comment['comment'] = io_safe_output($comment['comment']);
$short_comment = substr($comment['comment'], 0, 20); $short_comment = substr($comment['comment'], 0, 20);
$comentario = '<i>'.ui_print_timestamp($comment['utimestamp'], true, ['style' => 'font-size: 10px', 'prominent' => 'compact']).'&nbsp;('.$comment['id_user'].'):&nbsp;'.$comment['comment'].''; $comentario = $comment['comment'];
if (strlen($comentario) > '200px' && $truncate_limit >= 255) {
$comentario = '<i>'.ui_print_timestamp($comment['utimestamp'], true, ['style' => 'font-size: 10px', 'prominent' => 'compact']).'&nbsp;('.$comment['id_user'].'):&nbsp;'.$short_comment.'...';
}
if (strlen($comentario) >= $truncate_limit) { if (strlen($comentario) >= $truncate_limit) {
$comentario = ui_print_truncate_text( $comentario = ui_print_truncate_text(
@ -7198,6 +7194,12 @@ function ui_print_comments($comment, $truncate_limit=255)
); );
} }
$comentario = '<i class="forced_title" data-use_title_for_force_title="1" data-title="'.date($config['date_format'], $comment['utimestamp']).'">'.ui_print_timestamp($comment['utimestamp'], true, ['style' => 'font-size: 10px; display: contents;', 'prominent' => 'compact']).'&nbsp;('.$comment['id_user'].'):&nbsp;'.$comment['comment'].'';
if (strlen($comentario) > '200px' && $truncate_limit >= 255) {
$comentario = '<i class="forced_title" data-use_title_for_force_title="1" data-title="'.date($config['date_format'], $comment['utimestamp']).'">'.ui_print_timestamp($comment['utimestamp'], true, ['style' => 'font-size: 10px; display: contents;', 'prominent' => 'compact']).'&nbsp;('.$comment['id_user'].'):&nbsp;'.$short_comment.'...';
}
return $comentario; return $comentario;
} }

View File

@ -108,6 +108,27 @@ td > input[id^="checkbox-multi"] {
height: 2.5em; height: 2.5em;
} }
.info_table.events tr > td span:not(.invisible) {
display: block;
overflow: hidden;
text-overflow: ellipsis;
max-height: 6em;
line-height: 2em;
}
th.column-estado {
padding: 0px 0px 0px 12px !important;
max-width: fit-content;
}
.content-status {
margin: 0 auto;
max-width: fit-content;
}
table#table_events > tbody > tr > td.column-estado {
padding: 0px !important;
text-align: center;
}
.sorting_desc { .sorting_desc {
background: url(../../images/sort_down_green.png) no-repeat; background: url(../../images/sort_down_green.png) no-repeat;
background-position-x: left; background-position-x: left;

View File

@ -906,7 +906,7 @@ if (is_ajax() === true) {
break; break;
} }
$draw_state = '<div class="mrgn_lft_17px">'; $draw_state = '<div class="content-status">';
$draw_state .= '<span class="invisible">'; $draw_state .= '<span class="invisible">';
$draw_state .= $state; $draw_state .= $state;
$draw_state .= '</span>'; $draw_state .= '</span>';
@ -1232,15 +1232,18 @@ if (is_ajax() === true) {
); );
} }
$data = array_values( if (isset($data) === true) {
array_filter( $data = array_values(
$data, array_filter(
function ($item) { $data,
return (bool) (array) $item; function ($item) {
} return (bool) (array) $item;
) }
); )
$count = count($data); );
$count = count($data);
}
// RecordsTotal && recordsfiltered resultados totales. // RecordsTotal && recordsfiltered resultados totales.
echo json_encode( echo json_encode(
[ [
@ -2585,7 +2588,7 @@ try {
if ($evento_id !== false) { if ($evento_id !== false) {
$fields[$evento_id] = [ $fields[$evento_id] = [
'text' => 'evento', 'text' => 'evento',
'class' => 'mw250px', 'class' => 'mw180px',
]; ];
} }
@ -2594,6 +2597,15 @@ try {
$fields[$comment_id] = ['text' => 'user_comment']; $fields[$comment_id] = ['text' => 'user_comment'];
} }
$estado = array_search('estado', $fields);
if ($estado !== false) {
$fields[$estado] = [
'text' => $fields[$estado],
'class' => 'column-estado',
];
}
// Always add options column. // Always add options column.