Fix timeline log operazioni

This commit is contained in:
pek5892 2024-05-21 17:43:53 +02:00
parent 6609d71b10
commit fe8635b33f
1 changed files with 15 additions and 32 deletions

View File

@ -315,19 +315,16 @@ if (empty($record) || !$has_access) {
// Informazioni sulle operazioni // Informazioni sulle operazioni
if (Auth::admin()) { if (Auth::admin()) {
echo ' echo '
<div id="tab_info" class="tab-pane">'; <div id="tab_info" class="tab-pane">
<div class="timeline">';
$operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` LEFT JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` DESC LIMIT 200'); $operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` LEFT JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` DESC LIMIT 200');
if (!empty($operations)) { if (!empty($operations)) {
echo '
<ul class="timeline">';
foreach ($operations as $operation) { foreach ($operations as $operation) {
$description = $operation['op']; $description = $operation['op'];
$icon = 'pencil-square-o'; $icon = 'pencil-square-o';
$color = null; $color = 'warning';
$timeline_class = null;
switch ($operation['op']) { switch ($operation['op']) {
case 'add': case 'add':
@ -353,39 +350,25 @@ if (empty($record) || !$has_access) {
$icon = 'clone'; $icon = 'clone';
$color = 'info'; $color = 'info';
break; break;
default:
$timeline_class = ' class="timeline-inverted"';
break;
} }
echo ' echo '
<li '.$timeline_class.'> <div>
<div class="timeline-badge '.$color.'"><i class="fa fa-'.$icon.'"></i></div> <i class="fa fa-'.$icon.' bg-'.$color.'"></i>
<div class="timeline-panel"> <div class="timeline-item">
<div class="timeline-heading"> <span class="time"><i class="fa fa-clock-o"></i> '.Carbon::parse($operation['created_at'])->diffForHumans().'</small></span>
<div class="row"> <h4 class="timeline-header">'.$description.'</h4>
<div class="col-md-8">
<h4 class="timeline-title">'.$description.'</h4>
</div>
<div class="col-md-4 text-right">
<p><span class="right badge badge-default tip" title="'.Translator::timestampToLocale($operation['created_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($operation['created_at'])->diffForHumans().'</small></p>
<p><span class="right badge badge-default"><i class="fa fa-user"></i> '.$operation['username'].'</small></p>
</div>
</div>
</div>
<div class="timeline-body"> <div class="timeline-body">
<span class="badge badge-default"><i class="fa fa-user"></i> '.$operation['username'].'
</div>
<div class="timeline-footer">
</div> </div>
</div> </div>
</li>'; </div>';
} }
echo'
echo ' <div>
</ul>'; <i class="fa fa-clock-o bg-gray"></i>
</div>
</div>';
} else { } else {
echo ' echo '
<div class="alert alert-info"> <div class="alert alert-info">