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:
parent
14e38c0003
commit
9bcd52d6ee
|
@ -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>
|
2013-02-15 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* godmode/agentes/module_manager_editor.php: Delete default
|
* godmode/agentes/module_manager_editor.php: Delete default
|
||||||
|
|
|
@ -43,7 +43,7 @@ if (is_ajax ()) {
|
||||||
else {
|
else {
|
||||||
$groups = array($id_group);
|
$groups = array($id_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
$agents_alerts = array();
|
$agents_alerts = array();
|
||||||
foreach( $groups as $group ) {
|
foreach( $groups as $group ) {
|
||||||
$agents_alerts_one_group = alerts_get_agents_with_alert_template ($id_alert_template, $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');
|
$module_selection_mode = get_parameter('modules_selection_mode');
|
||||||
|
|
||||||
foreach($module_names as $module){
|
foreach($module_names as $module){
|
||||||
foreach($id_agents as $id_agent) {
|
foreach($id_agents as $id_agent) {
|
||||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||||
$modules_id[] = $module_id['id_agente_modulo'];
|
$modules_id[] = $module_id['id_agente_modulo'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If is selected "ANY" option then we need the module selection mode: common or all modules
|
// 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 (count($module_names) == 1 && $module_names[0] == '0') {
|
||||||
|
|
||||||
if ($module_selection_mode == 'common')
|
if ($module_selection_mode == 'common')
|
||||||
$modules_id = agents_common_modules_with_alerts ($id_agents, false, true);
|
$modules_id = agents_common_modules_with_alerts ($id_agents, false, true);
|
||||||
else {
|
else {
|
||||||
// For agents selected
|
// For agents selected
|
||||||
$modules_id = array();
|
$modules_id = array();
|
||||||
|
|
||||||
foreach ($id_agents as $id_agent) {
|
foreach ($id_agents as $id_agent) {
|
||||||
$current_modules_agent = agents_get_modules($id_agent, 'id_agente_modulo', array ('disabled' => 0));
|
$current_modules_agent = agents_get_modules($id_agent, 'id_agente_modulo', array ('disabled' => 0));
|
||||||
|
|
||||||
if ($current_modules_agent != false) {
|
if ($current_modules_agent != false) {
|
||||||
// And their modules
|
// And their modules
|
||||||
foreach ($current_modules_agent as $current_module) {
|
foreach ($current_modules_agent as $current_module) {
|
||||||
|
@ -108,23 +108,23 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$conttotal = 0;
|
$conttotal = 0;
|
||||||
$contsuccess = 0;
|
$contsuccess = 0;
|
||||||
foreach($modules_id as $module){
|
foreach($modules_id as $module){
|
||||||
$success = alerts_delete_alert_agent_module (false,
|
$success = alerts_delete_alert_agent_module (false,
|
||||||
array ('id_agent_module' => $module,
|
array ('id_agent_module' => $module,
|
||||||
'id_alert_template' => $id_alert_template));
|
'id_alert_template' => $id_alert_template));
|
||||||
|
|
||||||
if($success)
|
if($success)
|
||||||
$contsuccess ++;
|
$contsuccess ++;
|
||||||
$conttotal ++;
|
$conttotal ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_print_result_message ($contsuccess > 0,
|
ui_print_result_message ($contsuccess > 0,
|
||||||
__('Successfully deleted')."(".$contsuccess."/".$conttotal.")",
|
__('Successfully deleted')."(".$contsuccess."/".$conttotal.")",
|
||||||
__('Could not be deleted'));
|
__('Could not be deleted'));
|
||||||
|
|
||||||
|
|
||||||
return (bool)($contsuccess > 0);
|
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 ('form');
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$("#id_agents").change(agent_changed_by_multiple_agents_with_alerts);
|
$("#id_agents").change(agent_changed_by_multiple_agents_with_alerts);
|
||||||
|
|
||||||
$("#id_alert_template").change (function () {
|
$("#id_alert_template").change (function () {
|
||||||
if (this.value != 0) {
|
if (this.value != 0) {
|
||||||
$("#id_agents").enable ();
|
$("#id_agents").enable ();
|
||||||
|
@ -250,7 +249,7 @@ $(document).ready (function () {
|
||||||
"json"
|
"json"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#checkbox-recursion").click(function (){
|
$("#checkbox-recursion").click(function (){
|
||||||
$("#id_group").trigger("change");
|
$("#id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,8 +36,10 @@ if (defined('METACONSOLE')) {
|
||||||
$sec = 'advanced';
|
$sec = 'advanced';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui_print_page_header (__('Module management').' » '.__('Network component management'), "", false, "network_component", true);
|
ui_print_page_header (__('Module management') . ' » ' .
|
||||||
$sec = 'gmodules';
|
__('Network component management'), "", false,
|
||||||
|
"network_component", true);
|
||||||
|
$sec = 'gmodules';
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = (int) get_parameter ('type');
|
$type = (int) get_parameter ('type');
|
||||||
|
@ -142,6 +144,7 @@ if ($create_component) {
|
||||||
$custom_string_3 = '';
|
$custom_string_3 = '';
|
||||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name',
|
$name_check = db_get_value ('name', 'tnetwork_component', 'name',
|
||||||
$name);
|
$name);
|
||||||
|
|
||||||
if ($type >= 15 && $type <= 18) {
|
if ($type >= 15 && $type <= 18) {
|
||||||
// New support for snmp v3
|
// New support for snmp v3
|
||||||
$tcp_send = $snmp_version;
|
$tcp_send = $snmp_version;
|
||||||
|
@ -157,7 +160,7 @@ if ($create_component) {
|
||||||
|
|
||||||
|
|
||||||
if ($name && !$name_check) {
|
if ($name && !$name_check) {
|
||||||
|
|
||||||
$id = network_components_create_network_component ($name, $type, $id_group,
|
$id = network_components_create_network_component ($name, $type, $id_group,
|
||||||
array ('description' => $description,
|
array ('description' => $description,
|
||||||
'module_interval' => $module_interval,
|
'module_interval' => $module_interval,
|
||||||
|
|
|
@ -1932,7 +1932,7 @@ function showPreviewIcon(icon) {
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$("#preview").append(data);
|
$("#preview").append(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1977,7 +1977,7 @@ function showGrid() {
|
||||||
eventsItems([SIZE_GRID, SIZE_GRID]);
|
eventsItems([SIZE_GRID, SIZE_GRID]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#background_grid").css('display', 'none');
|
$("#background_grid").css('display', 'none');
|
||||||
$("#background_img").css('opacity', '1');
|
$("#background_img").css('opacity', '1');
|
||||||
$("#background_img").css('filter', 'alpha(opacity=100)');
|
$("#background_img").css('filter', 'alpha(opacity=100)');
|
||||||
|
|
||||||
|
|
|
@ -1267,7 +1267,7 @@ function ui_process_page_head ($string, $bitfield) {
|
||||||
|
|
||||||
//Load webchat javascript library
|
//Load webchat javascript library
|
||||||
$config['js']['webchat'] = "include/javascript/webchat.js";
|
$config['js']['webchat'] = "include/javascript/webchat.js";
|
||||||
|
|
||||||
//Load other javascript
|
//Load other javascript
|
||||||
//We can't load empty
|
//We can't load empty
|
||||||
$loaded = array ('');
|
$loaded = array ('');
|
||||||
|
@ -1306,21 +1306,21 @@ function ui_process_page_head ($string, $bitfield) {
|
||||||
else {
|
else {
|
||||||
$config['jquery'] = array_merge(
|
$config['jquery'] = array_merge(
|
||||||
array ("jquery" => "include/javascript/jquery-1.9.0.js",
|
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']);
|
$config['jquery']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Include the datapicker language if exists
|
// 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';
|
$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
|
// Include countdown library
|
||||||
$config['jquery']['countdown'] = 'include/javascript/jquery.countdown.js';
|
$config['jquery']['countdown'] = 'include/javascript/jquery.countdown.js';
|
||||||
|
|
||||||
|
|
||||||
//Then add each script as necessary
|
//Then add each script as necessary
|
||||||
$loaded = array ('');
|
$loaded = array ('');
|
||||||
foreach ($config['jquery'] as $name => $filename) {
|
foreach ($config['jquery'] as $name => $filename) {
|
||||||
|
|
Loading…
Reference in New Issue