2013-02-15 Miguel de Dios <miguel.dedios@artica.es>

* godmode/modules/manage_network_components.php,
	godmode/reporting/visual_console_builder.editor.js,
	godmode/massive/massive_delete_alerts.php: improved the source
	style.
	
	* include/functions_ui.php: fixed the sort of included of jquery
	base files.
	
	Fixes: #3604768




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7661 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-15 12:04:27 +00:00
parent 14e38c0003
commit 9bcd52d6ee
5 changed files with 43 additions and 29 deletions

View File

@ -1,3 +1,15 @@
2013-02-15 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components.php,
godmode/reporting/visual_console_builder.editor.js,
godmode/massive/massive_delete_alerts.php: improved the source
style.
* include/functions_ui.php: fixed the sort of included of jquery
base files.
Fixes: #3604768
2013-02-15 Sergio Martin <sergio.martin@artica.es>
* godmode/agentes/module_manager_editor.php: Delete default

View File

@ -43,7 +43,7 @@ if (is_ajax ()) {
else {
$groups = array($id_group);
}
$agents_alerts = array();
foreach( $groups as $group ) {
$agents_alerts_one_group = alerts_get_agents_with_alert_template ($id_alert_template, $group,
@ -71,26 +71,26 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
}
$module_selection_mode = get_parameter('modules_selection_mode');
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'];
$module_id = modules_get_agentmodule_id($module, $id_agent);
$modules_id[] = $module_id['id_agente_modulo'];
}
}
// If is selected "ANY" option then we need the module selection mode: common or all modules
if (count($module_names) == 1 && $module_names[0] == '0') {
if ($module_selection_mode == 'common')
$modules_id = agents_common_modules_with_alerts ($id_agents, false, true);
else {
// For agents selected
$modules_id = array();
foreach ($id_agents as $id_agent) {
$current_modules_agent = agents_get_modules($id_agent, 'id_agente_modulo', array ('disabled' => 0));
if ($current_modules_agent != false) {
// And their modules
foreach ($current_modules_agent as $current_module) {
@ -108,23 +108,23 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
}
}
}
$conttotal = 0;
$contsuccess = 0;
foreach($modules_id as $module){
$success = alerts_delete_alert_agent_module (false,
array ('id_agent_module' => $module,
'id_alert_template' => $id_alert_template));
'id_alert_template' => $id_alert_template));
if($success)
$contsuccess ++;
$conttotal ++;
}
ui_print_result_message ($contsuccess > 0,
__('Successfully deleted')."(".$contsuccess."/".$conttotal.")",
__('Could not be deleted'));
__('Successfully deleted')."(".$contsuccess."/".$conttotal.")",
__('Could not be deleted'));
return (bool)($contsuccess > 0);
}
@ -208,14 +208,13 @@ echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file ('form');
ui_require_jquery_file ('pandora.controls');
?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#id_agents").change(agent_changed_by_multiple_agents_with_alerts);
$("#id_alert_template").change (function () {
if (this.value != 0) {
$("#id_agents").enable ();
@ -250,7 +249,7 @@ $(document).ready (function () {
"json"
);
});
$("#checkbox-recursion").click(function (){
$("#id_group").trigger("change");
});

View File

@ -36,8 +36,10 @@ if (defined('METACONSOLE')) {
$sec = 'advanced';
}
else {
ui_print_page_header (__('Module management').' &raquo; '.__('Network component management'), "", false, "network_component", true);
$sec = 'gmodules';
ui_print_page_header (__('Module management') . ' &raquo; ' .
__('Network component management'), "", false,
"network_component", true);
$sec = 'gmodules';
}
$type = (int) get_parameter ('type');
@ -142,6 +144,7 @@ if ($create_component) {
$custom_string_3 = '';
$name_check = db_get_value ('name', 'tnetwork_component', 'name',
$name);
if ($type >= 15 && $type <= 18) {
// New support for snmp v3
$tcp_send = $snmp_version;
@ -157,7 +160,7 @@ if ($create_component) {
if ($name && !$name_check) {
$id = network_components_create_network_component ($name, $type, $id_group,
array ('description' => $description,
'module_interval' => $module_interval,

View File

@ -1932,7 +1932,7 @@ function showPreviewIcon(icon) {
success: function (data) {
$("#preview").append(data);
}
});
});
}
}
@ -1977,7 +1977,7 @@ function showGrid() {
eventsItems([SIZE_GRID, SIZE_GRID]);
}
else {
$("#background_grid").css('display', 'none');
$("#background_grid").css('display', 'none');
$("#background_img").css('opacity', '1');
$("#background_img").css('filter', 'alpha(opacity=100)');

View File

@ -1267,7 +1267,7 @@ function ui_process_page_head ($string, $bitfield) {
//Load webchat javascript library
$config['js']['webchat'] = "include/javascript/webchat.js";
//Load other javascript
//We can't load empty
$loaded = array ('');
@ -1306,21 +1306,21 @@ function ui_process_page_head ($string, $bitfield) {
else {
$config['jquery'] = array_merge(
array ("jquery" => "include/javascript/jquery-1.9.0.js",
"pandora" => "include/javascript/jquery.pandora.js"),
"pandora" => "include/javascript/jquery.pandora.js",
'jquery-ui' => 'include/javascript/jquery.jquery-ui-1.10.0.custom.js'),
$config['jquery']);
}
// Include the datapicker language if exists
if(file_exists('include/languages/datepicker/jquery.ui.datepicker-'.$config['language'].'.js')) {
if (file_exists('include/languages/datepicker/jquery.ui.datepicker-'.$config['language'].'.js')) {
$config['jquery']['datepicker_language'] = 'include/languages/datepicker/jquery.ui.datepicker-'.$config['language'].'.js';
}
// Include jquery UI
$config['jquery']['jquery-ui'] = 'include/javascript/jquery.jquery-ui-1.10.0.custom.js';
// Include countdown library
$config['jquery']['countdown'] = 'include/javascript/jquery.countdown.js';
//Then add each script as necessary
$loaded = array ('');
foreach ($config['jquery'] as $name => $filename) {