Fixed problems with legend when module no containt data. Tiquet: #3003

This commit is contained in:
m-lopez-f 2015-12-21 09:18:27 +01:00
parent 612cab38f4
commit 4180f2e344
1 changed files with 20 additions and 42 deletions

View File

@ -1003,28 +1003,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
if ($projection != false && $i != 0) { if ($projection != false && $i != 0) {
$agent_module_id = $module_list[0]; $agent_module_id = $module_list[0];
if (!empty($name_list) && $names_number == $module_number && isset($name_list[$i])) {
$module_name_list[$i] = $name_list[$i];
}
else {
//Get and process agent name
$agent_name = io_safe_output(
modules_get_agentmodule_agent_name ($agent_module_id));
$agent_name = ui_print_truncate_text($agent_name, 'agent_small', false, true, false, '...', false);
$agent_id = agents_get_agent_id ($agent_name);
//Get and process module name
$module_name = io_safe_output(
modules_get_agentmodule_name ($agent_module_id));
$module_name = sprintf(__("projection for %s"), $module_name);
$module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false);
$module_name_list[$i] = $agent_name ." / ". $module_name;
}
$id_module_type = modules_get_agentmodule_type ($agent_module_id); $id_module_type = modules_get_agentmodule_type ($agent_module_id);
$module_type = modules_get_moduletype_name ($id_module_type); $module_type = modules_get_moduletype_name ($id_module_type);
$uncompressed_module = is_module_uncompressed ($module_type); $uncompressed_module = is_module_uncompressed ($module_type);
@ -1032,26 +1010,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
else { else {
$agent_module_id = $module_list[$i]; $agent_module_id = $module_list[$i];
if (!empty($name_list) && $names_number == $module_number && isset($name_list[$i])) {
$module_name_list[$i] = $name_list[$i];
}
else {
//Get and process agent name
$agent_name = io_safe_output(
modules_get_agentmodule_agent_name ($agent_module_id));
$agent_name = ui_print_truncate_text($agent_name, 'agent_small', false, true, false, '...', false);
$agent_id = agents_get_agent_id ($agent_name);
//Get and process module name
$module_name = io_safe_output(
modules_get_agentmodule_name ($agent_module_id));
$module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false);
$module_name_list[$i] = $agent_name . " / " . $module_name;
}
$id_module_type = modules_get_agentmodule_type ($agent_module_id); $id_module_type = modules_get_agentmodule_type ($agent_module_id);
$module_type = modules_get_moduletype_name ($id_module_type); $module_type = modules_get_moduletype_name ($id_module_type);
$uncompressed_module = is_module_uncompressed ($module_type); $uncompressed_module = is_module_uncompressed ($module_type);
@ -1123,6 +1081,26 @@ function graphic_combined_module ($module_list, $weight_list, $period,
continue; continue;
} }
if (!empty($name_list) && $names_number == $module_number && isset($name_list[$i])) {
$module_name_list[$i] = $name_list[$i];
}
else {
//Get and process agent name
$agent_name = io_safe_output(
modules_get_agentmodule_agent_name ($agent_module_id));
$agent_name = ui_print_truncate_text($agent_name, 'agent_small', false, true, false, '...', false);
$agent_id = agents_get_agent_id ($agent_name);
//Get and process module name
$module_name = io_safe_output(
modules_get_agentmodule_name ($agent_module_id));
$module_name = sprintf(__("projection for %s"), $module_name);
$module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false);
$module_name_list[$i] = $agent_name ." / ". $module_name;
}
// Data iterator // Data iterator
$j = 0; $j = 0;