2011-06-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* godmode/agentes/module_manager_editor_common.php
	godmode/agentes/configurar_agente.php
	godmode/agentes/module_manager_editor.php: Changed tag assigment
	interface inside module editor.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4425 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-06-09 15:35:34 +00:00
parent e2a1c7823e
commit 9daa27c4c6
4 changed files with 70 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2011-06-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/agentes/module_manager_editor_common.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php: Changed tag assigment
interface inside module editor.
2011-06-08 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/events/events_list.php: Added tag information in this

View File

@ -617,7 +617,7 @@ if ($update_module || $create_module) {
$max_critical = (float) get_parameter ('max_critical');
$ff_event = (int) get_parameter ('ff_event');
$unit = (string) get_parameter('unit');
$id_tag = (array) get_parameter('id_tag');
$id_tag = (array) get_parameter('id_tag_selected');
$active_snmp_v3 = get_parameter('active_snmp_v3');
if ($active_snmp_v3) {

View File

@ -257,7 +257,8 @@ if($is_function_policies !== ENTERPRISE_NOT_HOOK) {
}
}
global $__code_from;
$__code_from = 'modules';
switch ($moduletype) {
case "dataserver":
case 1:

View File

@ -230,8 +230,65 @@ $table_advanced->data[5][0] = __('Unit');
$table_advanced->data[5][1] = html_print_input_text ('unit', $unit,
'', 20, 65, true);
/* Tags */
$table_advanced->data[6][0] = __('Tag');
$table_advanced->data[6][1] = html_print_select_from_sql ('SELECT id_tag, name FROM ttag ORDER BY name',
'id_tag[]', $id_tag, '',__('None'),'0', true, true, false, false);
// This var comes from module_manager_editor.php or policy_modules.php
global $__code_from;
$table_advanced->data[6][0] = __('Tags available');
// Code comes from module_editor
if ($__code_from == 'modules') {
$__table_modules = 'ttag_module';
$__id_where = 'b.id_agente_modulo';
$__id = $id_agent_module;
// Code comes from policy module editor
}else {
global $__id_pol_mod;
$__table_modules= 'ttag_policy_module';
$__id_where = 'b.id_policy_module';
$__id = $__id_pol_mod;
}
$table_advanced->data[6][1] = html_print_select_from_sql ("SELECT id_tag, name
FROM ttag
WHERE id_tag NOT IN (
SELECT a.id_tag
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id )
ORDER BY name",
'id_tag_available[]', $id_tag, '',__('None'),'0', true, true, false, false);
$table_advanced->data[6][2] = html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add tags to module'))); //html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
$table_advanced->data[6][2] .= '<br><br><br><br>' . html_print_image('images/darrowleft.png', true, array('id' => 'left', 'title' => __('Delete tags to module'))); //html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
$table_advanced->data[6][3] = '<b>' . __('Tags selected') . '</b>';
$table_advanced->data[6][4] = html_print_select_from_sql ("SELECT a.id_tag, name
FROM ttag a, $__table_modules b
WHERE a.id_tag = b.id_tag AND $__id_where = $__id
ORDER BY name",
'id_tag_selected[]', $id_tag, '',__('None'),'0', true, true, false, false);
//$table_advanced->data[6][4] .= html_print_input_hidden('id_tag_serialize', '');
?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#right").click (function () {
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
tag_name = $(value).html();
if (tag_name != 'None'){
id_tag = $(value).attr('value');
$("select[name='id_tag_selected[]']").append($("<option selected='selected'>").val(id_tag).html('<i>' + tag_name + '</i>'));
$("#id_tag_available").find("option[value='" + id_tag + "']").remove();
}
});
});
$("#left").click (function () {
jQuery.each($("select[name='id_tag_selected[]'] option:selected"), function (key, value) {
tag_name = $(value).html();
if (tag_name != 'None'){
id_tag = $(value).attr('value');
$("select[name='id_tag_available[]']").append($("<option>").val(id_tag).html('<i>' + tag_name + '</i>'));
$("#id_tag_selected").find("option[value='" + id_tag + "']").remove();
}
});
});
});
/* ]]> */
</script>