2010-04-22 Miguel de Dios <miguel.dedios@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2585 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2010-04-22 11:52:31 +00:00
parent b363210cba
commit ed67836aca
3 changed files with 28 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2010-04-22 Miguel de Dios <miguel.dedios@artica.es>
* 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 <slerena@artica.es>
* include/functions_reporting.php: Added function render_report_html_item()

View File

@ -75,16 +75,23 @@ function agent_changed (event, id_agent, selected) {
"id_agent": id_agent
},
function (data) {
$('#module').empty ();
$('#module').append ($('<option></option>').html ("<?php echo __('Any')?>").attr ("value", 0));
jQuery.each (data, function (i, val) {
s = js_html_entity_decode (val['nombre']);
$('#module').append ($('<option></option>').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 ($('<option></option>').html ($(document).data('text_for_module')).attr ("value", 0));
}
else {
$('#module').append ($('<option></option>').html (data['any_text']).attr ("value", 0));
}
jQuery.each (data, function (i, val) {
s = js_html_entity_decode (val['nombre']);
$('#module').append ($('<option></option>').html (s).attr ("value", val['id_agente_modulo']));
$('#module').fadeIn ('normal');
});
if (selected != undefined)
$('#module').attr ('value', selected);
$('#module').attr ('disabled', 0);
},
"json"
);

View File

@ -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;