Merge branch 'ent-2105-internal-audit-view-improvements' into 'develop'

Corrección de errores

See merge request artica/pandorafms!1488
This commit is contained in:
vgilc 2018-05-21 17:53:07 +02:00
commit a075d5ff8f
2 changed files with 17 additions and 13 deletions

View File

@ -29,8 +29,6 @@ if (! check_acl($config['id_user'], 0, "PM")) {
exit;
}
ui_print_page_header(__('Pandora audit') . " » " . __('Review Logs'), "images/gm_log.png", false, "", true);
$offset = (int) get_parameter("offset");
$filter_type = (string) get_parameter("filter_type");
$filter_user = (string) get_parameter("filter_user");
@ -45,6 +43,19 @@ $filter_query = "&filter_type=" . $filter_type
. "&filter_period=" . $filter_period
. "&filter_ip=" . $filter_ip;
$csv_url = ui_get_full_url(false, false, false, false)
. 'index.php?sec=gextensions&sec2=godmode/audit_log_csv'
. $filter_query;
$csv_img = html_print_image("images/csv_mc.png", true, array ("title" => __('Export to CSV')));
$header_buttons = array(
'csv' => array(
'active' => false,
'text' => '<a href="' . $csv_url . '">' . $csv_img . '</a>'
)
);
ui_print_page_header(__('Pandora audit') . " &raquo; " . __('Review Logs'), "images/gm_log.png", false, "", true, $header_buttons);
$table = new stdClass();
$table->class = "databox filters";
$table->cellstyle = array();
@ -108,11 +119,11 @@ if (!empty($filter_user)) {
}
if (!empty($filter_text)) {
$filter .= " AND (accion LIKE '%'" . $filter_text . "'%' OR descripcion LIKE '%'" . $filter_text . "'%')";
$filter .= sprintf(" AND (accion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%')", $filter_text, $filter_text);
}
if (!empty($filter_ip)) {
$filter .= sprintf(" AND ip_origen LIKE '%'", $filter_ip);
$filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $filter_ip);
}
if (!empty($filter_period)) {
@ -239,13 +250,6 @@ foreach ($result as $row) {
html_print_table($table);
echo '<div style="width: '.$table->width.'" class="action-buttons">';
$csv_url = ui_get_full_url(false, false, false, false) . 'index.php?sec=gextensions&sec2=godmode/audit_log_csv' . $filter_query;
echo '<a href="' . $csv_url . '">'
. html_print_button(__("Export to CSV"), "export_csv", false, "", "class=sub upd", true, false)
. '</a>';
echo '</div>';
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
enterprise_hook('enterpriseAuditFooter');
}

View File

@ -59,11 +59,11 @@ if (!empty($filter_user)) {
}
if (!empty($filter_text)) {
$filter .= " AND (accion LIKE '%'" . $filter_text . "'%' OR descripcion LIKE '%'" . $filter_text . "'%')";
$filter .= sprintf(" AND (accion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%')", $filter_text, $filter_text);
}
if (!empty($filter_ip)) {
$filter .= sprintf(" AND ip_origen LIKE '%'", $filter_ip);
$filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $filter_ip);
}
if (!empty($filter_period)) {