Fixed monitor details search by module name and module group. Ticket #4025
This commit is contained in:
parent
9ea430cfc1
commit
eaa98269b2
|
@ -2340,7 +2340,19 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
|
|||
return $return;
|
||||
}
|
||||
else {
|
||||
// For each server defined and not disabled:
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$sql = 'SELECT distinct(tagente_modulo.nombre)
|
||||
'. $sql_from . $sql_conditions;
|
||||
break;
|
||||
case 'oracle':
|
||||
$sql = 'SELECT DISTINCT(tagente_modulo.nombre)' .
|
||||
$sql_from . $sql_conditions;
|
||||
break;
|
||||
}
|
||||
|
||||
// For each server defined and not disabled:h
|
||||
$servers = db_get_all_rows_sql ('SELECT *
|
||||
FROM tmetaconsole_setup
|
||||
WHERE disabled = 0');
|
||||
|
@ -2349,6 +2361,7 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
|
|||
$servers = array();
|
||||
|
||||
$result = array();
|
||||
$modules = array();
|
||||
foreach($servers as $server) {
|
||||
// If connection was good then retrieve all data server
|
||||
if (metaconsole_connect($server) == NOERR) {
|
||||
|
@ -2357,7 +2370,6 @@ function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = fal
|
|||
else {
|
||||
$connection = false;
|
||||
}
|
||||
|
||||
// Get all info for filters of all nodes
|
||||
$modules_temp = db_get_all_rows_sql($sql);
|
||||
|
||||
|
|
|
@ -113,8 +113,7 @@ if (!is_metaconsole()) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if ($ag_group !== 0 && check_acl ($config['id_user'], $id_ag_group, 'AR')) {
|
||||
if (((int)$ag_group !== 0) && (check_acl ($config['id_user'], $id_ag_group, 'AR'))) {
|
||||
$sql_conditions_group = sprintf (' AND tagente.id_grupo IN (%s) ', $ag_group);
|
||||
}
|
||||
elseif ($user_groups != '') {
|
||||
|
@ -126,8 +125,7 @@ else {
|
|||
// Module group
|
||||
if (is_metaconsole()) {
|
||||
if ($modulegroup != '-1')
|
||||
$sql_conditions .= sprintf (' AND tagente_modulo.id_module_group IN (SELECT id_mg
|
||||
FROM tmodule_group WHERE name = \'%s\')', $modulegroup);
|
||||
$sql_conditions .= sprintf (' AND tagente_modulo.id_module_group IN (%s)', $modulegroup);
|
||||
}
|
||||
else if ($modulegroup > -1) {
|
||||
$sql_conditions .= sprintf (' AND tagente_modulo.id_module_group = \'%d\'', $modulegroup);
|
||||
|
@ -295,6 +293,9 @@ if (!is_metaconsole()) {
|
|||
foreach ($rows as $module_group)
|
||||
$rows_select[$module_group['id_mg']] = $module_group['name'];
|
||||
}
|
||||
else {
|
||||
$rows_select = modules_get_modulegroups();
|
||||
}
|
||||
$table->data[0][5] = html_print_select($rows_select, 'modulegroup', $modulegroup, '', __('All'), -1, true, false, true, '', false, 'width: 120px;');
|
||||
|
||||
$table->rowspan[0][6] = 2;
|
||||
|
|
Loading…
Reference in New Issue