Merge remote-tracking branch 'origin/develop' into visual-console-refactor

Former-commit-id: 6cffccf44d4bf8c5b87c5c5f112d814c796645c6
This commit is contained in:
Alejandro Gallardo Escobar 2019-04-24 17:05:20 +02:00
commit c1272035cc
157 changed files with 3881 additions and 1821 deletions

View File

@ -11,16 +11,16 @@ echo "Creating RPM packages in $RPMHOME/RPMS"
rpmbuild -ba $CODEHOME/pandora_console/pandora_console.rhel7.spec || exit 1 rpmbuild -ba $CODEHOME/pandora_console/pandora_console.rhel7.spec || exit 1
# Server # Server
rpmbuild -ba $CODEHOME/pandora_server/pandora_server.rhel7.spec || exit 1 #rpmbuild -ba $CODEHOME/pandora_server/pandora_server.rhel7.spec || exit 1
# Unix agent # Unix agent
rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.rhel7.spec || exit 1 #rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.rhel7.spec || exit 1
# Enterprise console # Enterprise console
rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec || exit 1 rpmbuild -ba $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec || exit 1
# Enterprise server # Enterprise server
rpmbuild -ba $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.rhel7.spec || exit 1 #rpmbuild -ba $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.rhel7.spec || exit 1
exit 0 exit 0

View File

@ -30,6 +30,7 @@ $CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \ $CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \ $CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.redhat.spec \ $PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.redhat.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.redhat.spec" $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.redhat.spec"
DEBIAN_FILES="$CODEHOME/pandora_console/DEBIAN \ DEBIAN_FILES="$CODEHOME/pandora_console/DEBIAN \
$CODEHOME/pandora_server/DEBIAN \ $CODEHOME/pandora_server/DEBIAN \

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, AIX version # Version 7.0NG.734, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, FreeBSD Version # Version 7.0NG.734, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, HP-UX Version # Version 7.0NG.734, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, GNU/Linux # Version 7.0NG.734, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, GNU/Linux # Version 7.0NG.734, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, Solaris Version # Version 7.0NG.734, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2010 Artica Soluciones Tecnologicas # (c) 2006-2010 Artica Soluciones Tecnologicas
# Version 7.0NG.733 # Version 7.0NG.734
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.733, AIX version # Version 7.0NG.734, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.733 # Version 7.0NG.734
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.733, HPUX Version # Version 7.0NG.734, HPUX Version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733 # Version 7.0NG.734
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2010 Artica Soluciones Tecnologicas # (c) 2003-2010 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733 # Version 7.0NG.734
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2009 Artica Soluciones Tecnologicas # (c) 2003-2009 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733 # Version 7.0NG.734
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.733, Solaris version # Version 7.0NG.734, Solaris version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, AIX version # Version 7.0NG.734, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.733-190412 Version: 7.0NG.734
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.733-190412" pandora_version="7.0NG.734"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, GNU/Linux # Version 7.0NG.734, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, FreeBSD Version # Version 7.0NG.734, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, HP-UX Version # Version 7.0NG.734, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, GNU/Linux # Version 7.0NG.734, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, GNU/Linux # Version 7.0NG.734, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, NetBSD Version # Version 7.0NG.734, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.733, Solaris Version # Version 7.0NG.734, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -41,8 +41,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.733'; use constant AGENT_VERSION => '7.0NG.734';
use constant AGENT_BUILD => '190412'; use constant AGENT_BUILD => '190424';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1075,6 +1075,10 @@ sub send_buffered_xml_files ($;$) {
unlink ("$temporal_file/$xml_file"); unlink ("$temporal_file/$xml_file");
} }
} }
# Do not get stuck trying to send buffered XML files to a secondary server.
elsif ($flag_always == 2) {
last;
}
} }
if (defined($flag_always) && ($flag_always == 2)){ if (defined($flag_always) && ($flag_always == 2)){
swap_servers (); swap_servers ();

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.733 %define version 7.0NG.734
%define release 190412 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.733 %define version 7.0NG.734
%define release 190412 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.733" PI_VERSION="7.0NG.734"
PI_BUILD="190412" PI_BUILD="190424"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2017 Artica Soluciones Tecnologicas # (c) 2006-2017 Artica Soluciones Tecnologicas
# Version 7.0NG.733 # Version 7.0NG.734
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.733} {Pandora FMS Windows Agent v7.0NG.734}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190412} {190424}
ViewReadme ViewReadme
{Yes} {Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No} {No}
Windows,Executable Windows,Executable
{<%AppName%>-<%Version%>-Setup<%Ext%>} {<%AppName%>-Setup<%Ext%>}
Windows,FileDescription Windows,FileDescription
{<%AppName%> <%Version%> Setup} {<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.733(Build 190412)") #define PANDORA_VERSION ("7.0NG.734(Build 190424)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.733(Build 190412))" VALUE "ProductVersion", "(7.0NG.734(Build 190424))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.733-190412 Version: 7.0NG.734
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.733-190412" pandora_version="7.0NG.734"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -378,7 +378,8 @@ function mainAgentsAlerts()
'alerts_agents' 'alerts_agents'
); );
echo '<table class="databox data" cellpadding="0" cellspacing="0" border="0" width=100%>'; echo '<table class="info_table" cellpadding="0" cellspacing="0" border="0" width=100%>';
echo '<thead><tr>';
echo "<th width='140px' >".__('Agents').' / '.__('Alert templates').'</th>'; echo "<th width='140px' >".__('Agents').' / '.__('Alert templates').'</th>';
if ($hor_offset > 0) { if ($hor_offset > 0) {
@ -421,9 +422,10 @@ function mainAgentsAlerts()
continue; continue;
} }
echo '<th width="20px" >'.io_safe_output($tname).html_print_image('images/information_alerts.png', true, ['title' => io_safe_output($tname), 'style' => 'margin-left:5px' ]).'</th>'; echo '<th width="20px" >'.io_safe_output($tname).'</th>';
} }
echo '</tr></thead>';
if (($hor_offset + $block) < $ntemplates) { if (($hor_offset + $block) < $ntemplates) {
$new_hor_offset = ($hor_offset + $block); $new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' style='' rowspan='".($nagents + 1)."'> echo "<th width='20px' style='' rowspan='".($nagents + 1)."'>
@ -455,7 +457,7 @@ function mainAgentsAlerts()
$cellstyle = 'background:'.COL_ALERTFIRED.';'; $cellstyle = 'background:'.COL_ALERTFIRED.';';
} }
echo '<td style=";'.$cellstyle.'"> '; echo '<td style=";'.$cellstyle.'" class="action_buttons"> ';
$uniqid = uniqid(); $uniqid = uniqid();
echo '<div>'; echo '<div>';
@ -478,6 +480,23 @@ function mainAgentsAlerts()
} }
echo '</table>'; echo '</table>';
ui_pagination(
$nagents,
false,
0,
0,
false,
'offset',
true,
'pagination-bottom',
'',
[
'count' => '',
'offset' => 'offset_param',
],
'alerts_agents'
);
} }
} }
@ -487,7 +506,7 @@ function mainAgentsAlerts()
function print_alerts_summary_modal_window($id, $alerts) function print_alerts_summary_modal_window($id, $alerts)
{ {
$table->width = '98%'; $table->width = '98%';
$table->class = 'databox'; $table->class = 'info_table';
$table->data = []; $table->data = [];
$table->head[0] = __('Module'); $table->head[0] = __('Module');

View File

@ -148,7 +148,7 @@ function dbmgr_extension_main()
echo "<div style='overflow: auto;'>"; echo "<div style='overflow: auto;'>";
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = array_keys($result[0]); $table->head = array_keys($result[0]);
$table->data = $result; $table->data = $result;

View File

@ -45,11 +45,9 @@ if (!empty($files)) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->style = []; $table->style = [];
$table->style[1] = 'max-width: 200px;'; $table->style[1] = 'max-width: 200px;';
$table->style[2] = 'text-align: center;';
$table->style[3] = 'text-align: center;';
$table->style[4] = 'text-align: center;'; $table->style[4] = 'text-align: center;';
$table->head = []; $table->head = [];
$table->head[0] = __('Name'); $table->head[0] = __('Name');
@ -81,6 +79,7 @@ if (!empty($files)) {
// Last modification // Last modification
// Public URL // Public URL
$data[4] = ''; $data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (!empty($file['hash'])) { if (!empty($file['hash'])) {
$public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']); $public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']);
$message = __('Copy to clipboard').': Ctrl+C -> Enter'; $message = __('Copy to clipboard').': Ctrl+C -> Enter';
@ -92,7 +91,7 @@ if (!empty($files)) {
} }
$data[4] .= "<a href=\"$url\" target=\"_blank\">"; $data[4] .= "<a href=\"$url\" target=\"_blank\">";
$data[4] .= html_print_image('images/download.png', true, ['title' => __('Download')]); $data[4] .= html_print_image('images/download.png', true, ['title' => __('Download'), 'style' => 'padding:3px' ]);
// Download image // Download image
$data[4] .= '</a>'; $data[4] .= '</a>';

View File

@ -66,10 +66,10 @@ function users_extension_main_god($god=true)
$rows = []; $rows = [];
echo "<div class='nf'>".__('No other users connected').'</div>'; echo "<div class='nf'>".__('No other users connected').'</div>';
} else { } else {
$table->cellpadding = 4; $table->cellpadding = 0;
$table->cellspacing = 4; $table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->size = []; $table->size = [];
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];

View File

@ -1,5 +1,7 @@
START TRANSACTION; START TRANSACTION;
ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0';
@ -37,4 +39,16 @@ ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DE
ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1'; ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1'; ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
ALTER TABLE `trecon_script` ADD COLUMN `type` int NOT NULL default 0;
ALTER TABLE `trecon_task` ADD COLUMN `type` int NOT NULL default 0;
UPDATE `trecon_script` SET `type` = 1 WHERE `name`="Discovery.Application.VMware";
UPDATE `trecon_script` SET `type` = 2 WHERE `name`="Discovery.Cloud";
UPDATE `trecon_script` SET `type` = 3 WHERE `name` LIKE "IPAM%Recon";
UPDATE `trecon_script` SET `type` = 4 WHERE `name` LIKE "IPMI%Recon";
UPDATE `trecon_task` SET `type`=3 WHERE `description`="Discovery.Application.VMware";
UPDATE `trecon_task` SET `type`=2 WHERE `description`="Discovery.Cloud";
UPDATE `trecon_task` SET `type`=7 WHERE `description`="Discovery.Cloud.RDS";
COMMIT; COMMIT;

View File

@ -2093,6 +2093,12 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT ''; ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
-- ----------------------------------------------------------------------
-- Add column in table `tnetflow_filter`
-- ----------------------------------------------------------------------
ALTER TABLE `tnetflow_filter` DROP COLUMN `output`;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Update table `tuser_task` -- Update table `tuser_task`
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------

View File

@ -284,7 +284,7 @@ if ($config['menu_type'] == 'classic') {
$header_support .= '</a></div>'; $header_support .= '</a></div>';
// Documentation. // Documentation.
$header_docu = '<div id="header_support">'; $header_docu = '<div id="header_docu">';
$header_docu .= '<a href="https://wiki.pandorafms.com/index.php?title=Main_Page" target="_blank">'; $header_docu .= '<a href="https://wiki.pandorafms.com/index.php?title=Main_Page" target="_blank">';
$header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']); $header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']);
$header_docu .= '</a></div>'; $header_docu .= '</a></div>';

View File

@ -272,7 +272,9 @@ if (!empty($all_data)) {
echo '<div id="activity">'; echo '<div id="activity">';
$table = new stdClass(); $table = new stdClass();
$table->class = 'databox data'; $table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
// Don't specify px. // Don't specify px.
$table->data = []; $table->data = [];

View File

@ -4,29 +4,35 @@
<style> <style>
#alert_messages_na{ #alert_messages_na{
-moz-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
z-index:2; z-index:2;
position:fixed; position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width:650px; width:650px;
height: 400px;
background:white; background:white;
background-image:url('images/imagen-no-acceso.jpg');
background-repeat:no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
} }
.modalheade{ .modalheade{
text-align:center; text-align:center;
width:100%; width:100%;
height:37px; position:absolute;
left:0px; top:0;
background-color:#82b92e;
} }
.modalheadertex{ .modalheadertex{
color:white; color:#000;
position:relative;
font-family:Nunito; font-family:Nunito;
font-size:13pt; line-height: 40px;
top:8px; font-size: 23pt;
margin-bottom:30px;
} }
.modalclose{ .modalclose{
cursor:pointer; cursor:pointer;
@ -37,50 +43,59 @@
} }
.modalconten{ .modalconten{
color:black; color:black;
background:white; width:300px;
}
.modalcontentim{
float:left;
margin-left: 30px; margin-left: 30px;
margin-top:30px;
margin-bottom:30px;
} }
.modalcontenttex{ .modalcontenttex{
float:left; text-align:left;
text-align:justify;
color:black; color:black;
font-size: 9.5pt; font-size: 11pt;
line-height:13pt; line-height:13pt;
margin-top:30px; margin-bottom:30px;
width:430px;
margin-left:30px;
} }
.modalokbutto{ .modalokbutto{
cursor:pointer; cursor:pointer;
text-align:center; text-align:center;
margin-right:45px; display: inline-block;
float:right; padding: 6px 45px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
margin-bottom:30px; border-radius: 3px;
border-radius: 3px;width:90px;height:30px;background-color:white;border: 1px solid #82b92e; background-color:white;
border: 1px solid #82b92e;
} }
.modalokbuttontex{ .modalokbuttontex{
color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px; color:#82b92e;
font-family:Nunito;
font-size:13pt;
} }
.modalgobutto{ .modalgobutto{
cursor:pointer;text-align:center;margin-right:15px;margin-bottom:30px;float:right;-moz-border-radius: 3px; cursor:pointer;
-webkit-border-radius: 3px;border-radius: 3px;width:240px;height:30px;background-color:white;border: 1px solid #82b92e; text-align:center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
} }
.modalgobuttontex{ .modalgobuttontex{
color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px; color:#82b92e;
font-family:Nunito;
font-size:10pt;
} }
#opacida{ #opacidad{
position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width:100%;height:100%; position:fixed;
background:black;
opacity:0.6;
z-index:-1;
left:0px;
top:0px;
width:100%;
height:100%;
} }
/*
.textodialog{ .textodialog{
margin-left: 0px; margin-left: 0px;
color:#333; color:#333;
@ -101,9 +116,8 @@ position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width
.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{ .cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
font-size:18pt; font-size:18pt;
} }
*/
</style> </style>
</head> </head>
<body> <body>
@ -111,15 +125,14 @@ position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width
<div id="alert_messages_na"> <div id="alert_messages_na">
<div class='modalheade'> <div class='modalheade'>
<span class='modalheadertex'> <img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
<?php echo __("You don't have access to this page"); ?>
</span>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/icono_cerrar.png'>
</div> </div>
<div class='modalconten'> <div class='modalconten'>
<img class='modalcontentim' src='<?php echo $config['homeurl']; ?>images/access_denied.png'> <div class='modalheadertex'>
<?php echo __("You don't have access to this page"); ?>
</div>
<div class='modalcontenttex'> <div class='modalcontenttex'>
<?php <?php
echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.'); echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.');
@ -129,16 +142,13 @@ position:absolute;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width
</div> </div>
</div>
<div class='modalokbutto cerrar'> <div class='modalokbutto cerrar'>
<span class='modalokbuttontex'>OK</span> <span class='modalokbuttontex'>OK</span>
</div> </div>
</div>
</div> </div>
<div id="opacida" style="position:fixed;background:black;opacity:0.6;z-index:-1;left:0px;top:0px;width:100%;height:100%;"></div> <div id="opacidad"></div>
</body> </body>
</html> </html>
@ -149,4 +159,6 @@ $(".cerrar").click(function(){
window.location="."; window.location=".";
}); });
$('div#page').css('background-color','#d3d3d3');
</script> </script>

View File

@ -183,10 +183,10 @@ if (empty($result)) {
} }
$table = new stdClass(); $table = new stdClass();
$table->cellpadding = 4; $table->cellpadding = 0;
$table->cellspacing = 4; $table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->size = []; $table->size = [];
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
@ -246,7 +246,18 @@ foreach ($result as $row) {
} }
} }
foreach ($table->rowclass as $key => $value) {
if (strpos($value, 'limit_scroll') !== false) {
$table->colspan[$key] = [7];
} else {
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
$table->cellclass[$key][6] = 'action_buttons';
}
}
}
html_print_table($table); html_print_table($table);
ui_pagination($count, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { if ($enterprise_include !== ENTERPRISE_NOT_HOOK) {
enterprise_hook('enterpriseAuditFooter'); enterprise_hook('enterpriseAuditFooter');

View File

@ -225,7 +225,7 @@ if ($result === false) {
$table->width = '100%'; $table->width = '100%';
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->data = []; $table->data = [];
$table->align = []; $table->align = [];
@ -253,9 +253,9 @@ foreach ($result as $row) {
$data[2] = mb_substr($row['descripcion'], 0, 60); $data[2] = mb_substr($row['descripcion'], 0, 60);
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>&nbsp;&nbsp;'; $table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
$data[3] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).'</a>'; $data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }

View File

@ -97,11 +97,22 @@ if ($delete_field) {
} }
} }
$fields = db_get_all_fields_in_table('tagent_custom_fields'); // Prepare pagination.
$offset = (int) get_parameter('offset');
$limit = $config['block_size'];
$count_fields = db_get_value('count(*)', 'tagent_custom_fields');
$fields = db_get_all_rows_filter(
'tagent_custom_fields',
[
'limit' => $limit,
'offset' => $offset,
]
);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
if ($fields) { if ($fields) {
$table->head = []; $table->head = [];
$table->head[0] = __('ID'); $table->head[0] = __('ID');
@ -135,14 +146,17 @@ foreach ($fields as $field) {
$data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']); $data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']);
} }
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).'</a>'; $data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).'</a>';
$data[3] .= '&nbsp;&nbsp;<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).'</a>'; $data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
if ($fields) { if ($fields) {
ui_pagination($count_fields, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_fields, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
} }
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configure_field">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configure_field">';

View File

@ -224,13 +224,13 @@ switch ($config['dbtype']) {
break; break;
} }
$selected = 'border: 1px solid black;'; $selected = true;
$selectNameUp = ''; $selectNameUp = false;
$selectNameDown = ''; $selectNameDown = false;
$selectOsUp = ''; $selectOsUp = false;
$selectOsDown = ''; $selectOsDown = false;
$selectGroupUp = ''; $selectGroupUp = false;
$selectGroupDown = ''; $selectGroupDown = false;
switch ($sortField) { switch ($sortField) {
case 'remote': case 'remote':
switch ($sort) { switch ($sort) {
@ -441,18 +441,27 @@ if (($config['dbtype'] == 'oracle') && ($agents !== false)) {
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
if ($agents !== false) { if ($agents !== false) {
echo "<table cellpadding='4' id='agent_list' cellspacing='4' width='100%' class='databox data'>"; // Urls to sort the table.
echo '<th>'.__('Agent name').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>'; $url_up_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=up&disabled=$disabled';
echo '</th>'; $url_down_agente = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=name&sort=down&disabled=$disabled';
echo "<th title='".__('Remote agent configuration')."'>".__('R').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectRemoteUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectRemoteDown]).'</a>'; $url_up_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=up&disabled=$disabled';
echo '</th>'; $url_down_remote = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=remote&sort=down&disabled=$disabled';
echo '<th>'.__('OS').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectOsUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectOsDown]).'</a>'; $url_up_os = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=up&disabled=$disabled';
echo '</th>'; $url_down_os = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=os&sort=down&disabled=$disabled';
$url_up_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled';
$url_down_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled';
echo "<table cellpadding='0' id='agent_list' cellspacing='0' width='100%' class='info_table'>";
echo '<thead><tr>';
echo '<th>'.__('Agent name').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown).'</th>';
echo "<th title='".__('Remote agent configuration')."'>".__('R').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown).'</th>';
echo '<th>'.__('OS').ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown).'</th>';
echo '<th>'.__('Type').'</th>'; echo '<th>'.__('Type').'</th>';
echo '<th>'.__('Group').' '.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled">'.html_print_image('images/sort_up.png', true, ['style' => $selectGroupUp]).'</a>'.'<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled">'.html_print_image('images/sort_down.png', true, ['style' => $selectGroupDown]).'</a>'; echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>';
echo '</th>';
echo '<th>'.__('Description').'</th>'; echo '<th>'.__('Description').'</th>';
echo "<th style='text-align:left'>".__('Actions').'</th>'; echo "<th style='text-align:left'>".__('Actions').'</th>';
echo '</tr></thead>';
$color = 1; $color = 1;
$rowPair = true; $rowPair = true;
@ -628,7 +637,7 @@ if ($agents !== false) {
$offsetArg = $offset; $offsetArg = $offset;
} }
echo "<td class='$tdcolor' align='left' style='width:7%' valign='middle'>"; echo "<td class='$tdcolor action_buttons' align='left' style='width:7%' valign='middle'>";
if ($agent['disabled']) { if ($agent['disabled']) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente& echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
@ -654,7 +663,7 @@ if ($agents !== false) {
} }
if ($check_aw) { if ($check_aw) {
echo "&nbsp;&nbsp;<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente& echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
borrar_agente=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'"; borrar_agente=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'";
if ($agent['id_os'] != 100) { if ($agent['id_os'] != 100) {
@ -670,7 +679,7 @@ if ($agents !== false) {
} }
echo '</table>'; echo '</table>';
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset, 0, false, 'offset', true, 'pagination-bottom');
echo "<table width='100%'><tr><td align='right'>"; echo "<table width='100%'><tr><td align='right'>";
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]);

View File

