From 6a93b4d554935df55215352c0547fa45c80ad89f Mon Sep 17 00:00:00 2001 From: "edu.corral" Date: Fri, 23 Sep 2022 11:35:17 +0200 Subject: [PATCH] ent 9303 audit log extended info --- .../include/class/AuditLog.class.php | 65 +++++++++---------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/pandora_console/include/class/AuditLog.class.php b/pandora_console/include/class/AuditLog.class.php index b01e494101..0fa0e62cb1 100644 --- a/pandora_console/include/class/AuditLog.class.php +++ b/pandora_console/include/class/AuditLog.class.php @@ -44,7 +44,7 @@ class AuditLog extends HTML * * @var array */ - public $AJAXMethods = [ 'draw' ]; + public $AJAXMethods = ['draw']; /** * Ajax page. @@ -78,7 +78,6 @@ class AuditLog extends HTML // Set the ajax controller. $this->ajaxController = $ajaxController; - } @@ -232,7 +231,6 @@ class AuditLog extends HTML // Load own javascript file. echo $this->loadJS(); - } @@ -368,39 +366,38 @@ class AuditLog extends HTML // Javascript content. ?> - + + return output; + } + + $(document).ready(function() { + // Add event listener for opening and closing details + $('#audit_logs tbody').on('click', 'td.show_extended_info', function() { + var tr = $(this).closest('tr'); + var table = $("#tableId; ?>").DataTable(); + var row = table.row(tr); + + if (row.child.isShown()) { + // This row is already open - close it + row.child.hide(); + tr.removeClass('shown'); + } else { + // Open this row + row.child(format(row.data())).show(); + tr.addClass('shown'); + } + }); + }); +