diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d405f1d4d6..d9a451bfaa 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2013-02-13 Miguel de Dios + + * extensions/module_groups.php, + godmode/massive/massive_add_alerts.php, + godmode/massive/massive_edit_modules.php, godmode/tag/tag.php: + cleaned source code style. + + * images/network.disabled.png: added image. + * images/chart_curve.disabled.png: fixed mistake image. + + * godmode/agentes/module_manager.php: improved the style of table. + + Fixes: #3604465 + 2013-02-13 Miguel de Dios * include/config_process.php: fixed the lost initial value for diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 93996eba23..ad31e7947f 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -62,7 +62,7 @@ if (is_ajax ()) { ON t3.id = t1.id_alert_template_module AND t1.id_alert_action = t2.id WHERE (t3.id_alert_template = ' . $template['id'] . ' AND - t3.id_agent_module = ' . $module['id_agente_modulo'] . ');'; + t3.id_agent_module = ' . $module['id_agente_modulo'] . ');'; $actions = db_get_all_rows_sql($sql); @@ -74,9 +74,9 @@ if (is_ajax ()) { $default_action = true; - $actions = db_get_all_rows_sql($sql); + $actions = db_get_all_rows_sql($sql); } - + if ($actions === false) { $actions = array(); } diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 22bb6f8588..959e7f673e 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -45,10 +45,18 @@ echo ''; // Check if there is at least one server of each type available to assign that // kind of modules. If not, do not show server type in combo -$network_available = db_get_sql ("SELECT count(*) from tserver where server_type = 1"); //POSTGRESQL AND ORACLE COMPATIBLE -$wmi_available = db_get_sql ("SELECT count(*) from tserver where server_type = 6"); //POSTGRESQL AND ORACLE COMPATIBLE -$plugin_available = db_get_sql ("SELECT count(*) from tserver where server_type = 4"); //POSTGRESQL AND ORACLE COMPATIBLE -$prediction_available = db_get_sql ("SELECT count(*) from tserver where server_type = 5"); //POSTGRESQL AND ORACLE COMPATIBLE +$network_available = db_get_sql ("SELECT count(*) + FROM tserver + WHERE server_type = 1"); //POSTGRESQL AND ORACLE COMPATIBLE +$wmi_available = db_get_sql ("SELECT count(*) + FROM tserver + WHERE server_type = 6"); //POSTGRESQL AND ORACLE COMPATIBLE +$plugin_available = db_get_sql ("SELECT count(*) + FROM tserver + WHERE server_type = 4"); //POSTGRESQL AND ORACLE COMPATIBLE +$prediction_available = db_get_sql ("SELECT count(*) + FROM tserver + WHERE server_type = 5"); //POSTGRESQL AND ORACLE COMPATIBLE // Development mode to use all servers if ($develop_bypass) { @@ -307,7 +315,7 @@ switch ($sortField) { case "postgresql": $order[] = array('field' => 'tagente_modulo.nombre', 'order' => 'DESC'); break; - case "oracle": + case "oracle": $order[] = array('field' => 'dbms_lob.substr(tagente_modulo.nombre,4000,1)', 'order' => 'DESC'); break; } @@ -419,7 +427,7 @@ switch ($config["dbtype"]) { $modules = db_get_all_rows_sql($sql); break; - case "oracle": + case "oracle": $set = array(); $set['limit'] = $limit; $set['offset'] = $offset; @@ -473,6 +481,7 @@ $table->head[7] = __('Warn'); $table->head[8] = __('Action'); +$table->head[9] = '' . __('D.') . ''; $table->rowstyle = array(); $table->style = array (); @@ -480,8 +489,9 @@ $table->style[0] = 'font-weight: bold'; $table->size = array (); $table->size[2] = '55px'; $table->align = array (); -$table->align[2] = 'center'; -$table->align[8] = 'center'; +$table->align[2] = 'left'; +$table->align[8] = 'left'; +$table->align[9] = 'left'; $table->data = array (); $agent_interval = agents_get_interval ($id_agente); @@ -518,9 +528,9 @@ foreach ($modules as $module) { $table->rowstyle[$i - 1] = 'text-align: center'; $table->rowclass[$i - 1] = 'datos3'; if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) - $table->colspan[$i - 1][0] = 9; + $table->colspan[$i - 1][0] = 10; else - $table->colspan[$i - 1][0] = 7; + $table->colspan[$i - 1][0] = 8; $data = array (); } @@ -631,14 +641,7 @@ foreach ($modules as $module) { html_print_image('images/lightbulb.png', true, array('alt' => __('Disable module'), 'title' => __('Disable module'))) .""; } - if(check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { - // Delete module - $data[8] .= html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); - $data[8] .= ' '; - $data[8] .= html_print_image ('images/cross.png', true, - array ('title' => __('Delete'))); - $data[8] .= ' '; + if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { $data[8] .= ' '; $data[8] .= html_print_image ('images/copy.png', true, @@ -646,7 +649,6 @@ foreach ($modules as $module) { $data[8] .= ' '; // Make a data normalization - if (isset($numericModules[$type])) { if ($numericModules[$type] === true) { $data[8] .= ' '; @@ -655,14 +657,34 @@ foreach ($modules as $module) { $data[8] .= ''; } } + else { + $data[8] .= " " . html_print_image ('images/chart_curve.disabled.png', true, + array ('title' => __('Normalize (Disabled)'))); + } + //create network component action - if (is_user_admin($config['id_user'])) { + if ((is_user_admin($config['id_user'])) && + ($module['id_modulo'] == MODULE_NETWORK)) { $data[8] .= ' '; $data[8] .= html_print_image ('images/network.png', true, array ('title' => __('Create network component'))); $data[8] .= ' '; } + else { + $data[8] .= ' ' . html_print_image ('images/network.disabled.png', true, + array ('title' => __('Create network component (Disabled)'))); + } + } + + if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { + // Delete module + $data[9] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); + $data[9] .= ' '; + $data[9] .= html_print_image ('images/cross.png', true, + array ('title' => __('Delete'))); + $data[9] .= ' '; } array_push ($table->data, $data); diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index 69c001942d..1a64c6b2d3 100644 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -55,13 +55,13 @@ function process_manage_add ($id_alert_template, $id_agents, $module_names) { return false; } - foreach($module_names as $module){ + foreach($module_names as $module) { foreach($id_agents as $id_agent) { $module_id = modules_get_agentmodule_id($module, $id_agent); $modules_id[] = $module_id['id_agente_modulo']; } } - + if(count($module_names) == 1 && $module_names[0] == '0'){ $modules_id = agents_common_modules ($id_agents, false, true); } @@ -69,9 +69,9 @@ function process_manage_add ($id_alert_template, $id_agents, $module_names) { $conttotal = 0; $contsuccess = 0; - foreach($modules_id as $module){ + foreach($modules_id as $module) { $success = alerts_create_alert_agent_module ($module, $id_alert_template); - + if($success) $contsuccess ++; $conttotal ++; @@ -85,9 +85,9 @@ function process_manage_add ($id_alert_template, $id_agents, $module_names) { } ui_print_result_message ($contsuccess > 0, - __('Successfully added')."(".$contsuccess."/".$conttotal.")", - __('Could not be added')); - + __('Successfully added')."(".$contsuccess."/".$conttotal.")", + __('Could not be added')); + } $id_group = (int) get_parameter ('id_group', -1); @@ -167,12 +167,12 @@ ui_require_jquery_file ('pandora.controls');