diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 42a564c43c..028c5ab345 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2010-04-22 Miguel de Dios + + * include/javascript/pandora.js: changed function "agent_changed" for take + the translate any or none texts from ajax or global var. + + * operation/agentes/ver_agente.php: added to package data the translate + text for any. + 2010-04-21 Sancho Lerena * include/functions_reporting.php: Added function render_report_html_item() diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 8e15c0ec71..ed12ffff61 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -75,16 +75,23 @@ function agent_changed (event, id_agent, selected) { "id_agent": id_agent }, function (data) { - $('#module').empty (); - $('#module').append ($('').html ("").attr ("value", 0)); - jQuery.each (data, function (i, val) { - s = js_html_entity_decode (val['nombre']); - $('#module').append ($('').html (s).attr ("value", val['id_agente_modulo'])); - $('#module').fadeIn ('normal'); - }); - if (selected != undefined) - $('#module').attr ('value', selected); - $('#module').attr ('disabled', 0); + console.log($(document).data('text_for_module')); + $('#module').empty (); + + if (typeof($(document).data('text_for_module')) != 'undefined') { + $('#module').append ($('').html ($(document).data('text_for_module')).attr ("value", 0)); + } + else { + $('#module').append ($('').html (data['any_text']).attr ("value", 0)); + } + jQuery.each (data, function (i, val) { + s = js_html_entity_decode (val['nombre']); + $('#module').append ($('').html (s).attr ("value", val['id_agente_modulo'])); + $('#module').fadeIn ('normal'); + }); + if (selected != undefined) + $('#module').attr ('value', selected); + $('#module').attr ('disabled', 0); }, "json" ); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index dff8d8cfba..d848bea651 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -71,6 +71,9 @@ if (is_ajax ()) { $agent_modules = get_agent_modules ($id_agent, ($fields != '' ? explode (',', $fields) : "*"), ($filter != '' ? $filter : false), $indexed); + + //Hack to translate text "any" in PHP to javascript + $agent_modules['any_text'] = __('Any'); echo json_encode ($agent_modules); return;