@ -358,17 +358,17 @@ if ($multiple_delete) {
// TABLE LIST MODULES // TABLE LIST MODULES
// ================== // ==================
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente;
$selectNameUp = ''; $selectNameUp = false;
$selectNameDown = ''; $selectNameDown = false;
$selectServerUp = ''; $selectServerUp = false;
$selectServerDown = ''; $selectServerDown = false;
$selectTypeUp = ''; $selectTypeUp = false;
$selectTypeDown = ''; $selectTypeDown = false;
$selectIntervalUp = ''; $selectIntervalUp = false;
$selectIntervalDown = ''; $selectIntervalDown = false;
$sortField = get_parameter('sort_field'); $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$selected = ''; $selected = true;
$order[] = [ $order[] = [
'field' => 'tmodule_group.name', 'field' => 'tmodule_group.name',
@ -482,13 +482,13 @@ switch ($sortField) {
default: default:
$selectNameUp = $selected; $selectNameUp = $selected;
$selectNameDown = ''; $selectNameDown = false;
$selectServerUp = ''; $selectServerUp = false;
$selectServerDown = ''; $selectServerDown = false;
$selectTypeUp = ''; $selectTypeUp = false;
$selectTypeDown = ''; $selectTypeDown = false;
$selectIntervalUp = ''; $selectIntervalUp = false;
$selectIntervalDown = ''; $selectIntervalDown = false;
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
@ -626,32 +626,39 @@ if ($paginate_module) {
ui_pagination($total_modules, $url); ui_pagination($total_modules, $url);
} }
$url_name = $url.'&sort_field=name&sort=';
$url_server = $url.'&sort_field=server&sort=';
$url_type = $url.'&sort_field=type&sort=';
$url_interval = $url.'&sort_field=interval&sort=';
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('Name').' '.'<a href="'.$url.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="'.$url.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>'; $table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown);
// The access to the policy is granted only with AW permission // The access to the policy is granted only with AW permission
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
$table->head[1] = "<span title='".__('Policy')."'>".__('P.').'</span>'; $table->head[1] = "<span title='".__('Policy')."'>".__('P.').'</span>';
} }
$table->head[2] = "<span title='".__('Server')."'>".__('S.').'</span>'.' '.'<a href="'.$url.'&sort_field=server&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectServerUp]).'</a>'.'<a href="'.$url.'&sort_field=server&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectServerDown]).'</a>'; $table->head[2] = "<span title='".__('Server')."'>".__('S.').'</span>'.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown);
$table->head[3] = __('Type').' '.'<a href="'.$url.'&sort_field=type&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectTypeUp]).'</a>'.'<a href="'.$url.'&sort_field=type&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectTypeDown]).'</a>'; $table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown);
$table->head[4] = __('Interval').' '.'<a href="'.$url.'&sort_field=interval&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectIntervalUp]).'</a>'.'<a href="'.$url.'&sort_field=interval&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectIntervalDown]).'</a>'; $table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown);
$table->head[5] = __('Description'); $table->head[5] = __('Description');
$table->head[6] = __('Status'); $table->head[6] = __('Status');
$table->head[7] = __('Warn'); $table->head[7] = __('Warn');
$table->head[8] = __('Action'); $table->head[8] = __('Action');
$table->head[9] = '<span title="'.__('Delete').'">'.__('Del.').'</span>'.html_print_checkbox('all_delete', 0, false, true, false); $table->head[9] = '<span title="'.__('Delete').'">'.__('Del.').'</span>';
$table->rowstyle = []; $table->rowstyle = [];
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'font-weight: bold';
$table->size = []; $table->size = [];
$table->size['checkbox'] = '20px';
$table->size[2] = '70px'; $table->size[2] = '70px';
$table->align = []; $table->align = [];
$table->align[2] = 'left'; $table->align[2] = 'left';
@ -706,15 +713,19 @@ foreach ($modules as $module) {
$table->rowstyle[($i - 1)] = 'text-align: center'; $table->rowstyle[($i - 1)] = 'text-align: center';
$table->rowclass[($i - 1)] = 'datos3'; $table->rowclass[($i - 1)] = 'datos3';
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->colspan[($i - 1)][0] = 10; $table->colspan[($i - 1)][0] = 11;
} else { } else {
$table->colspan[($i - 1)][0] = 9; $table->colspan[($i - 1)][0] = 10;
} }
$data = []; $data = [];
} }
} }
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
$data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true);
}
$data[0] = ''; $data[0] = '';
if (isset($module['deep']) && ($module['deep'] != 0)) { if (isset($module['deep']) && ($module['deep'] != 0)) {
@ -858,7 +869,7 @@ foreach ($modules as $module) {
} }
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && $module['id_tipo_modulo'] != 25) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && $module['id_tipo_modulo'] != 25) {
$data[8] .= '&nbsp;<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&duplicate_module='.$module['id_agente_modulo'].'" $data[8] .= '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&duplicate_module='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/copy.png', 'images/copy.png',
@ -870,7 +881,7 @@ foreach ($modules as $module) {
// Make a data normalization // Make a data normalization
if (isset($numericModules[$type])) { if (isset($numericModules[$type])) {
if ($numericModules[$type] === true) { if ($numericModules[$type] === true) {
$data[8] .= '&nbsp;<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; $data[8] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/chart_curve.png', 'images/chart_curve.png',
true, true,
@ -879,18 +890,19 @@ foreach ($modules as $module) {
$data[8] .= '</a>'; $data[8] .= '</a>';
} }
} else { } else {
$data[8] .= '&nbsp;'.html_print_image( $data[8] .= html_print_image(
'images/chart_curve.disabled.png', 'images/chart_curve.disabled.png',
true, true,
['title' => __('Normalize (Disabled)')] ['title' => __('Normalize (Disabled)')]
); );
$data[8] .= '&nbsp;&nbsp;';
} }
// create network component action // create network component action
if ((is_user_admin($config['id_user'])) if ((is_user_admin($config['id_user']))
&& ($module['id_modulo'] == MODULE_NETWORK) && ($module['id_modulo'] == MODULE_NETWORK)
) { ) {
$data[8] .= '&nbsp;<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create_network_from_module=1&id_agente='.$id_agente.'&create_module_from='.$module['id_agente_modulo'].'" $data[8] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create_network_from_module=1&id_agente='.$id_agente.'&create_module_from='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/network.png', 'images/network.png',
@ -899,11 +911,12 @@ foreach ($modules as $module) {
); );
$data[8] .= '</a> '; $data[8] .= '</a> ';
} else { } else {
$data[8] .= '&nbsp;'.html_print_image( $data[8] .= html_print_image(
'images/network.disabled.png', 'images/network.disabled.png',
true, true,
['title' => __('Create network component (Disabled)')] ['title' => __('Create network component (Disabled)')]
); );
$data[8] .= '&nbsp;&nbsp;';
} }
} }
@ -917,10 +930,17 @@ foreach ($modules as $module) {
['title' => __('Delete')] ['title' => __('Delete')]
); );
$data[9] .= '</a> '; $data[9] .= '</a> ';
$data[9] .= html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true);
} }
$table->cellclass[] = [
8 => 'action_buttons',
9 => 'action_buttons',
];
array_push($table->data, $data); array_push($table->data, $data);
$table->cellclass[] = [
8 => 'action_buttons',
9 => 'action_buttons',
];
} }
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {

View File

@ -393,7 +393,7 @@ else {
// View available downtimes present in database (if any of them) // View available downtimes present in database (if any of them)
$table = new StdClass(); $table = new StdClass();
$table->class = 'databox data'; $table->class = 'info_table';
$table->width = '100%'; $table->width = '100%';
$table->cellstyle = []; $table->cellstyle = [];
@ -518,9 +518,9 @@ else {
} }
html_print_table($table); html_print_table($table);
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom');
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<br>';
// CSV export button // CSV export button
echo '<div style="display: inline;">'; echo '<div style="display: inline;">';
html_print_button( html_print_button(

View File

@ -221,7 +221,7 @@ if ($delete_action) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->head[0] = __('Name'); $table->head[0] = __('Name');
@ -281,6 +281,10 @@ foreach ($actions as $action) {
} }
if (check_acl($config['id_user'], $action['id_group'], 'LM')) { if (check_acl($config['id_user'], $action['id_group'], 'LM')) {
$table->cellclass[] = [
2 => 'action_buttons',
3 => 'action_buttons',
];
$data[2] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&amp;copy_action=1&amp;id='.$action['id'].'&pure='.$pure.'" $data[2] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&amp;copy_action=1&amp;id='.$action['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true).'</a>'; onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true).'</a>';
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&delete_action=1&id='.$action['id'].'&pure='.$pure.'" $data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&delete_action=1&id='.$action['id'].'&pure='.$pure.'"

View File

@ -388,7 +388,7 @@ if ($copy_command) {
} }
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
@ -431,6 +431,7 @@ foreach ($commands as $command) {
io_safe_output($command['description']) io_safe_output($command['description'])
); );
$data['action'] = ''; $data['action'] = '';
$table->cellclass[]['action'] = 'action_buttons';
if (! $command['internal']) { if (! $command['internal']) {
$data['action'] = '<span style="display: inline-flex">'; $data['action'] = '<span style="display: inline-flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'" $data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'"

View File

@ -226,17 +226,18 @@ $order = null;
$sortField = get_parameter('sort_field'); $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$selected = 'border: 1px solid black;'; $selected = true;
// 'border: 1px solid black;';
$selectDisabledUp = ''; $selectDisabledUp = '';
$selectDisabledDown = ''; $selectDisabledDown = '';
$selectStandbyUp = ''; $selectStandbyUp = '';
$selectStandbyDown = ''; $selectStandbyDown = '';
$selectAgentUp = ''; $selectAgentUp = false;
$selectAgentDown = ''; $selectAgentDown = false;
$selectModuleUp = ''; $selectModuleUp = false;
$selectModuleDown = ''; $selectModuleDown = false;
$selectTemplateUp = ''; $selectTemplateUp = false;
$selectTemplateDown = ''; $selectTemplateDown = false;
switch ($sortField) { switch ($sortField) {
case 'disabled': case 'disabled':
@ -346,11 +347,11 @@ switch ($sortField) {
$selectStandbyUp = ''; $selectStandbyUp = '';
$selectStandbyDown = ''; $selectStandbyDown = '';
$selectAgentUp = $selected; $selectAgentUp = $selected;
$selectAgentDown = ''; $selectAgentDown = false;
$selectModuleUp = ''; $selectModuleUp = false;
$selectModuleDown = ''; $selectModuleDown = false;
$selectTemplateUp = ''; $selectTemplateUp = false;
$selectTemplateDown = ''; $selectTemplateDown = false;
$order = [ $order = [
'field' => 'agent_name', 'field' => 'agent_name',
'order' => 'ASC', 'order' => 'ASC',
@ -360,12 +361,12 @@ switch ($sortField) {
$selectDisabledDown = ''; $selectDisabledDown = '';
$selectStandbyUp = ''; $selectStandbyUp = '';
$selectStandbyDown = ''; $selectStandbyDown = '';
$selectAgentUp = ''; $selectAgentUp = false;
$selectAgentDown = ''; $selectAgentDown = false;
$selectModuleUp = $selected; $selectModuleUp = $selected;
$selectModuleDown = ''; $selectModuleDown = false;
$selectTemplateUp = ''; $selectTemplateUp = false;
$selectTemplateDown = ''; $selectTemplateDown = false;
$order = [ $order = [
'field' => 'agent_module_name', 'field' => 'agent_module_name',
'order' => 'ASC', 'order' => 'ASC',
@ -402,12 +403,21 @@ if (!$id_agente) {
$url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente='.$id_agente.'&offset='.$offset.$form_params; $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente='.$id_agente.'&offset='.$offset.$form_params;
} }
// Urls to sort the table.
$url_up_agente = $url.'&sort_field=agent&sort=up&pure='.$pure;
$url_down_agente = $url.'&sort_field=agent&sort=down&pure='.$pure;
$url_up_module = $url.'&sort_field=module&sort=up&pure='.$pure;
$url_down_module = $url.'&sort_field=module&sort=down&pure='.$pure;
$url_up_template = $url.'&sort_field=template&sort=up&pure='.$pure;
$url_down_template = $url.'&sort_field=template&sort=down&pure='.$pure;
$table = new stdClass(); $table = new stdClass();
if (is_metaconsole()) { if (is_metaconsole()) {
$table->class = 'alert_list databox'; $table->class = 'alert_list databox';
} else { } else {
$table->class = 'databox data'; $table->class = 'info_table';
} }
$table->width = '100%'; $table->width = '100%';
@ -427,7 +437,7 @@ $table->head = [];
if (! $id_agente) { if (! $id_agente) {
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold;'; $table->style[0] = 'font-weight: bold;';
$table->head[0] = __('Agent').'&nbsp;'.'<a href="'.$url.'&sort_field=agent&sort=up&pure='.$pure.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectAgentUp]).'</a>'.'<a href="'.$url.'&sort_field=agent&sort=down&pure='.$pure.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectAgentDown]).'</a>'; $table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown);
$table->size[0] = '4%'; $table->size[0] = '4%';
$table->size[1] = '8%'; $table->size[1] = '8%';
$table->size[2] = '8%'; $table->size[2] = '8%';
@ -439,7 +449,7 @@ if (! $id_agente) {
$table->size[4] = '8%'; $table->size[4] = '8%';
}*/ }*/
} else { } else {
$table->head[0] = __('Module').'&nbsp;'.'<a href="'.$url.'&sort_field=module&sort=up&pure='.$pure.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectModuleUp]).'</a>'.'<a href="'.$url.'&sort_field=module&sort=down&pure='.$pure.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectModuleDown]).'</a>'; $table->head[0] = __('Module').ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
// Different sizes or the layout screws up // Different sizes or the layout screws up
$table->size[0] = '0%'; $table->size[0] = '0%';
$table->size[1] = '10%'; $table->size[1] = '10%';
@ -452,7 +462,7 @@ if (! $id_agente) {
$table->size[4] = '1%'; $table->size[4] = '1%';
} }
$table->head[1] = __('Template').'&nbsp;'.'<a href="'.$url.'&sort_field=template&sort=up&pure='.$pure.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectTemplateUp]).'</a>'.'<a href="'.$url.'&sort_field=template&sort=down&pure='.$pure.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectTemplateDown]).'</a>'; $table->head[1] = __('Template').ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown);
$table->head[2] = __('Actions'); $table->head[2] = __('Actions');
$table->head[3] = __('Status'); $table->head[3] = __('Status');
$table->head[4] = "<span title='".__('Operations')."'>".__('Op.').'</span>'; $table->head[4] = "<span title='".__('Operations')."'>".__('Op.').'</span>';
@ -728,6 +738,10 @@ foreach ($simple_alerts as $alert) {
$data[3] = ui_print_status_image($status, $title, true); $data[3] = ui_print_status_image($status, $title, true);
$table->cellclass[] = [
3 => 'action_buttons',
4 => 'action_buttons',
];
$data[4] = '<form class="disable_alert_form" action="'.$url.'" method="post" style="display: inline;">'; $data[4] = '<form class="disable_alert_form" action="'.$url.'" method="post" style="display: inline;">';
if ($alert['disabled']) { if ($alert['disabled']) {
$data[4] .= html_print_input_image('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true); $data[4] .= html_print_input_image('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true);
@ -742,7 +756,7 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group // To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
$data[4] .= '&nbsp;&nbsp;<form class="standby_alert_form" action="'.$url.'" method="post" style="display: inline;">'; $data[4] .= '<form class="standby_alert_form" action="'.$url.'" method="post" style="display: inline;">';
if (!$alert['standby']) { if (!$alert['standby']) {
$data[4] .= html_print_input_image('standby_off', 'images/bell.png', 1, 'padding:0px;', true); $data[4] .= html_print_input_image('standby_off', 'images/bell.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true); $data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
@ -771,7 +785,7 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group // To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
$data[4] .= '&nbsp;&nbsp;<form class="delete_alert_form" action="'.$url.'" method="post" style="display: inline;">'; $data[4] .= '<form class="delete_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$is_cluster = (bool) get_parameter('id_cluster'); $is_cluster = (bool) get_parameter('id_cluster');
if (!$is_cluster) { if (!$is_cluster) {
if ($alert['disabled']) { if ($alert['disabled']) {
@ -815,6 +829,11 @@ foreach ($simple_alerts as $alert) {
if (isset($data)) { if (isset($data)) {
html_print_table($table); html_print_table($table);
if ($id_agente) {
ui_pagination($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom');
} else {
ui_pagination($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list'.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom');
}
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('No alerts defined') ]); ui_print_info_message(['no_close' => true, 'message' => __('No alerts defined') ]);
} }

View File

@ -339,7 +339,7 @@ if ($templates === false) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->head[0] = __('Name'); $table->head[0] = __('Name');
@ -375,6 +375,7 @@ foreach ($templates as $template) {
$data[3] = alerts_get_alert_templates_type_name($template['type']); $data[3] = alerts_get_alert_templates_type_name($template['type']);
if (check_acl($config['id_user'], $template['id_group'], 'LM')) { if (check_acl($config['id_user'], $template['id_group'], 'LM')) {
$table->cellclass[][4] = 'action_buttons';
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" style="display: inline; float: left">'; $data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" style="display: inline; float: left">';
$data[4] .= html_print_input_hidden('duplicate_template', 1, true); $data[4] .= html_print_input_hidden('duplicate_template', 1, true);
$data[4] .= html_print_input_hidden('source_id', $template['id'], true); $data[4] .= html_print_input_hidden('source_id', $template['id'], true);
@ -396,6 +397,7 @@ foreach ($templates as $template) {
ui_pagination($total_templates, $url); ui_pagination($total_templates, $url);
if (isset($data)) { if (isset($data)) {
html_print_table($table); html_print_table($table);
ui_pagination($total_templates, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('No alert templates defined') ]); ui_print_info_message(['no_close' => true, 'message' => __('No alert templates defined') ]);
} }

View File

@ -82,7 +82,13 @@ $filter['limit'] = (int) $config['block_size'];
// Search action: This will filter the display category view // Search action: This will filter the display category view
$result = false; $result = false;
$result = categories_get_all_categories(); $result = db_get_all_rows_filter(
'tcategory',
[
'limit' => $filter['limit'],
'offset' => $filter['offset'],
]
);
// Display categories previously filtered or not // Display categories previously filtered or not
$rowPair = true; $rowPair = true;
@ -94,7 +100,7 @@ if (!empty($result)) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
@ -123,7 +129,8 @@ if (!empty($result)) {
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>'; $data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>';
} else { } else {
$data[0] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".$category['name'].'</a>'; $data[0] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".$category['name'].'</a>';
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image('images/config.png', true, ['title' => 'Edit']).'</a>&nbsp;&nbsp;'; $table->cellclass[][1] = 'action_buttons';
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image('images/config.png', true, ['title' => 'Edit']).'</a>';
$data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>'; $data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>';
} }
@ -131,6 +138,7 @@ if (!empty($result)) {
} }
html_print_table($table); html_print_table($table);
ui_pagination($total_categories, $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
} else { } else {
// No categories available or selected // No categories available or selected
ui_print_info_message(['no_close' => true, 'message' => __('No categories found') ]); ui_print_info_message(['no_close' => true, 'message' => __('No categories found') ]);

View File

@ -113,31 +113,33 @@ if ($filters === false) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('Name'); $table->head[0] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[1] = __('Group'); $table->head[1] = __('Name');
$table->head[2] = __('Event type'); $table->head[2] = __('Group');
$table->head[3] = __('Event status'); $table->head[3] = __('Event type');
$table->head[4] = __('Severity'); $table->head[4] = __('Event status');
$table->head[5] = __('Action').html_print_checkbox('all_delete', 0, false, true, false); $table->head[5] = __('Severity');
$table->head[6] = __('Action');
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[1] = 'font-weight: bold';
$table->align = []; $table->align = [];
$table->align[1] = 'left';
$table->align[2] = 'left'; $table->align[2] = 'left';
$table->align[3] = 'left'; $table->align[3] = 'left';
$table->align[4] = 'left'; $table->align[4] = 'left';
$table->align[5] = 'left'; $table->align[5] = 'left';
$table->align[6] = 'left';
$table->size = []; $table->size = [];
$table->size[0] = '50%'; $table->size[0] = '20px';
$table->size[1] = '5px'; $table->size[1] = '50%';
$table->size[2] = '80px'; $table->size[2] = '5px';
$table->size[3] = '80px'; $table->size[3] = '80px';
$table->size[4] = '80px'; $table->size[4] = '80px';
$table->size[5] = '40px'; $table->size[5] = '80px';
$table->size[6] = '40px';
$table->data = []; $table->data = [];
$total_filters = db_get_all_rows_filter('tevent_filter', false, 'COUNT(*) AS total'); $total_filters = db_get_all_rows_filter('tevent_filter', false, 'COUNT(*) AS total');
@ -147,13 +149,14 @@ $total_filters = $total_filters[0]['total'];
foreach ($filters as $filter) { foreach ($filters as $filter) {
$data = []; $data = [];
$data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&id='.$filter['id_filter'].'&pure='.$config['pure'].'">'.$filter['id_name'].'</a>'; $data[0] = html_print_checkbox_extended('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true);
$data[1] = ui_print_group_icon($filter['id_group_filter'], true); $data[1] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&id='.$filter['id_filter'].'&pure='.$config['pure'].'">'.$filter['id_name'].'</a>';
$data[2] = events_get_event_types($filter['event_type']); $data[2] = ui_print_group_icon($filter['id_group_filter'], true);
$data[3] = events_get_status($filter['status']); $data[3] = events_get_event_types($filter['event_type']);
$data[4] = events_get_severity_types($filter['severity']); $data[4] = events_get_status($filter['status']);
$data[5] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;' $data[5] = events_get_severity_types($filter['severity']);
href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'.html_print_checkbox_extended('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); $table->cellclass[][6] = 'action_buttons';
$data[6] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -189,8 +192,6 @@ echo '</div>';
<script type="text/javascript"> <script type="text/javascript">
$("input[name=all_delete]").css("margin-left", "32px");
$( document ).ready(function() { $( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){ $('[id^=checkbox-delete_multiple]').change(function(){

View File

@ -36,7 +36,9 @@ if (empty($event_responses)) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->size = []; $table->size = [];
$table->size[0] = '200px'; $table->size[0] = '200px';
@ -57,8 +59,9 @@ foreach ($event_responses as $response) {
$data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.$response['name'].'</a>'; $data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.$response['name'].'</a>';
$data[1] = $response['description']; $data[1] = $response['description'];
$data[2] = ui_print_group_icon($response['id_group'], true); $data[2] = ui_print_group_icon($response['id_group'], true);
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&action=delete_response&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'; $data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&action=delete_response&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
$data[3] .= '&nbsp;<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit')]).'</a>'; $data[3] .= '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit')]).'</a>';
$table->data[] = $data; $table->data[] = $data;
} }

View File

@ -149,7 +149,7 @@ $table->head[] = __('Operation');
$table->width[] = '30%'; $table->width[] = '30%';
*/ */
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->align = []; $table->align = [];
$table->align[] = 'left'; $table->align[] = 'left';
@ -254,6 +254,7 @@ foreach ($extensions as $file => $extension) {
// Avoid to delete or disabled update_manager // Avoid to delete or disabled update_manager
if ($file != 'update_manager.php') { if ($file != 'update_manager.php') {
$table->cellclass[][10] = 'action_buttons';
if (!$extension['enabled']) { if (!$extension['enabled']) {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true).'</a>'; $data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true).'</a>';
} else { } else {

View File

@ -515,7 +515,7 @@ if ($tab == 'tree') {
$table = new StdClass(); $table = new StdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('ID'); $table->head[0] = __('ID');
$table->head[1] = __('Name'); $table->head[1] = __('Name');
@ -559,6 +559,7 @@ if ($tab == 'tree') {
$table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled'); $table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled');
$table->data[$key][4] = $group['parent_name']; $table->data[$key][4] = $group['parent_name'];
$table->data[$key][5] = $group['description']; $table->data[$key][5] = $group['description'];
$table->cellclass[$key][6] = 'action_buttons';
$table->data[$key][6] = "<a href='$url'>".html_print_image( $table->data[$key][6] = "<a href='$url'>".html_print_image(
'images/config.png', 'images/config.png',
true, true,
@ -574,7 +575,7 @@ if ($tab == 'tree') {
$confirm_message = __('The child groups will be updated to use the parent id of the deleted group').'. '.$confirm_message; $confirm_message = __('The child groups will be updated to use the parent id of the deleted group').'. '.$confirm_message;
} }
$table->data[$key][6] .= '&nbsp;&nbsp;'.'<a href="'.$url_delete.'" onClick="if (!confirm(\' '.$confirm_message.'\')) return false;">'.html_print_image( $table->data[$key][6] .= '<a href="'.$url_delete.'" onClick="if (!confirm(\' '.$confirm_message.'\')) return false;">'.html_print_image(
'images/cross.png', 'images/cross.png',
true, true,
[ [
@ -592,7 +593,7 @@ if ($tab == 'tree') {
$block_size, $block_size,
true, true,
'offset', 'offset',
false true
); );
html_print_table($table); html_print_table($table);
echo ui_pagination( echo ui_pagination(
@ -602,7 +603,8 @@ if ($tab == 'tree') {
$block_size, $block_size,
true, true,
'offset', 'offset',
true true,
'pagination-bottom'
); );
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups') ]);

View File

@ -212,14 +212,11 @@ if ($delete_group) {
} }
} }
// Prepare pagination.
$total_groups = db_get_num_rows('SELECT * FROM tmodule_group'); $total_groups = db_get_num_rows('SELECT * FROM tmodule_group');
$url = ui_get_url_refresh(['offset' => false]); $url = ui_get_url_refresh(['offset' => false]);
$offset = (int) get_parameter('offset', 0); $offset = (int) get_parameter('offset', 0);
ui_pagination($total_groups, $url, $offset);
$sql = 'SELECT * $sql = 'SELECT *
FROM tmodule_group FROM tmodule_group
@ -230,7 +227,7 @@ $groups = db_get_all_rows_sql($sql);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
if (!empty($groups)) { if (!empty($groups)) {
$table->head = []; $table->head = [];
@ -251,13 +248,16 @@ if (!empty($groups)) {
if (is_metaconsole()) { if (is_metaconsole()) {
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>'; $data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
} else { } else {
$table->cellclass[][2] = 'action_buttons';
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>'; $data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
} }
array_push($table->data, $data); array_push($table->data, $data);
} }
ui_pagination($total_groups, $url, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($total_groups, $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
} else { } else {
ui_print_info_message( ui_print_info_message(
[ [

View File

@ -219,17 +219,19 @@ $groups = component_groups_get_groups_tree_recursive($groups_clean, 0, 0);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[0] = __('Name'); $table->head[0] = __('Name');
$table->head[1] = __('Action').html_print_checkbox('all_delete', 0, false, true, false); $table->head[1] = __('Action');
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'font-weight: bold';
$table->align = []; $table->align = [];
$table->align[1] = 'left'; $table->align[1] = 'left';
$table->size = []; $table->size = [];
$table->size[0] = '80%'; $table->size['checkbox'] = '20px';
$table->size[1] = '10%'; // $table->size[0] = '80%';
$table->size[1] = '60px';
$table->data = []; $table->data = [];
$total_groups = db_get_all_rows_filter('tnetwork_component_group', false, 'COUNT(*) AS total'); $total_groups = db_get_all_rows_filter('tnetwork_component_group', false, 'COUNT(*) AS total');
@ -239,6 +241,9 @@ $total_groups = $total_groups[0]['total'];
foreach ($groups as $group) { foreach ($groups as $group) {
$data = []; $data = [];
$data['checkbox'] = html_print_checkbox_extended('delete_multiple[]', $group['id_sg'], false, false, '', 'class="check_delete"', true);
$tabulation = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $group['deep']); $tabulation = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $group['deep']);
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$data[0] = $tabulation.'<a href="index.php?sec=advanced&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>'; $data[0] = $tabulation.'<a href="index.php?sec=advanced&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>';
@ -246,8 +251,9 @@ foreach ($groups as $group) {
$data[0] = $tabulation.'<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>'; $data[0] = $tabulation.'<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>';
} }
$table->cellclass[][1] = 'action_buttons';
$data[1] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;' $data[1] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
href='index.php?sec=".$sec.'&sec2=godmode/modules/manage_nc_groups&delete=1&id='.$group['id_sg']."&offset=0'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'.html_print_checkbox_extended('delete_multiple[]', $group['id_sg'], false, false, '', 'class="check_delete"', true); href='index.php?sec=".$sec.'&sec2=godmode/modules/manage_nc_groups&delete=1&id='.$group['id_sg']."&offset=0'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }

View File

@ -638,14 +638,16 @@ unset($table);
$table->width = '100%'; $table->width = '100%';
$table->head = []; $table->head = [];
$table->class = 'databox data'; $table->class = 'info_table';
$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[0] = __('Module name'); $table->head[0] = __('Module name');
$table->head[1] = __('Type'); $table->head[1] = __('Type');
$table->head[3] = __('Description'); $table->head[3] = __('Description');
$table->head[4] = __('Group'); $table->head[4] = __('Group');
$table->head[5] = __('Max/Min'); $table->head[5] = __('Max/Min');
$table->head[6] = __('Action').html_print_checkbox('all_delete', 0, false, true, false); $table->head[6] = __('Action');
$table->size = []; $table->size = [];
$table->size['checkbox'] = '20px';
$table->size[1] = '75px'; $table->size[1] = '75px';
$table->size[6] = '80px'; $table->size[6] = '80px';
$table->align[6] = 'left'; $table->align[6] = 'left';
@ -658,6 +660,8 @@ foreach ($components as $component) {
$component['max'] = $component['min'] = __('N/A'); $component['max'] = $component['min'] = __('N/A');
} }
$data['checkbox'] = html_print_checkbox_extended('delete_multiple[]', $component['id_nc'], false, false, '', 'class="check_delete"', true);
$data[0] = '<a href="index.php?sec='.$sec.'&'.'sec2=godmode/modules/manage_network_components&'.'id='.$component['id_nc'].'&pure='.$pure.'">'; $data[0] = '<a href="index.php?sec='.$sec.'&'.'sec2=godmode/modules/manage_network_components&'.'id='.$component['id_nc'].'&pure='.$pure.'">';
$data[0] .= io_safe_output($component['name']); $data[0] .= io_safe_output($component['name']);
$data[0] .= '</a>'; $data[0] .= '</a>';
@ -692,8 +696,9 @@ foreach ($components as $component) {
$data[4] = network_components_get_group_name($component['id_group']); $data[4] = network_components_get_group_name($component['id_group']);
$data[5] = $component['max'].' / '.$component['min']; $data[5] = $component['max'].' / '.$component['min'];
$table->cellclass[][6] = 'action_buttons';
$data[6] = '<a style="display: inline; float: left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image('images/copy.png', true, ['alt' => __('Duplicate'), 'title' => __('Duplicate')]).'</a>'; $data[6] = '<a style="display: inline; float: left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image('images/copy.png', true, ['alt' => __('Duplicate'), 'title' => __('Duplicate')]).'</a>';
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>'.html_print_checkbox_extended('delete_multiple[]', $component['id_nc'], false, false, '', 'class="check_delete"', true); $data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -702,6 +707,7 @@ if (isset($data)) {
echo "<form method='post' action='index.php?sec=".$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure."'>"; echo "<form method='post' action='index.php?sec=".$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure."'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
ui_pagination($total_components, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div style='float: right; margin-left: 5px;'>"; echo "<div style='float: right; margin-left: 5px;'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';

View File

@ -189,7 +189,20 @@ if ($export_profile) {
exit; exit;
} }
$result = db_get_all_rows_in_table('tnetwork_profile', 'name'); // Prepare pagination.
$offset = (int) get_parameter('offset');
$limit = $config['block_size'];
$count_network_templates = db_get_value('count(*)', 'tnetwork_profile');
$result = db_get_all_rows_filter(
'tnetwork_profile',
[
'order' => 'name',
'limit' => $limit,
'offset' => $offset,
]
);
if ($result === false) { if ($result === false) {
$result = []; $result = [];
} }
@ -197,26 +210,31 @@ if ($result === false) {
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('Name'); $table->head[0] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[1] = __('Description'); ;
$table->head[2] = '<span style="margin-right:7%;">'.__('Action').'</span>'.html_print_checkbox('all_delete', 0, false, true, false); $table->head[1] = __('Name');
$table->head[2] = __('Description');
$table->head[3] = '<span style="margin-right:7%;">'.__('Action').'</span>';
$table->size = []; $table->size = [];
$table->size[1] = '65%'; $table->size[0] = '20px';
$table->size[2] = '15%'; $table->size[2] = '65%';
$table->size[3] = '15%';
$table->align = []; $table->align = [];
$table->align[2] = 'left'; $table->align[3] = 'left';
$table->data = []; $table->data = [];
foreach ($result as $row) { foreach ($result as $row) {
$data = []; $data = [];
$data[0] = '<a href="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates_form&amp;id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>'; $data[0] = html_print_checkbox_extended('delete_multiple[]', $row['id_np'], false, false, '', 'class="check_delete"', true);
$data[1] = ui_print_truncate_text(io_safe_output($row['description']), 'description', true, true, true, '[&hellip;]'); $data[1] = '<a href="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates_form&amp;id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>';
$data[2] = html_print_input_image( $data[2] = ui_print_truncate_text(io_safe_output($row['description']), 'description', true, true, true, '[&hellip;]');
$table->cellclass[][3] = 'action_buttons';
$data[3] = html_print_input_image(
'delete_profile', 'delete_profile',
'images/cross.png', 'images/cross.png',
$row['id_np'], $row['id_np'],
@ -224,7 +242,7 @@ foreach ($result as $row) {
true, true,
['onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;'] ['onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;']
); );
$data[2] .= html_print_input_image( $data[3] .= html_print_input_image(
'export_profile', 'export_profile',
'images/csv.png', 'images/csv.png',
$row['id_np'], $row['id_np'],
@ -232,8 +250,8 @@ foreach ($result as $row) {
true, true,
['title' => 'Export to CSV'] ['title' => 'Export to CSV']
); );
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'; $data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
$data[2] .= '&nbsp;&nbsp;<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV')]).'</a>'.html_print_checkbox_extended('delete_multiple[]', $row['id_np'], false, false, '', 'class="check_delete"', true); $data[3] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV')]).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -241,7 +259,9 @@ foreach ($result as $row) {
if (!empty($table->data)) { if (!empty($table->data)) {
echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates">'; echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates">';
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
ui_pagination($count_network_templates, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
echo "<div style='padding-left: 5px; float: right; '>"; echo "<div style='padding-left: 5px; float: right; '>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';

View File

@ -52,11 +52,13 @@ if ($update_module) {
} }
echo "<table cellpadding='4' cellspacing='4' width='100%' class='databox data'>"; echo "<table cellpadding='0' cellspacing='0' width='100%' class='info_table'>";
echo '<thead>';
echo '<th>'.__('Icon').'</th>'; echo '<th>'.__('Icon').'</th>';
echo '<th>'.__('ID').'</th>'; echo '<th>'.__('ID').'</th>';
echo '<th>'.__('Name').'</th>'; echo '<th>'.__('Name').'</th>';
echo '<th>'.__('Description').'</th>'; echo '<th>'.__('Description').'</th>';
echo '</thead';
$rows = db_get_all_rows_sql('SELECT * FROM ttipo_modulo ORDER BY nombre'); $rows = db_get_all_rows_sql('SELECT * FROM ttipo_modulo ORDER BY nombre');
if ($rows === false) { if ($rows === false) {

View File

@ -133,20 +133,22 @@ if ($filters === false) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('Name'); $table->head[0] = html_print_checkbox('all_delete', 0, false, true, false);
$table->head[1] = __('Group'); $table->head[1] = __('Name');
$table->head[2] = __('Action').html_print_checkbox('all_delete', 0, false, true, false); $table->head[2] = __('Group');
$table->head[3] = __('Action');
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold'; $table->style[1] = 'font-weight: bold';
$table->align = []; $table->align = [];
$table->size = []; $table->size = [];
$table->size[0] = '60%'; $table->size[0] = '10px';
$table->size[1] = '30%'; $table->size[1] = '60%';
$table->size[2] = '80px'; $table->size[2] = '30%';
$table->size[3] = '80px';
$table->data = []; $table->data = [];
$total_filters = db_get_all_rows_filter('tnetflow_filter', false, 'COUNT(*) AS total'); $total_filters = db_get_all_rows_filter('tnetflow_filter', false, 'COUNT(*) AS total');
@ -156,10 +158,12 @@ $total_filters = $total_filters[0]['total'];
foreach ($filters as $filter) { foreach ($filters as $filter) {
$data = []; $data = [];
$data[0] = '<a href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&id='.$filter['id_sg'].'&pure='.$pure.'">'.$filter['id_name'].'</a>'; $data[0] = html_print_checkbox_extended('delete_multiple[]', $filter['id_sg'], false, false, '', 'class="check_delete"', true);
$data[1] = ui_print_group_icon($filter['id_group'], true, 'groups_small', '', !defined('METACONSOLE')); $data[1] = '<a href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&id='.$filter['id_sg'].'&pure='.$pure.'">'.$filter['id_name'].'</a>';
$data[2] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;' $data[2] = ui_print_group_icon($filter['id_group'], true, 'groups_small', '', !defined('METACONSOLE'));
href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg']."&offset=0&pure=$pure'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'.html_print_checkbox_extended('delete_multiple[]', $filter['id_sg'], false, false, '', 'class="check_delete"', true); $table->cellclass[][3] = 'action_buttons';
$data[3] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg']."&offset=0&pure=$pure'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }

View File

@ -159,9 +159,17 @@ ui_pagination(count($graphs));
if (!empty($graphs)) { if (!empty($graphs)) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->align = []; $table->align = [];
$table->head = []; $table->head = [];
if ($report_w || $report_m) {
$table->align[5] = 'left';
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
$table->size[5] = '20px';
}
$table->head[0] = __('Graph name'); $table->head[0] = __('Graph name');
$table->head[1] = __('Description'); $table->head[1] = __('Description');
$table->head[2] = __('Number of Graphs'); $table->head[2] = __('Number of Graphs');
@ -175,7 +183,7 @@ if (!empty($graphs)) {
if ($report_w || $report_m) { if ($report_w || $report_m) {
$op_column = true; $op_column = true;
$table->align[4] = 'left'; $table->align[4] = 'left';
$table->head[4] = __('Op.').html_print_checkbox('all_delete', 0, false, true, false); $table->head[4] = __('Op.');
$table->size[4] = '90px'; $table->size[4] = '90px';
} }
@ -186,6 +194,10 @@ if (!empty($graphs)) {
foreach ($result_graphs as $graph) { foreach ($result_graphs as $graph) {
$data = []; $data = [];
if ($report_m) {
$data[5] .= html_print_checkbox_extended('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true);
}
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>'; $data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text($graph['name'], 70).'</a>';
$data[1] = ui_print_truncate_text($graph['description'], 70); $data[1] = ui_print_truncate_text($graph['description'], 70);
@ -194,15 +206,14 @@ if (!empty($graphs)) {
$data[3] = ui_print_group_icon($graph['id_group'], true); $data[3] = ui_print_group_icon($graph['id_group'], true);
$data[4] = ''; $data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (($report_w || $report_m)) { if (($report_w || $report_m)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image('images/config.png', true).'</a>'; $data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image('images/config.png', true).'</a>';
} }
$data[4] .= '&nbsp;';
if ($report_m) { if ($report_m) {
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\')) $data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>'.html_print_checkbox_extended('delete_multiple[]', $graph['id_graph'], false, false, '', 'class="check_delete" style="margin-left:2px;"', true); return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>';
} }
array_push($table->data, $data); array_push($table->data, $data);
@ -213,6 +224,7 @@ if (!empty($graphs)) {
echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>"; echo "<form method='post' style='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo "<div style='float: right;'>"; echo "<div style='float: right;'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';
@ -228,7 +240,6 @@ if (!empty($graphs)) {
} }
echo '</div>'; echo '</div>';
ui_pagination(count($graphs));
} else { } else {
include_once $config['homedir'].'/general/firts_task/custom_graphs.php'; include_once $config['homedir'].'/general/firts_task/custom_graphs.php';
} }
@ -237,8 +248,6 @@ if (!empty($graphs)) {
<script type="text/javascript"> <script type="text/javascript">
$("input[name=all_delete]").css("margin-left", "32px");
$( document ).ready(function() { $( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){ $('[id^=checkbox-delete_multiple]').change(function(){

View File

@ -327,7 +327,9 @@ echo '</tr></table>';
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
$table->head[0] = __('Map name'); $table->head[0] = __('Map name');
@ -447,6 +449,10 @@ if (!$maps && !is_metaconsole()) {
// Fix: IW was the old ACL for report editing, now is RW // Fix: IW was the old ACL for report editing, now is RW
if ($vconsoles_write || $vconsoles_manage) { if ($vconsoles_write || $vconsoles_manage) {
if (!is_metaconsole()) { if (!is_metaconsole()) {
$table->cellclass[] = [
3 => 'action_buttons',
4 => 'action_buttons',
];
$data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image('images/copy.png', true).'</a>'; $data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image('images/copy.png', true).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1">'.html_print_image('images/cross.png', true).'</a>'; $data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1">'.html_print_image('images/cross.png', true).'</a>';
} else { } else {
@ -462,6 +468,7 @@ if (!$maps && !is_metaconsole()) {
} }
html_print_table($table); html_print_table($table);
ui_pagination($total_maps, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom');
} }
if ($maps) { if ($maps) {

View File

@ -330,6 +330,12 @@ if ($items) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'databox data';
$arrow_up = 'images/sort_up.png';
$arrow_down = 'images/sort_down.png';
} else {
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
} }
$table->size = []; $table->size = [];
@ -342,18 +348,18 @@ if ($items) {
$table->head[0] = '<span title="'.__('Position').'">'.__('P.').'</span>'; $table->head[0] = '<span title="'.__('Position').'">'.__('P.').'</span>';
$table->head[1] = __('Type'); $table->head[1] = __('Type');
if (!$filterEnable) { if (!$filterEnable) {
$table->head[1] .= ' <a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=type&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image('images/sort_up.png', true, ['title' => __('Ascendent')]).'</a>'.'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=type&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image('images/sort_down.png', true, ['title' => __('Descent')]).'</a>'; $table->head[1] .= ' <span class="sort_arrow"><a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=type&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image($arrow_up, true, ['title' => __('Ascendent')]).'</a>'.'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=type&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image($arrow_down, true, ['title' => __('Descent')]).'</a></span>';
} }
$table->head[2] = __('Agent'); $table->head[2] = __('Agent');
if (!$filterEnable) { if (!$filterEnable) {
$table->head[2] .= ' <a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=agent&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image('images/sort_up.png', true, ['title' => __('Ascendent')]).'</a>'.'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=agent&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image('images/sort_down.png', true, ['title' => __('Descent')]).'</a>'; $table->head[2] .= ' <span class="sort_arrow"><a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=agent&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image($arrow_up, true, ['title' => __('Ascendent')]).'</a>'.'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=agent&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image($arrow_down, true, ['title' => __('Descent')]).'</a></span>';
} }
$table->head[3] = __('Module'); $table->head[3] = __('Module');
if (!$filterEnable) { if (!$filterEnable) {
$table->head[3] .= ' <a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=module&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image('images/sort_up.png', true, ['title' => __('Ascendent')]).'</a>'.'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=module&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image('images/sort_down.png', true, ['title' => __('Descent')]).'</a>'; $table->head[3] .= ' <span class="sort_arrow"><a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=up&field=module&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image($arrow_up, true, ['title' => __('Ascendent')]).'</a>'.'<a onclick="return message_check_sort_items();" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=order&dir=down&field=module&id_report='.$idReport.$urlFilter.'&pure='.$config['pure'].'">'.html_print_image($arrow_down, true, ['title' => __('Descent')]).'</a></span>';
} }
$table->head[4] = __('Time lapse'); $table->head[4] = __('Time lapse');
@ -493,6 +499,7 @@ foreach ($items as $item) {
$row[6] = ''; $row[6] = '';
if (check_acl($config['id_user'], $item['id_group'], 'RM')) { if (check_acl($config['id_user'], $item['id_group'], 'RM')) {
$table->cellclass[][6] = 'action_buttons';
$row[6] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=edit&id_report='.$idReport.'&id_item='.$item['id_rc'].'">'.html_print_image('images/wrench_orange.png', true, ['title' => __('Edit')]).'</a>'; $row[6] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=edit&id_report='.$idReport.'&id_item='.$item['id_rc'].'">'.html_print_image('images/wrench_orange.png', true, ['title' => __('Edit')]).'</a>';
$row[6] .= '&nbsp;'; $row[6] .= '&nbsp;';
$row[6] .= '<a onClick="if (!confirm (\'Are you sure?\')) return false;" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete&id_report='.$idReport.'&id_item='.$item['id_rc'].$urlFilter.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'; $row[6] .= '<a onClick="if (!confirm (\'Are you sure?\')) return false;" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete&id_report='.$idReport.'&id_item='.$item['id_rc'].$urlFilter.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';

View File

@ -675,7 +675,7 @@ switch ($action) {
$table = new stdClass(); $table = new stdClass();
$table->id = 'report_list'; $table->id = 'report_list';
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
@ -857,6 +857,8 @@ switch ($action) {
if ($edit || $delete) { if ($edit || $delete) {
$columnview = true; $columnview = true;
$table->cellclass[][$next] = 'action_buttons';
if (!isset($table->head[$next])) { if (!isset($table->head[$next])) {
$table->head[$next] = '<span title="Operations">'.__('Op.').'</span>'.html_print_checkbox('all_delete', 0, false, true, false); $table->head[$next] = '<span title="Operations">'.__('Op.').'</span>'.html_print_checkbox('all_delete', 0, false, true, false);
$table->size = []; $table->size = [];
@ -866,11 +868,6 @@ switch ($action) {
if ($edit) { if ($edit) {
$data[$next] = '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&pure='.$pure.'" style="display:inline">'; $data[$next] = '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&pure='.$pure.'" style="display:inline">';
$data[$next] .= html_print_input_hidden(
'id_report',
$report['id_report'],
true
);
$data[$next] .= html_print_input_image( $data[$next] .= html_print_input_image(
'edit', 'edit',
'images/config.png', 'images/config.png',
@ -879,13 +876,16 @@ switch ($action) {
true, true,
['title' => __('Edit')] ['title' => __('Edit')]
); );
$data[$next] .= html_print_input_hidden(
'id_report',
$report['id_report'],
true
);
$data[$next] .= '</form>'; $data[$next] .= '</form>';
} }
if ($delete) { if ($delete) {
$data[$next] .= '<form method="post" style="display:inline;" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">'; $data[$next] .= '<form method="post" style="display:inline;" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
$data[$next] .= html_print_input_hidden('id_report', $report['id_report'], true);
$data[$next] .= html_print_input_hidden('action', 'delete_report', true);
$data[$next] .= html_print_input_image( $data[$next] .= html_print_input_image(
'delete', 'delete',
'images/cross.png', 'images/cross.png',
@ -894,6 +894,8 @@ switch ($action) {
true, true,
['title' => __('Delete')] ['title' => __('Delete')]
); );
$data[$next] .= html_print_input_hidden('id_report', $report['id_report'], true);
$data[$next] .= html_print_input_hidden('action', 'delete_report', true);
$data[$next] .= html_print_checkbox_extended('massive_report_check', $report['id_report'], false, false, '', 'class="check_delete"', true); $data[$next] .= html_print_checkbox_extended('massive_report_check', $report['id_report'], false, false, '', 'class="check_delete"', true);
@ -920,6 +922,7 @@ switch ($action) {
} }
html_print_table($table); html_print_table($table);
ui_pagination($total_reports, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom');
} else { } else {
ui_print_info_message([ 'no_close' => true, 'message' => __('No data found.') ]); ui_print_info_message([ 'no_close' => true, 'message' => __('No data found.') ]);
} }

View File

@ -954,9 +954,10 @@ if (($create != '') || ($view != '')) {
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
echo '<table width="100%" cellspacing="4" cellpadding="4" class="databox data">'; echo '<table width="100%" cellspacing="4" cellpadding="4" class="databox data">';
} else { } else {
echo '<table width="100%" cellspacing="4" cellpadding="4" class="databox data">'; echo '<table width="100%" cellspacing="4" cellpadding="4" class="info_table">';
} }
echo '<thead><tr>';
echo '<th>'.__('Name').'</th>'; echo '<th>'.__('Name').'</th>';
echo '<th>'.__('Type').'</th>'; echo '<th>'.__('Type').'</th>';
echo '<th>'.__('Command').'</th>'; echo '<th>'.__('Command').'</th>';
@ -964,6 +965,8 @@ if (($create != '') || ($view != '')) {
echo "<th style='width: 120px;'>".'<span title="Operations">'.__('Op.').'</span>'.'</th>'; echo "<th style='width: 120px;'>".'<span title="Operations">'.__('Op.').'</span>'.'</th>';
} }
echo '</tr></thead>';
$color = 0; $color = 0;
foreach ($rows as $row) { foreach ($rows as $row) {
@ -1202,4 +1205,6 @@ ui_require_javascript_file('pandora_modules');
$('.command_macro').click(macros_click_locked_event); $('.command_macro').click(macros_click_locked_event);
} }
</script> </script>

View File

@ -40,7 +40,9 @@ if ($servers === false) {
$table = new StdClass(); $table = new StdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->size = []; $table->size = [];
$table->style = []; $table->style = [];
@ -80,7 +82,11 @@ $names_servers = [];
foreach ($servers as $server) { foreach ($servers as $server) {
$data = []; $data = [];
$table->cellclass[][3] = 'progress_bar'; // $table->cellclass[][3] = 'progress_bar';
$table->cellclass[] = [
3 => 'progress_bar',
8 => 'action_buttons',
];
$data[0] = '<span title="'.$server['version'].'">'.strip_tags($server['name']).'</span>'; $data[0] = '<span title="'.$server['version'].'">'.strip_tags($server['name']).'</span>';
// Status // Status
@ -155,7 +161,7 @@ foreach ($servers as $server) {
'style' => 'width:21px;height:21px;', 'style' => 'width:21px;height:21px;',
] ]
); );
$data[8] .= '</a>&nbsp;&nbsp;'; $data[8] .= '</a>';
} }
if ($server['type'] == 'data') { if ($server['type'] == 'data') {
@ -165,7 +171,7 @@ foreach ($servers as $server) {
true, true,
['title' => __('Reset module status and fired alert counts')] ['title' => __('Reset module status and fired alert counts')]
); );
$data[8] .= '</a>&nbsp;&nbsp;'; $data[8] .= '</a>';
} else if ($server['type'] == 'enterprise snmp') { } else if ($server['type'] == 'enterprise snmp') {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server'].'">'; $data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server'].'">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
@ -173,7 +179,7 @@ foreach ($servers as $server) {
true, true,
['title' => __('Claim back SNMP modules')] ['title' => __('Claim back SNMP modules')]
); );
$data[8] .= '</a>&nbsp;&nbsp;'; $data[8] .= '</a>';
} }
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server'].'">'; $data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server'].'">';
@ -195,7 +201,7 @@ foreach ($servers as $server) {
$names_servers[$safe_server_name] = false; $names_servers[$safe_server_name] = false;
} }
$data[8] .= '&nbsp;&nbsp;<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1">'; $data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&amp;delete=1">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/cross.png', 'images/cross.png',
true, true,

View File

@ -63,14 +63,15 @@ switch ($action) {
break; break;
} }
$table->class = 'info_table';
$table->width = '98%'; $table->width = '98%';
$table->head[0] = __('Map connection name'); $table->head[0] = __('Map connection name');
$table->head[1] = __('Group'); $table->head[1] = __('Group');
$table->head[3] = __('Delete'); $table->head[3] = __('Delete');
$table->align[1] = 'center'; $table->align[1] = 'left';
$table->align[2] = 'center'; $table->align[2] = 'left';
$table->align[3] = 'center'; $table->align[3] = 'left';
$mapsConnections = db_get_all_rows_in_table('tgis_map_connection', 'conection_name'); $mapsConnections = db_get_all_rows_in_table('tgis_map_connection', 'conection_name');
@ -84,6 +85,7 @@ if ($mapsConnections !== false) {
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection" '<a href="index.php?sec=gsetup&sec2=godmode/setup/gis&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection"
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>', onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>',
]; ];
$table->cellclass[][2] = 'action_buttons';
} }
} }

View File

@ -137,9 +137,11 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
if (empty($rows)) { if (empty($rows)) {
ui_print_info_message(['no_close' => true, 'message' => __("There isn't links") ]); ui_print_info_message(['no_close' => true, 'message' => __("There isn't links") ]);
} else { } else {
echo "<table cellpadding='4' cellspacing='4' class='databox data' style='width:100%'>"; echo "<table cellpadding='0' cellspacing='0' class='info_table' style='width:100%'>";
echo '<thead><tr>';
echo "<th width='180px'>".__('Link name').'</th>'; echo "<th width='180px'>".__('Link name').'</th>';
echo "<th width='10px'>".__('Delete').'</th>'; echo "<th width='10px'>".__('Delete').'</th>';
echo '</tr></thead>';
$color = 1; $color = 1;
foreach ($rows as $row) { foreach ($rows as $row) {
@ -152,7 +154,7 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
} }
echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=gsetup&sec2=godmode/setup/links&form_edit=1&id_link=".$row['id_link']."'>".$row['name'].'</a></b></td>'; echo "<tr><td class='$tdcolor'><b><a href='index.php?sec=gsetup&sec2=godmode/setup/links&form_edit=1&id_link=".$row['id_link']."'>".$row['name'].'</a></b></td>';
echo '<td class="'.$tdcolor.'"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row['id_link'].'&borrar='.$row['id_link'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a></td></tr>'; echo '<td class="'.$tdcolor.' action_buttons"><a href="index.php?sec=gsetup&sec2=godmode/setup/links&id_link='.$row['id_link'].'&borrar='.$row['id_link'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a></td></tr>';
} }
echo '</table>'; echo '</table>';

View File

@ -231,14 +231,15 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined news') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined news') ]);
} else { } else {
// Main list view for Links editor // Main list view for Links editor
echo "<table cellpadding='4' cellspacing='4' class='databox data' width=100%>"; echo "<table cellpadding='0' cellspacing='0' class='info_table' width=100%>";
echo '<thead><tr>';
echo '<th>'.__('Subject').'</th>'; echo '<th>'.__('Subject').'</th>';
echo '<th>'.__('Type').'</th>'; echo '<th>'.__('Type').'</th>';
echo '<th>'.__('Author').'</th>'; echo '<th>'.__('Author').'</th>';
echo '<th>'.__('Timestamp').'</th>'; echo '<th>'.__('Timestamp').'</th>';
echo '<th>'.__('Expiration').'</th>'; echo '<th>'.__('Expiration').'</th>';
echo '<th>'.__('Delete').'</th>'; echo '<th>'.__('Delete').'</th>';
echo '</tr></thead>';
$color = 1; $color = 1;
@ -276,7 +277,7 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
echo "<td class='$tdcolor'>".__('No').'</b></td>'; echo "<td class='$tdcolor'>".__('No').'</b></td>';
} }
echo '<td class="'.$tdcolor.'"><a href="index.php?sec=gsetup&sec2=godmode/setup/news&id_news='.$row['id_news'].'&borrar='.$row['id_news'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a></td></tr>'; echo '<td class="'.$tdcolor.' action_buttons"><a href="index.php?sec=gsetup&sec2=godmode/setup/news&id_news='.$row['id_news'].'&borrar='.$row['id_news'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a></td></tr>';
} }
echo '</table>'; echo '</table>';

View File

@ -25,7 +25,7 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head[0] = ''; $table->head[0] = '';
$table->head[1] = __('ID'); $table->head[1] = __('ID');
@ -37,7 +37,19 @@ $table->align[4] = 'center';
$table->size[0] = '20px'; $table->size[0] = '20px';
$table->size[4] = '20px'; $table->size[4] = '20px';
$osList = db_get_all_rows_in_table('tconfig_os'); // Prepare pagination.
$offset = (int) get_parameter('offset');
$limit = $config['block_size'];
$count_osList = db_get_value('count(*)', 'tconfig_os');
$osList = db_get_all_rows_filter(
'tconfig_os',
[
'offset' => $offset,
'limit' => $limit,
]
);
if ($osList === false) { if ($osList === false) {
$osList = []; $osList = [];
} }
@ -54,6 +66,8 @@ foreach ($osList as $os) {
} }
$data[] = ui_print_truncate_text(io_safe_output($os['description']), 'description', true, true); $data[] = ui_print_truncate_text(io_safe_output($os['description']), 'description', true, true);
$table->cellclass[][4] = 'action_buttons';
if ($os['id_os'] > 16) { if ($os['id_os'] > 16) {
if (is_metaconsole()) { if (is_metaconsole()) {
$data[] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=delete&tab2=list&id_os='.$os['id_os'].'">'.html_print_image('images/cross.png', true).'</a>'; $data[] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=delete&tab2=list&id_os='.$os['id_os'].'">'.html_print_image('images/cross.png', true).'</a>';
@ -69,7 +83,9 @@ foreach ($osList as $os) {
} }
if (isset($data)) { if (isset($data)) {
ui_pagination($count_osList, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_osList, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
} }

View File

@ -226,13 +226,13 @@ if ($edit_filter > -2) {
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->align = []; $table->align = [];
$table->head[0] = __('Description'); $table->head[0] = __('Description');
$table->head[1] = __('Filter'); $table->head[1] = __('Filter');
$table->head[2] = __('Action'); $table->head[2] = __('Action');
$table->size[2] = '50px'; $table->size[2] = '65px';
$table->align[2] = 'center'; $table->align[2] = 'center';
foreach ($aglomerate_result as $ind => $row) { foreach ($aglomerate_result as $ind => $row) {
@ -263,6 +263,7 @@ if ($edit_filter > -2) {
$data[0] = $compose_id; $data[0] = $compose_id;
$data[1] = implode(' AND ', $compose_filter); $data[1] = implode(' AND ', $compose_filter);
$data[2] = $compose_action; $data[2] = $compose_action;
$table->cellclass[][2] = 'action_buttons';
array_push($table->data, $data); array_push($table->data, $data);
} }
} }

View File

@ -191,7 +191,7 @@ if (!empty($result)) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
@ -278,12 +278,14 @@ if (!empty($result)) {
$data[5] = $output; $data[5] = $output;
$data[6] = "<a href='index.php?sec=".$sec.'&sec2=godmode/tag/edit_tag&action=update&id_tag='.$tag['id_tag']."'>".html_print_image('images/config.png', true, ['title' => 'Edit']).'</a>&nbsp;&nbsp;'; $table->cellclass[][6] = 'action_buttons';
$data[6] = "<a href='index.php?sec=".$sec.'&sec2=godmode/tag/edit_tag&action=update&id_tag='.$tag['id_tag']."'>".html_print_image('images/config.png', true, ['title' => 'Edit']).'</a>';
$data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag['id_tag'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>'; $data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag['id_tag'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
html_print_table($table); html_print_table($table);
ui_pagination($total_tags, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
} else { } else {
if (is_metaconsole()) { if (is_metaconsole()) {
ui_toggle($filter_form, __('Show Options')); ui_toggle($filter_form, __('Show Options'));

View File

@ -258,7 +258,7 @@ if ($create_profile) {
$table = new stdClass(); $table = new stdClass();
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->class = 'databox profile_list data'; $table->class = 'info_table profile_list';
$table->width = '100%'; $table->width = '100%';
$table->head = []; $table->head = [];
@ -353,8 +353,9 @@ foreach ($profiles as $profile) {
$data['VW'] = ($profile['vconsole_edit'] ? $img : ''); $data['VW'] = ($profile['vconsole_edit'] ? $img : '');
$data['VM'] = ($profile['vconsole_management'] ? $img : ''); $data['VM'] = ($profile['vconsole_management'] ? $img : '');
$data['PM'] = ($profile['pandora_management'] ? $img : ''); $data['PM'] = ($profile['pandora_management'] ? $img : '');
$table->cellclass[]['operations'] = 'action_buttons';
$data['operations'] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.html_print_image('images/config.png', true, ['title' => __('Edit')]).'</a>'; $data['operations'] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.html_print_image('images/config.png', true, ['title' => __('Edit')]).'</a>';
$data['operations'] .= '&nbsp;&nbsp;<a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile['id_perfil'].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>'; $data['operations'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile['id_perfil'].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }

View File

@ -38,13 +38,13 @@ $sort = get_parameter('sort', 'none');
$tab = get_parameter('tab', 'user'); $tab = get_parameter('tab', 'user');
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
$selected = 'border: 1px solid black;'; $selected = true;
$selectUserIDUp = ''; $selectUserIDUp = false;
$selectUserIDDown = ''; $selectUserIDDown = false;
$selectFullnameUp = ''; $selectFullnameUp = false;
$selectFullnameDown = ''; $selectFullnameDown = false;
$selectLastConnectUp = ''; $selectLastConnectUp = false;
$selectLastConnectDown = ''; $selectLastConnectDown = false;
$order = null; $order = null;
switch ($sortField) { switch ($sortField) {
@ -110,11 +110,11 @@ switch ($sortField) {
default: default:
$selectUserIDUp = $selected; $selectUserIDUp = $selected;
$selectUserIDDown = ''; $selectUserIDDown = false;
$selectFullnameUp = ''; $selectFullnameUp = false;
$selectFullnameDown = ''; $selectFullnameDown = false;
$selectLastConnectUp = ''; $selectLastConnectUp = false;
$selectLastConnectDown = ''; $selectLastConnectDown = false;
$order = [ $order = [
'field' => 'id_user', 'field' => 'id_user',
'order' => 'ASC', 'order' => 'ASC',
@ -300,11 +300,20 @@ if (defined('METACONSOLE')) {
ui_toggle($form_filter, __('Users control filter'), __('Toggle filter(s)'), !$search); ui_toggle($form_filter, __('Users control filter'), __('Toggle filter(s)'), !$search);
} }
// Urls to sort the table.
$url_up_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure;
$url_down_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure;
$url_up_name = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=fullname&sort=up&pure='.$pure;
$url_down_name = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=fullname&sort=down&pure='.$pure;
$url_up_last = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=last_connect&sort=up&pure='.$pure;
$url_down_last = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=last_connect&sort=down&pure='.$pure;
$table = new stdClass(); $table = new stdClass();
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->data = []; $table->data = [];
@ -312,9 +321,10 @@ $table->align = [];
$table->size = []; $table->size = [];
$table->valign = []; $table->valign = [];
$table->head[0] = __('User ID').' '.'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectUserIDUp]).'</a>'.'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectUserIDDown]).'</a>'; $table->head[0] = __('User ID').ui_get_sorting_arrows($url_up_id, $url_down_id, $selectUserIDUp, $selectUserIDDown);
$table->head[1] = __('Name').' '.'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=fullname&sort=up&pure='.$pure.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectFullnameUp ]).'</a>'.'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=fullname&sort=down&pure='.$pure.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectFullnameDown]).'</a>'; $table->head[1] = __('Name').ui_get_sorting_arrows($url_up_name, $url_down_name, $selectFullnameUp, $selectFullnameDown);
$table->head[2] = __('Last contact').' '.'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=last_connect&sort=up&pure='.$pure.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectLastConnectUp ]).'</a>'.'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=last_connect&sort=down&pure='.$pure.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectLastConnectDown]).'</a>'; $table->head[2] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastConnectUp, $selectLastConnectDown);
$table->head[3] = __('Admin'); $table->head[3] = __('Admin');
$table->head[4] = __('Profile / Group'); $table->head[4] = __('Profile / Group');
$table->head[5] = __('Description'); $table->head[5] = __('Description');
@ -514,6 +524,7 @@ foreach ($info as $user_id => $user_info) {
$data[5] = ui_print_string_substr($user_info['comments'], 24, true); $data[5] = ui_print_string_substr($user_info['comments'], 24, true);
$table->cellclass[][6] = 'action_buttons';
if ($user_info['disabled'] == 0) { if ($user_info['disabled'] == 0) {
$data[6] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;disable_user=1&pure='.$pure.'&amp;id='.$user_info['id_user'].'">'.html_print_image('images/lightbulb.png', true, ['title' => __('Disable')]).'</a>'; $data[6] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/user_list&amp;disable_user=1&pure='.$pure.'&amp;id='.$user_info['id_user'].'">'.html_print_image('images/lightbulb.png', true, ['title' => __('Disable')]).'</a>';
} else { } else {
@ -535,6 +546,7 @@ foreach ($info as $user_id => $user_info) {
} }
html_print_table($table); html_print_table($table);
ui_pagination(count($info), false, 0, 0, false, 'offset', true, 'pagination-bottom');
echo '<div style="width: '.$table->width.'" class="action-buttons">'; echo '<div style="width: '.$table->width.'" class="action-buttons">';
unset($table); unset($table);

View File

@ -96,8 +96,20 @@ class DiscoveryTaskList extends Wizard
] ]
); );
// Header // Header.
ui_print_page_header(__('Task list'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true)); ui_print_page_header(
__('Task list'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
// Show redirected messages from discovery.php. // Show redirected messages from discovery.php.
if ($status === 0) { if ($status === 0) {
@ -352,10 +364,10 @@ class DiscoveryTaskList extends Wizard
$url_ajax = $config['homeurl'].'ajax.php'; $url_ajax = $config['homeurl'].'ajax.php';
$table = new StdClass(); $table = new StdClass();
$table->cellpadding = 4; $table->cellpadding = 0;
$table->cellspacing = 4; $table->cellspacing = 0;
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->data = []; $table->data = [];
$table->align = []; $table->align = [];
@ -404,16 +416,31 @@ class DiscoveryTaskList extends Wizard
// Exceptions: IPAM. // Exceptions: IPAM.
$ipam = false; $ipam = false;
if ($task['id_recon_script'] != null) { if ($task['id_recon_script'] != null) {
$recon_script_name = db_get_value('name', 'trecon_script', 'id_recon_script', $task['id_recon_script']); $recon_script_data = db_get_row(
'trecon_script',
'id_recon_script',
$task['id_recon_script']
);
if ($recon_script_data !== false) {
$recon_script_name = $recon_script_data['name'];
if (io_safe_output($recon_script_name) == 'IPAM Recon' if (io_safe_output($recon_script_name) == 'IPAM Recon'
&& enterprise_installed() && enterprise_installed()
) { ) {
$subnet_obj = json_decode($task['macros'], true); $subnet_obj = json_decode($task['macros'], true);
$subnet = $subnet_obj['1']['value']; $subnet = $subnet_obj['1']['value'];
$tipam_task_id = db_get_value('id', 'tipam_network', 'id_recon_task', $task['id_rt']); $tipam_task_id = db_get_value(
'id',
'tipam_network',
'id_recon_task',
$task['id_rt']
);
$ipam = true; $ipam = true;
} }
} }
} else {
$recon_script_data = false;
$recon_script_name = false;
}
if ($task['disabled'] == 0 && $server_name !== '') { if ($task['disabled'] == 0 && $server_name !== '') {
$data[0] = '<a href="'.ui_get_full_url( $data[0] = '<a href="'.ui_get_full_url(
@ -464,15 +491,56 @@ class DiscoveryTaskList extends Wizard
} }
if ($task['id_recon_script'] == 0) { if ($task['id_recon_script'] == 0) {
// Internal discovery task.
switch ($task['type']) {
case DISCOVERY_CLOUD_AWS_RDS:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Cloud RDS')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.Cloud.Aws.RDS');
break;
case DISCOVERY_APP_MYSQL:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications MySQL')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.MySQL');
break;
case DISCOVERY_APP_ORACLE:
// Discovery Applications Oracle.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications Oracle')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_HOSTDEVICES:
default:
// Discovery NetScan. // Discovery NetScan.
$data[6] = html_print_image( $data[6] = html_print_image(
'images/network.png', 'images/network.png',
true, true,
['title' => __('Discovery NetScan')] ['title' => __('Discovery NetScan')]
).'&nbsp;&nbsp;'; ).'&nbsp;&nbsp;';
$data[6] .= network_profiles_get_name( $str = network_profiles_get_name(
$task['id_network_profile'] $task['id_network_profile']
); );
if (!empty($str)) {
$data[6] .= $str;
} else {
$data[6] .= __('Discovery.NetScan');
}
break;
}
} else { } else {
// APP recon task. // APP recon task.
$data[6] = html_print_image( $data[6] = html_print_image(
@ -512,7 +580,11 @@ class DiscoveryTaskList extends Wizard
$data[9] .= '</a>'; $data[9] .= '</a>';
} }
if ($task['disabled'] != 2 && $task['utimestamp'] > 0) { if ($task['disabled'] != 2 && $task['utimestamp'] > 0
&& $task['type'] != DISCOVERY_APP_MYSQL
&& $task['type'] != DISCOVERY_APP_ORACLE
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
) {
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">'; $data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image( $data[9] .= html_print_image(
'images/dynamic_network_icon.png', 'images/dynamic_network_icon.png',
@ -548,7 +620,7 @@ class DiscoveryTaskList extends Wizard
$data[9] .= '<a href="'.ui_get_full_url( $data[9] .= '<a href="'.ui_get_full_url(
sprintf( sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d', 'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
$this->getTargetWiz($task), $this->getTargetWiz($task, $recon_script_data),
$task['id_rt'] $task['id_rt']
) )
).'">'.html_print_image( ).'">'.html_print_image(
@ -566,6 +638,8 @@ class DiscoveryTaskList extends Wizard
$data[9] = ''; $data[9] = '';
} }
$table->cellclass[][9] = 'action_buttons';
// Div neccesary for modal progress task. // Div neccesary for modal progress task.
echo '<div id="progress_task_'.$task['id_rt'].'" style="display:none"></div>'; echo '<div id="progress_task_'.$task['id_rt'].'" style="display:none"></div>';
@ -607,27 +681,48 @@ class DiscoveryTaskList extends Wizard
* Return target url sub-string to edit target task. * Return target url sub-string to edit target task.
* *
* @param array $task With all data. * @param array $task With all data.
* @param array $script With all script data or false if undefined.
* *
* @return string * @return string
*/ */
public function getTargetWiz($task) public function getTargetWiz($task, $script=false)
{ {
// TODO: Do not use description. Use recon_script ID instead. if ($script !== false) {
switch ($task['description']) { switch ($script['type']) {
case 'Discovery.Application.VMware': case DISCOVERY_SCRIPT_CLOUD_AWS:
return 'wiz=app&mode=vmware&page=0';
case CLOUDWIZARD_AWS_DESCRIPTION:
return 'wiz=cloud&mode=amazonws&page=1'; return 'wiz=cloud&mode=amazonws&page=1';
case 'console_task': case DISCOVERY_SCRIPT_APP_VMWARE:
return 'wiz=ctask'; return 'wiz=app&mode=vmware&page=0';
case DISCOVERY_SCRIPT_IPAM_RECON:
return '';
case DISCOVERY_SCRIPT_IPMI_RECON:
default:
return 'wiz=hd&mode=customnetscan';
}
}
switch ($task['type']) {
case DISCOVERY_APP_MYSQL:
return 'wiz=app&mode=mysql&page=0';
case DISCOVERY_APP_ORACLE:
return 'wiz=app&mode=oracle&page=0';
case DISCOVERY_CLOUD_AWS:
case DISCOVERY_CLOUD_AWS_EC2:
return 'wiz=cloud&mode=amazonws&page=1';
case DISCOVERY_CLOUD_AWS_RDS:
return 'wiz=cloud&mode=amazonws&sub=rds&page=0';
default: default:
if ($task['id_recon_script'] === null) { if ($task['description'] == 'console_task') {
return 'wiz=hd&mode=netscan'; return 'wiz=ctask';
} else { } else {
return 'wiz=hd&mode=customnetscan'; return 'wiz=hd&mode=netscan';
} }
break; break;
} }

View File

@ -149,7 +149,8 @@ class HostDevices extends Wizard
), ),
'label' => __('Discovery'), 'label' => __('Discovery'),
], ],
] ],
true
); );
ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true)); ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
@ -533,7 +534,19 @@ class HostDevices extends Wizard
if ($this->page < $this->maxPagesNetScan) { if ($this->page < $this->maxPagesNetScan) {
// Avoid to print header out of wizard. // Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum); $this->prepareBreadcrum($breadcrum);
ui_print_page_header(__('NetScan'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true)); ui_print_page_header(
__('NetScan'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
} }
if (isset($this->page) === true if (isset($this->page) === true
@ -581,48 +594,48 @@ class HostDevices extends Wizard
if (isset($this->page) === false if (isset($this->page) === false
|| $this->page == 0 || $this->page == 0
) { ) {
$form = [];
// Input task name. // Comment input
$form['inputs'][] = [ $comment_input ='<div class="label_select"><label>'.__('Comment').':</label></div>';
'label' => '<b>'.__('Task name').'</b>',
'arguments' => [ $comment_input .= $this->printInput([
'name' => 'comment',
'rows' => 1,
'columns' => 1,
'value' => $this->task['description'],
'type' => 'textarea',
'size' => 25,
'class' => 'discovery_textarea_input',
'return' => true
]);
// Task input
$taskname_input_label = '<div class="label_select"><label>'.__('Task name').':</label></div>';
$taskname_input = $this->printInput([
'name' => 'taskname', 'name' => 'taskname',
'value' => $this->task['name'], 'value' => $this->task['name'],
'type' => 'text', 'type' => 'text',
'size' => 25, 'size' => 25,
], 'class' => 'discovery_full_width_input'
]; ]);
if (isset($this->task['id_rt']) === true) { // Network input
// Propagate id. $network_input_label .= '<div class="label_select discovery_label_hint"><label>'.__('Network').':</label>'.ui_print_help_tip(__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'), true).'</div>';
$form['inputs'][] = [
'arguments' => [
'name' => 'task',
'value' => $this->task['id_rt'],
'type' => 'hidden',
],
];
}
// Input task name. $network_input = $this->printInput([
$form['inputs'][] = [ 'name' => 'network',
'label' => '<b>'.__('Comment').'</b>', 'value' => $this->task['subnet'],
'arguments' => [
'name' => 'comment',
'value' => $this->task['description'],
'type' => 'text', 'type' => 'text',
'size' => 25, 'size' => 25,
], 'class' => 'discovery_full_width_input',
]; ]);
// Input Discovery Server.
$form['inputs'][] = [ // Discovery server input
'label' => '<b>'.__('Discovery server').'</b>'.ui_print_help_tip( $discovery_server_select_label = '<div class="label_select discovery_label_hint"><label>'.__('Discovery server').':</label>'.ui_print_help_tip(__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'), true).'</div>';
__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'),
true $discovery_server_select = $this->printInput([
),
'arguments' => [
'type' => 'select_from_sql', 'type' => 'select_from_sql',
'sql' => sprintf( 'sql' => sprintf(
'SELECT id_server, name 'SELECT id_server, name
@ -634,50 +647,18 @@ class HostDevices extends Wizard
'name' => 'id_recon_server', 'name' => 'id_recon_server',
'selected' => $this->task['id_recon_server'], 'selected' => $this->task['id_recon_server'],
'return' => true, 'return' => true,
], 'style' => 'width: 100%',
]; ]);
// Input Network. // Interval input
$form['inputs'][] = [
'label' => '<b>'.__('Network').'</b>'.ui_print_help_tip(
__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'),
true
),
'arguments' => [
'name' => 'network',
'value' => $this->task['subnet'],
'type' => 'text',
'size' => 25,
],
];
// Input Group.
$form['inputs'][] = [
'label' => '<b>'.__('Group').'</b>',
'arguments' => [
'name' => 'id_group',
'returnAllGroup' => false,
'privilege' => 'PM',
'type' => 'select_groups',
'selected' => $this->task['id_group'],
'return' => true,
],
];
// Interval and schedules.
$interv_manual = 0; $interv_manual = 0;
if ((int) $this->task['interval_sweep'] == 0) { if ((int) $this->task['interval_sweep'] == 0) {
$interv_manual = 1; $interv_manual = 1;
} }
// Schedule. $interval_input_label = '<div class="label_select discovery_label_hint" style="padding-top: 6px;"><label>'.__('Interval').':</label>'.ui_print_help_tip(__('Manual interval means that it will run only on demand.'), true).'</div>';
$form['inputs'][] = [
'label' => '<b>'.__('Interval').'</b>'.ui_print_help_tip( $interval_input = $this->printInput([
__('Manual interval means that it will be executed only On-demand'),
true
),
'arguments' => [
'type' => 'select', 'type' => 'select',
'selected' => $interv_manual, 'selected' => $interv_manual,
'fields' => [ 'fields' => [
@ -686,8 +667,10 @@ class HostDevices extends Wizard
], ],
'name' => 'interval_manual_defined', 'name' => 'interval_manual_defined',
'return' => true, 'return' => true,
], 'style' => 'float: right;'
'extra' => '<span id="interval_manual_container">'.html_print_extended_select_for_time( ]);
$interval_input_extra = '<span id="interval_manual_container">'.html_print_extended_select_for_time(
'interval', 'interval',
$this->task['interval_sweep'], $this->task['interval_sweep'],
'', '',
@ -700,36 +683,38 @@ class HostDevices extends Wizard
).ui_print_help_tip( ).ui_print_help_tip(
__('The minimum recomended interval for Recon Task is 5 minutes'), __('The minimum recomended interval for Recon Task is 5 minutes'),
true true
).'</span>', ).'</span>';
];
$str = __('Next');
// Group select
$group_select = '<div class="label_select"><label>'.__('Group').':</label></div>';
$group_select .= $this->printInput([
'name' => 'id_group',
'returnAllGroup' => false,
'privilege' => 'PM',
'type' => 'select_groups',
'selected' => $this->task['id_group'],
'return' => true,
'class' => 'discovery_list_input',
'size' => 9,
'simple_multiple_options' => true,
]);
if (isset($this->task['id_rt']) === true) { if (isset($this->task['id_rt']) === true) {
$str = __('Update and continue'); //Propagate ID
$task_hidden = $this->printInput([
'name' => 'task',
'value' => $this->task['id_rt'],
'type' => 'hidden'
]);
} }
// Submit button.
$form['inputs'][] = [
'arguments' => [
'name' => 'submit',
'label' => $str,
'type' => 'submit',
'attributes' => 'class="sub next"',
'return' => true,
],
];
$task_url = ''; $task_url = '';
if (isset($this->task['id_rt'])) { if (isset($this->task['id_rt'])) {
$task_url = '&task='.$this->task['id_rt']; $task_url = '&task='.$this->task['id_rt'];
} }
$form['form'] = [
'method' => 'POST',
'action' => $this->url.'&mode=netscan&page='.($this->page + 1).$task_url,
];
// Default. // Default.
$interval = 600; $interval = 600;
$unit = 60; $unit = 60;
@ -738,7 +723,46 @@ class HostDevices extends Wizard
$unit = $this->getTimeUnit($interval); $unit = $this->getTimeUnit($interval);
} }
$form['js'] = ' // XXX: Could be improved validating inputs before continue (JS)
// Print NetScan page 0.
//$this->printForm($form);
echo '<form action="'.$this->url.'&mode=netscan&page='.($this->page + 1).$task_url.'" method="POST">';
echo $task_hidden;
echo '<div class="white_box">
<div class="edit_discovery_info" style="margin-bottom: 15px;">
<div style="width: 25%; padding: 9px;">'
.'<div style="height: 50%; margin-bottom: 35px;">'.html_print_image ("images/wizard/netscan_green.png", true, array ("title" => __('Close'), "style" => 'width: 60%;'), false).'</div>'
.'<div class="edit_discovery_input"><div style="display: flex;">'.$interval_input_label.'<div style="margin-left: 15 px; width: 50%;">'.$interval_input.'</div></div>'.$interval_input_extra.'</div>'
.'</div>
<div style="width: 40%; padding-left: 5%; padding-right: 12%;">
<div class="edit_discovery_input">'.$taskname_input_label.'<div class="discovery_text_input">'.$taskname_input.'</div></div>'
.'<div class="edit_discovery_input discovery_select_input">'.$discovery_server_select_label.$discovery_server_select.'<div class="discovery_hint"></div></div>'
.'<div class="edit_discovery_input">'.$network_input_label.'<div class="discovery_text_input">'.$network_input.'</div></div>'
.'</div>'
.'<div style="width: 35%;">'.$group_select.'</div>'
.'</div>'
.'<div class="edit_discovery_info">
<div style="width: 100%;">
'.$comment_input.'
</div>
</div>'
.'</div>';
$str = __('Next');
if (isset($this->task['id_rt']) === true) {
$str = __('Update and continue');
}
echo '<div class="action-buttons" style="width: 100%; margin-top: 10px;">'.html_print_submit_button($str, 'submit', false, 'class="sub next"', true).'</div>';
echo '</form>';
echo '<script>
$("select#interval_manual_defined").change(function() { $("select#interval_manual_defined").change(function() {
if ($("#interval_manual_defined").val() == 1) { if ($("#interval_manual_defined").val() == 1) {
$("#interval_manual_container").hide(); $("#interval_manual_container").hide();
@ -751,11 +775,10 @@ $("select#interval_manual_defined").change(function() {
$("#hidden-interval").val('.$interval.'); $("#hidden-interval").val('.$interval.');
$("#interval_units").val('.$unit.'); $("#interval_units").val('.$unit.');
} }
}).change();'; }).change();
</script>';
// XXX: Could be improved validating inputs before continue (JS)
// Print NetScan page 0.
$this->printForm($form);
} }
} }
@ -783,7 +806,7 @@ $("select#interval_manual_defined").change(function() {
]; ];
$form['inputs'][] = [ $form['inputs'][] = [
'extra' => '<p>Please, configure task <b>'.io_safe_output($this->task['name']).'</b></p>', 'extra' => '<p><h3>Please, configure task <b>'.io_safe_output($this->task['name']).'</b></h3></p>',
]; ];
// Input: Module template. // Input: Module template.
@ -799,7 +822,6 @@ $("select#interval_manual_defined").change(function() {
'selected' => $this->task['id_network_profile'], 'selected' => $this->task['id_network_profile'],
'nothing_value' => 0, 'nothing_value' => 0,
'nothing' => __('None'), 'nothing' => __('None'),
], ],
]; ];
@ -850,7 +872,7 @@ $("select#interval_manual_defined").change(function() {
'action' => $this->url.'&mode=netscan&page='.($this->page + 1).'&task='.$this->task['id_rt'], 'action' => $this->url.'&mode=netscan&page='.($this->page + 1).'&task='.$this->task['id_rt'],
]; ];
$this->printForm($form); $this->printForm($form, false, true);
} }
if ($this->page == 2) { if ($this->page == 2) {

View File

@ -191,21 +191,19 @@ class Wizard
* Builder for breadcrum * Builder for breadcrum
* *
* @param array $urls Array of urls to be stored in breadcrum. * @param array $urls Array of urls to be stored in breadcrum.
* @param boolean $add True if breadcrum should be added instead of * @param boolean $add True if breadcrum should be added
* overwrite it. * instead of overwrite it.
* *
* @return void * @return void
*/ */
public function prepareBreadcrum(array $urls, bool $add=false, bool $separator_beginning=false) public function prepareBreadcrum(
{ array $urls,
bool $add=false
) {
$bc = []; $bc = [];
$i = 0; $i = 0;
$count = 0;
$array_size = count($urls);
foreach ($urls as $url) { foreach ($urls as $url) {
$count++;
if ($url['selected'] == 1) { if ($url['selected'] == 1) {
$class = 'selected'; $class = 'selected';
} else { } else {
@ -213,20 +211,10 @@ class Wizard
} }
$bc[$i] = ''; $bc[$i] = '';
if ($separator_beginning === true) {
$bc[$i] .= '<span class="breadcrumb_link">&nbsp/&nbsp</span>';
}
$bc[$i] .= '<span><a class="breadcrumb_link '.$class.'" href="'.$url['link'].'">'; $bc[$i] .= '<span><a class="breadcrumb_link '.$class.'" href="'.$url['link'].'">';
$bc[$i] .= $url['label']; $bc[$i] .= $url['label'];
$bc[$i] .= '</a>'; $bc[$i] .= '</a>';
if ($count < $array_size) {
$bc[$i] .= '<span class="breadcrumb_link">&nbsp/&nbsp</span>';
}
$bc[$i] .= '</span>'; $bc[$i] .= '</span>';
$i++; $i++;
} }
@ -235,7 +223,6 @@ class Wizard
} else { } else {
$this->setBreadcrum($bc); $this->setBreadcrum($bc);
} }
} }
@ -275,7 +262,10 @@ class Wizard
*/ */
public function printBreadcrum() public function printBreadcrum()
{ {
return implode('', $this->breadcrum); return implode(
'<span class="breadcrumb_link">&nbsp/&nbsp</span>',
$this->breadcrum
);
} }
@ -483,7 +473,9 @@ class Wizard
((isset($data['keys_field']) === true) ? $data['keys_field'] : 'id_grupo'), ((isset($data['keys_field']) === true) ? $data['keys_field'] : 'id_grupo'),
((isset($data['strict_user']) === true) ? $data['strict_user'] : false), ((isset($data['strict_user']) === true) ? $data['strict_user'] : false),
((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false), ((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false),
((isset($data['include_groups']) === true) ? $data['include_groups'] : false) ((isset($data['include_groups']) === true) ? $data['include_groups'] : false),
((isset($data['size']) === true) ? $data['size'] : false),
((isset($data['simple_multiple_options']) === true) ? $data['simple_multiple_options'] : false)
); );
case 'submit': case 'submit':
@ -640,7 +632,7 @@ class Wizard
* *
* @return string HTML code. * @return string HTML code.
*/ */
public function printForm(array $data, bool $return=false) public function printForm(array $data, bool $return=false, bool $print_white_box=false)
{ {
$form = $data['form']; $form = $data['form'];
$inputs = $data['inputs']; $inputs = $data['inputs'];
@ -666,13 +658,27 @@ class Wizard
error_log('Error executing wizard callback: ', $e->getMessage()); error_log('Error executing wizard callback: ', $e->getMessage());
} }
$output = '<ul class="wizard">'; $output_submit = '';
$output = '';
if ($print_white_box === true)
$output .= '<div class="white_box">';
$output .= '<ul class="wizard">';
foreach ($inputs as $input) { foreach ($inputs as $input) {
if ($input['arguments']['type']!='submit')
$output .= $this->printBlock($input, true); $output .= $this->printBlock($input, true);
else
$output_submit .= $this->printBlock($input, true);
} }
$output .= '</ul>'; $output .= '</ul>';
if ($print_white_box === true)
$output .= '</div>';
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
$output .= '</form>'; $output .= '</form>';
$output .= '<script>'.$js.'</script>'; $output .= '<script>'.$js.'</script>';

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -527,19 +527,19 @@ if (check_login()) {
$show_notinit = (int) get_parameter('show_notinit', 0); $show_notinit = (int) get_parameter('show_notinit', 0);
$cluster_list = (int) get_parameter('cluster_list', 0); $cluster_list = (int) get_parameter('cluster_list', 0);
$url = 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agent; $url = 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agent;
$selectTypeUp = ''; $selectTypeUp = false;
$selectTypeDown = ''; $selectTypeDown = false;
$selectNameUp = ''; $selectNameUp = false;
$selectNameDown = ''; $selectNameDown = false;
$selectStatusUp = ''; $selectStatusUp = false;
$selectStatusDown = ''; $selectStatusDown = false;
$selectDataUp = ''; $selectDataUp = false;
$selectDataDown = ''; $selectDataDown = false;
$selectLastContactUp = ''; $selectLastContactUp = false;
$selectLastContactDown = ''; $selectLastContactDown = false;
$sortField = get_parameter('sort_field'); $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$selected = 'border: 1px solid black;'; $selected = true;
$order[] = [ $order[] = [
'field' => 'tmodule_group.name', 'field' => 'tmodule_group.name',
@ -627,16 +627,16 @@ if (check_login()) {
break; break;
default: default:
$selectTypeUp = ''; $selectTypeUp = false;
$selectTypeDown = ''; $selectTypeDown = false;
$selectNameUp = $selected; $selectNameUp = $selected;
$selectNameDown = ''; $selectNameDown = false;
$selectStatusUp = ''; $selectStatusUp = false;
$selectStatusDown = ''; $selectStatusDown = false;
$selectDataUp = ''; $selectDataUp = false;
$selectDataDown = ''; $selectDataDown = false;
$selectLastContactUp = ''; $selectLastContactUp = false;
$selectLastContactDown = ''; $selectLastContactDown = false;
$order[] = [ $order[] = [
'field' => 'tagente_modulo.nombre', 'field' => 'tagente_modulo.nombre',
@ -756,11 +756,22 @@ if (check_login()) {
$modules = []; $modules = [];
} }
// Urls to sort the table.
$url_up_type = $url.'&sort_field=type&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_down_type = $url.'&sort_field=type&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_up_name = $url.'&sort_field=name&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_down_name = $url.'&sort_field=name&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_up_status = $url.'&sort_field=status&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_down_status = $url.'&sort_field=status&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_up_last = $url.'&sort_field=last_contact&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$url_down_last = $url.'&sort_field=last_contact&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group;
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->cellpadding = 4; $table->cellpadding = 0;
$table->cellspacing = 4; $table->cellspacing = 0;
$table->class = 'databox data'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->data = []; $table->data = [];
@ -773,17 +784,15 @@ if (check_login()) {
$table->head[1] = "<span title='".__('Policy')."'>".__('P.').'</span>'; $table->head[1] = "<span title='".__('Policy')."'>".__('P.').'</span>';
} }
$table->head[2] = __('Type').' '.'<a href="'.$url.'&sort_field=type&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectTypeUp, 'alt' => 'up']).'</a>'.'<a href="'.$url.'&sort_field=type&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectTypeDown, 'alt' => 'down']).'</a>'; $table->head[2] = __('Type').ui_get_sorting_arrows($url_up_type, $url_down_type, $selectTypeUp, $selectTypeDown);
$table->head[3] = __('Module name').' '.'<a href="'.$url.'&sort_field=name&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp, 'alt' => 'up']).'</a>'.'<a href="'.$url.'&sort_field=name&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown, 'alt' => 'down']).'</a>'; $table->head[3] = __('Module name').ui_get_sorting_arrows($url_up_name, $url_down_name, $selectNameUp, $selectNameDown);
$table->head[4] = __('Description'); $table->head[4] = __('Description');
$table->head[5] = __('Status').' '.'<a href="'.$url.'&sort_field=status&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp, 'alt' => 'up']).'</a>'.'<a href="'.$url.'&sort_field=status&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectStatusDown, 'alt' => 'down']).'</a>'; $table->head[5] = __('Status').ui_get_sorting_arrows($url_up_status, $url_down_status, $selectStatusUp, $selectStatusDown);
$table->head[6] = __('Thresholds'); $table->head[6] = __('Thresholds');
$table->head[7] = __('Data'); $table->head[7] = __('Data');
$table->head[8] = __('Graph'); $table->head[8] = __('Graph');
$table->headstyle[8] = 'min-width: 60px'; $table->headstyle[8] = 'min-width: 60px';
$table->head[9] = __('Last contact').' '.'<a href="'.$url.'&sort_field=last_contact&amp;sort=up&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_up.png', true, ['style' => $selectLastContactUp, 'alt' => 'up']).'</a>'.'<a href="'.$url.'&sort_field=last_contact&amp;sort=down&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.' &status_text_monitor='.$status_text_monitor.'&status_module_group= '.$status_module_group.'">'.html_print_image('images/sort_down.png', true, ['style' => $selectLastContactDown, 'alt' => 'down']).'</a>'; $table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown);
$table->align = [ $table->align = [
'left', 'left',
'left', 'left',
@ -896,7 +905,7 @@ if (check_login()) {
$data[2] = servers_show_type($module['id_modulo']).'&nbsp;'; $data[2] = servers_show_type($module['id_modulo']).'&nbsp;';
if (check_acl($config['id_user'], $id_grupo, 'AW')) { if (check_acl($config['id_user'], $id_grupo, 'AW')) {
$data[2] .= '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'">'.html_print_image('images/config.png', true, ['alt' => '0', 'border' => '', 'title' => __('Edit')]).'</a>'; $data[2] .= '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'">'.html_print_image('images/config.png', true, ['alt' => '0', 'border' => '', 'title' => __('Edit'), 'class' => 'action_button_img']).'</a>';
} }
@ -1199,7 +1208,7 @@ if (check_login()) {
false, false,
'offset', 'offset',
true, true,
'', 'pagination-bottom',
'pagination_list_modules(offset_param)', 'pagination_list_modules(offset_param)',
[ [
'count' => '', 'count' => '',

View File

@ -45,23 +45,25 @@ if ($progress_task_discovery) {
$result = '<div id = progress_task_'.$id_task.'>'; $result = '<div id = progress_task_'.$id_task.'>';
if ($task['utimestamp']) { if ($task['utimestamp']) {
$result .= '<ul class="progress_task_discovery">'; $result .= '<div style="display: flex;">';
$result .= '<li><h1>'._('Overall Progress').'</h1></li>'; $result .= '<div style="width: 100%; text-align: center; margin-top: 40px;">';
$result .= '<li>'; $result .= '<span style="font-size: 1.9em; font-family: "lato-bolder", "Open Sans", sans-serif !important;">'._('Overall Progress').'</span>';
$result .= d3_progress_bar(
$result .= '<div style="margin-top: 25px;">';
$result .= progress_circular_bar(
$id_task, $id_task,
($global_progress < 0) ? 100 : $global_progress, ($global_progress < 0) ? 100 : $global_progress,
460, 200,
30, 200,
'#EA5434', '#7eb641',
'%', '%',
'', '',
'#FFFFFF', '#3A3A3A',
0,
0,
0 0
); );
$result .= '</div>';
if ($global_progress > 0) { if ($global_progress > 0) {
switch ($summary['step']) { switch ($summary['step']) {
case STEP_SCANNING: case STEP_SCANNING:
@ -85,28 +87,28 @@ if ($progress_task_discovery) {
break; break;
} }
$result .= '</li>'; $result .= '</div>';
$result .= '<li><h1>'.$str.' '; $result .= '<div style="width: 100%; text-align: center; margin-top: 40px;">';
$result .= '<span style="font-size: 1.9em; font-family: "lato-bolder", "Open Sans", sans-serif !important;">'.$str.' ';
$result .= $summary['c_network_name']; $result .= $summary['c_network_name'];
$result .= '</h1></li>'; $result .= '</span>';
$result .= '<li>';
$result .= d3_progress_bar( $result .= '<div style="margin-top: 25px;">';
$result .= progress_circular_bar(
$id_task.'_detail', $id_task.'_detail',
$summary['c_network_percent'], $summary['c_network_percent'],
460, 200,
30, 200,
'#2751E1', '#7eb641',
'%', '%',
'', '',
'#FFFFFF', '#3A3A3A',
0,
0,
0 0
); );
$result .= '</li>'; $result .= '</div></div>';
} }
$result .= '</ul>'; $result .= '</div></div>';
$i = 0; $i = 0;
$table = new StdClasS(); $table = new StdClasS();
@ -142,6 +144,7 @@ if ($progress_task_discovery) {
$table->data[$i][1] .= $summary['summary']['WMI']; $table->data[$i][1] .= $summary['summary']['WMI'];
$table->data[$i++][1] .= '</span>'; $table->data[$i++][1] .= '</span>';
$result .= '<div style="margin-top: 40px; text-align: center;"><span style="font-size: 1.9em; font-family: "lato-bolder", "Open Sans", sans-serif !important;">'.__('Summary').'</span></div>';
$result .= html_print_table($table, true).'</div>'; $result .= html_print_table($table, true).'</div>';
} else { } else {
$global_progress = -1; $global_progress = -1;

Some files were not shown because too many files have changed in this diff Show More