#7950 Fixed last_contact

This commit is contained in:
Daniel Maya 2021-09-02 16:12:46 +02:00
parent a2ef804cec
commit 5bf70f876c
2 changed files with 35 additions and 3 deletions

View File

@ -3964,6 +3964,7 @@ function html_print_image(
'onkeypress',
'onkeydown',
'onkeyup',
'onload',
'pos_tree',
];

View File

@ -13,9 +13,31 @@
// GNU General Public License for more details.
global $config;
// Login check
// Login check.
check_login();
?>
<script type="text/javascript">
function get_last_contact(source) {
var params = {};
params["get_last_contact"] = 1;
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
params["source"] = source;
jQuery.ajax ({
data: params,
dataType: "html",
type: "POST",
url: "ajax.php",
success: function (data) {
}
});
}
</script>
<?php
$agent_id = get_parameter_get('id_agente', 0);
$table = new stdClass();
@ -46,9 +68,18 @@ $logs = mysql_db_get_all_rows_sql($sql);
foreach ($logs as $log) {
$row['source'] = $log['source'];
$row['review'] = '<a href="javascript:void(0)">'.html_print_image('images/zoom.png', true, ['title' => __('Review in log viewer'), 'alt' => '', 'onclick' => "send_form('".$log['source'].'-'.$agent_id."')"]).'</a>';
$row['last_contact'] = human_time_comparation($log['last_contact']);
$row['last_contact'] = html_print_image(
'images/spinner.gif',
true,
[
'border' => '0',
'width' => '20px',
'heigth' => '20px',
'onload' => "get_last_contact('".$log['source']."')",
]
);
$table->data[] = $row;
$table->data[$log['source']] = $row;
}
ob_start();