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

* operation/agentes/exportdata.php: Fixed several bugs.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6142 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-04-25 09:12:42 +00:00
parent a043405ec5
commit 687a354165

View File

@ -147,8 +147,8 @@ ui_require_javascript_file ('calendar');
ui_print_page_header (__("Export data"), "images/server_export.png");
$group = get_parameter_post ('group', 0);
//$agent = get_parameter_post ('agent', 0);
$agentName = get_parameter_post ('agent', 0);
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
@ -266,7 +266,6 @@ if (!empty ($export_btn) && !empty ($module)) {
case "data":
case "avg":
echo $output;
exit;
break;
}
unset($output);
@ -286,6 +285,7 @@ elseif (!empty ($export_btn) && empty ($module)) {
ui_print_error_message (__('No modules specified'));
}
if (empty($export_btn)) {
echo '<form method="post" action="index.php?sec=reporting&amp;sec2=operation/agentes/exportdata" name="export_form">';
$table->width = '98%';
@ -302,7 +302,7 @@ $table->data[0][0] = '<b>'.__('Group').'</b>';
$groups = users_get_groups ($config['id_user'], "AR");
$table->data[0][1] = html_print_select_groups($config['id_user'], "AR", true, "group", $group, 'this.form.submit();', '', 0, true, false, true, 'w130', false);
$table->data[0][1] = html_print_select_groups($config['id_user'], "AR", true, "group", $group, 'submit_group();', '', 0, true, false, true, 'w130', false);
//Agent selector
$table->data[1][0] = '<b>'.__('Source agent').'</b>';
@ -315,17 +315,15 @@ if ($group > 0) {
$agents = array ();
$rows = agents_get_agents ($filter, false, 'AR');
if ($rows == null) $rows = array();
foreach ($rows as $row) {
$agents[$row['id_agente']] = $row['nombre'];
}
if (!in_array ($agent, array_keys ($agents))) {
$agent = current (array_keys ($agents));
}
//Src code of lightning image with skins
$src_code = html_print_image ('images/lightning.png', true, false, true);
$table->data[1][1] = html_print_input_text_extended ('agent', agents_get_name ($agent), 'text-agent', '', 40, 100, false, '',
array('style' => "background: url($src_code) no-repeat right;"), true)
. '<a href="#" class="tip">&nbsp;<span>' . __("Type at least two characters to search") . '</span></a>';
@ -376,7 +374,7 @@ html_print_table ($table);
echo '<div class="action-buttons" style="width:80%;">';
html_print_submit_button (__('Export'), 'export_btn', $disabled_export_button, 'class="sub wand"');
echo '</div></form>';
}
ui_require_jquery_file ('pandora.controls');
ui_require_jquery_file ('ajaxqueue');
ui_require_jquery_file ('bgiframe');
@ -464,6 +462,9 @@ $(document).ready (function () {
//Force to style of items
$(".ui-autocomplete").css("text-align", "left");
}
$("select#export_type").trigger('change');
});
$("select#export_type").change (function () {
@ -480,10 +481,14 @@ $("select#export_type").change (function () {
case 'data':
f.action = "index.php?sec=reporting&sec2=operation/agentes/exportdata";
break;
}
});
function submit_group() {
var f = document.forms.export_form;
f.action = "index.php?sec=reporting&sec2=operation/agentes/exportdata";
f.form.submit();
}
/* ]]> */
</script>