2012-04-20 Vanessa Gil <vanessa.gil@artica.es>

* godmode/alerts/alert_list.builder.php: Fixed bug: In tab alert
	within agent detail, the actions depends on the template.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6057 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-04-20 09:07:34 +00:00
parent 08cdb6b994
commit b705e4abf5
2 changed files with 21 additions and 74 deletions

View File

@ -1,3 +1,8 @@
2012-04-20 Vanessa Gil <vanessa.gil@artica.es>
* godmode/alerts/alert_list.builder.php: Fixed bug: In tab alert
within agent detail, the actions depends on the template.
2012-04-20 Kikuchi Koichiro <koichiro@rworks.jp>
* extensions/update_manager.php,

View File

@ -64,8 +64,6 @@ $table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
$table->data[0][1] .= ' <span id="module_loading" class="invisible">';
$table->data[0][1] .= html_print_image('images/spinner.png', true) . '</span>';
$table->data[1][0] = __('Template');
$table->data[1][0] = __('Template');
$own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
@ -89,13 +87,25 @@ if (check_acl ($config['id_user'], 0, "LM")) {
}
$table->data[2][0] = __('Actions');
$groups_user = users_get_groups($config["id_user"]);
if (!empty($groups_user)) {
$groups = implode(',', array_keys($groups_user));
$sql = "SELECT name FROM talert_actions WHERE id_group IN ($groups)";
$actions = db_get_all_rows_sql($sql);
}
$actions = array ('0' => __('None'));
$i=1;
$action_name = array ('0' => __('None'));
foreach ($actions as $action) {
foreach ($action as $key=>$name) {
$action_name[$i] = $name;
$i++;
}
}
$table->data[2][1] = '<div class="actions_container">';
$table->data[2][1] = html_print_select($actions,'action_select','','','','',true);
$table->data[2][1] .= ' <span id="action_loading" class="invisible">';
$table->data[2][1] .= html_print_image('images/spinner.png', true) . '</span>';
$table->data[2][1] = html_print_select($action_name,'action_select_','','','','',true, '', false);
$table->data[2][1] .= ' <span id="advanced_action" class="advanced_actions invisible">';
$table->data[2][1] .= __('Number of alerts match from').' ';
$table->data[2][1] .= html_print_input_text ('fires_min', '', '', 4, 10, true);
@ -191,31 +201,6 @@ $(document).ready (function () {
return false;
}
})
.data( "autocomplete")._renderItem = function( ul, item ) {
if ((item.ip == "") || (typeof(item.ip) == "undefined")) {
text = "<a>" + item.name + "</a>";
}
else {
text = "<a>" + item.name
+ "<br><span style=\"font-size: 70%; font-style: italic;\">IP:" + item.ip + "</span></a>";
}
return $("<li></li>")
.data("item.autocomplete", item)
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");
/* prevent horizontal scrollbar */
$(".ui-autocomplete").css("overflow-x", "hidden");
/* add padding to account for vertical scrollbar */
$(".ui-autocomplete").css("padding-right", "20px");
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
<?php if (! $id_agente) : ?>
$("#id_group").pandoraSelectGroupAgent ({
@ -246,44 +231,7 @@ $(document).ready (function () {
return false;
});
$("#action_select").hide();
$("#action_select").html('');
$("#action_loading").show ();
jQuery.post ("ajax.php",
{"page" : "operation/agentes/estado_agente",
"get_actions_alert_template" : 1,
"id_template" : this.value
},
function (data, status) {
option = $("<option></option>")
.attr ("value", '0')
.append ('<?php echo __('None'); ?>');
$("#action_select").append (option);
if (data == false) {
//There aren't any action
}
else {
if (data != '') {
jQuery.each (data, function (i, val) {
option = $("<option></option>")
.attr ("value", val["id"])
.append (val["name"]);
if (val["sort_order"] == 1)
option.attr ("selected", true);
$("#action_select").append (option);
});
}
$('#advanced_action').show();
}
$("#action_loading").hide ();
$("#action_select").show();
},
"json"
);
});
$("#action_select").change(function () {
@ -319,12 +267,6 @@ $(document).ready (function () {
"json"
);
});
$("form.add_alert_form :checkbox[name^=actions]").change (function () {
$advanced = $(this).siblings ("span#advanced_"+this.value);
$("input", $advanced).attr ("value", 0);
$advanced.toggle ();
});
});
/* ]]> */
</script>