Fixed problems with times of execution and load page. Tiquet: #3988
This commit is contained in:
parent
af0d5b868d
commit
a98242d151
|
@ -2374,4 +2374,86 @@ function modules_get_module_group_status($id_agent, $id_module_group) {
|
|||
|
||||
return $status_return;
|
||||
}
|
||||
|
||||
function modules_get_modules_name ($sql_from , $sql_conditions = '', $meta = false) {
|
||||
global $config;
|
||||
|
||||
if (!$meta) {
|
||||
// Query to get name of the modules to module name filter combo
|
||||
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;
|
||||
}
|
||||
|
||||
$return = db_get_all_rows_sql($sql);
|
||||
|
||||
return $return;
|
||||
}
|
||||
else {
|
||||
// For each server defined and not disabled:
|
||||
$servers = db_get_all_rows_sql ('SELECT *
|
||||
FROM tmetaconsole_setup
|
||||
WHERE disabled = 0');
|
||||
|
||||
if ($servers === false)
|
||||
$servers = array();
|
||||
|
||||
$result = array();
|
||||
foreach($servers as $server) {
|
||||
// If connection was good then retrieve all data server
|
||||
if (metaconsole_connect($server) == NOERR) {
|
||||
$connection = true;
|
||||
}
|
||||
else {
|
||||
$connection = false;
|
||||
}
|
||||
|
||||
// Get all info for filters of all nodes
|
||||
$modules_temp = db_get_all_rows_sql($sql);
|
||||
|
||||
$rows_temp = db_get_all_rows_sql('SELECT distinct name
|
||||
FROM tmodule_group
|
||||
ORDER BY name');
|
||||
$rows_temp = io_safe_output($rows_temp);
|
||||
|
||||
if (!empty($rows_temp)) {
|
||||
foreach ($rows_temp as $module_group_key => $modules_group_val)
|
||||
$rows_temp_processed[$modules_group_val['name']] = $modules_group_val['name'];
|
||||
|
||||
$rows_select = array_unique(array_merge($rows_select, $rows_temp_processed));
|
||||
}
|
||||
|
||||
$groups_temp = users_get_groups_for_select(false, "AR", true, true, false);
|
||||
|
||||
$groups_temp_processed = array();
|
||||
|
||||
foreach ($groups_temp as $group_temp_key => $group_temp_val) {
|
||||
$new_key = str_replace(' ','',$group_temp_val);
|
||||
$groups_temp_processed[$new_key] = $group_temp_val;
|
||||
}
|
||||
|
||||
if (!empty($groups_temp_processed)) {
|
||||
$groups_select = array_unique(array_merge($groups_select, $groups_temp_processed));
|
||||
}
|
||||
|
||||
if (!empty($modules_temp))
|
||||
$modules = array_merge($modules, $modules_temp);
|
||||
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
unset($groups_select[__('All')]);
|
||||
$key_group_all = array_search(__('All'), $groups_select);
|
||||
if ($key_group_all !== false)
|
||||
unset($groups_select[$key_group_all]);
|
||||
return $modules;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue