Merge branch 'ent-12566-mejoras-en-visualizacion-de-eventos' into 'develop'

Draft: Ent 12566 Mejoras en visualización de eventos

See merge request artica/pandorafms!6735
This commit is contained in:
Rafael Ameijeiras 2023-12-14 08:57:44 +00:00
commit e71a104e74
4 changed files with 111 additions and 43 deletions

View File

@ -6462,7 +6462,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

@ -7170,31 +7170,16 @@ function ui_print_comments($comment, $truncate_limit=255)
} }
// Only show the last comment. If commment its too long,the comment will short with ... // Only show the last comment. If commment its too long,the comment will short with ...
// If $config['prominent_time'] is timestamp the date show Month, day, hour and minutes. // Forced time commentary to use copact date for optimize space in table.
// Else show comments hours ago // Else show comments hours ago
if ($comment['action'] != 'Added comment') { if ($comment['action'] != 'Added comment') {
$comment['comment'] = $comment['action']; $comment['comment'] = $comment['action'];
} }
$comment['comment'] = io_safe_output($comment['comment']);
$short_comment = substr($comment['comment'], 0, 20); $short_comment = substr($comment['comment'], 0, 20);
if ($config['prominent_time'] == 'timestamp') { $comentario = $comment['comment'];
$comentario = '<i>'.date($config['date_format'], $comment['utimestamp']).'&nbsp;('.$comment['id_user'].'):&nbsp;'.$comment['comment'].'';
if (strlen($comentario) > '200px' && $truncate_limit >= 255) {
$comentario = '<i>'.date($config['date_format'], $comment['utimestamp']).'&nbsp;('.$comment['id_user'].'):&nbsp;'.$short_comment.'...';
}
} else {
$rest_time = (time() - $comment['utimestamp']);
$time_last = (($rest_time / 60) / 60);
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], ($config['thousand_separator'] ?? ',')).'&nbsp; Hours &nbsp;('.$comment['id_user'].'):&nbsp;'.$comment['comment'].'';
if (strlen($comentario) > '200px' && $truncate_limit >= 255) {
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], ($config['thousand_separator'] ?? ',')).'&nbsp; Hours &nbsp;('.$comment['id_user'].'):&nbsp;'.$short_comment.'...';
}
}
$comentario = io_safe_output($comentario);
if (strlen($comentario) >= $truncate_limit) { if (strlen($comentario) >= $truncate_limit) {
$comentario = ui_print_truncate_text( $comentario = ui_print_truncate_text(
@ -7209,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,35 @@ 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;
}
.info_table.events tr > td span:not(.invisible) {
display: block;
overflow: hidden;
text-overflow: ellipsis;
max-height: 6em;
line-height: 1.5em;
}
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

@ -547,6 +547,45 @@ if (is_ajax() === true) {
); );
} }
if (empty($tmp->tags) === false) {
$tmp->tags = ui_print_truncate_text(
$tmp->tags,
30,
false,
true,
false,
'&hellip;',
true,
true,
);
}
if (empty($tmp->event_custom_id) === false) {
$tmp->event_custom_id = ui_print_truncate_text(
$tmp->event_custom_id,
30,
false,
true,
false,
'&hellip;',
true,
true,
);
}
if (empty($tmp->module_custom_id) === false) {
$tmp->module_custom_id = ui_print_truncate_text(
$tmp->module_custom_id,
30,
false,
true,
false,
'&hellip;',
true,
true,
);
}
if (empty($tmp->comments) === false) { if (empty($tmp->comments) === false) {
$tmp->comments = ui_print_comments($tmp->comments, 20); $tmp->comments = ui_print_comments($tmp->comments, 20);
} }
@ -887,14 +926,14 @@ if (is_ajax() === true) {
true, true,
[ [
'title' => __('Unknown'), 'title' => __('Unknown'),
'class' => 'forced-title', 'class' => 'forced-title main_menu_icon',
] ]
); );
$state = 0; $state = 0;
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>';
@ -1187,10 +1226,10 @@ if (is_ajax() === true) {
} }
$tmp->custom_data = $custom_data_str; $tmp->custom_data = $custom_data_str;
if (strlen($tmp->custom_data) >= 20) { if (strlen($tmp->custom_data) >= 50) {
$tmp->custom_data = ui_print_truncate_text( $tmp->custom_data = ui_print_truncate_text(
$tmp->custom_data, $tmp->custom_data,
20, 50,
false, false,
true, true,
false, false,
@ -1220,15 +1259,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(
[ [
@ -2573,7 +2615,7 @@ try {
if ($evento_id !== false) { if ($evento_id !== false) {
$fields[$evento_id] = [ $fields[$evento_id] = [
'text' => 'evento', 'text' => 'evento',
'class' => 'mw250px', 'class' => 'mw180px',
]; ];
} }
@ -2582,23 +2624,24 @@ try {
$fields[$comment_id] = ['text' => 'user_comment']; $fields[$comment_id] = ['text' => 'user_comment'];
} }
$estado = array_search('estado', $fields);
foreach ($fields as $key => $field) { if ($estado !== false) {
if (is_array($field) === false) { $fields[$estado] = [
$fields[$key] = [ 'text' => $fields[$estado],
'text' => $field, 'class' => 'column-estado',
'class' => 'mw100px', ];
];
}
} }
// Always add options column. // Always add options column.
$fields = array_merge( $fields = array_merge(
$fields, $fields,
[ [
[ [
'text' => 'options', 'text' => 'options',
'class' => 'table_action_buttons mw120px', 'class' => 'table_action_buttons mw100px',
], ],
[ [
'text' => 'm', 'text' => 'm',