2012-06-20 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/graphs/pChart/pPie.class.php: ixed a bug in pie3d graph
	function when graph data only has one element.
	
	 include/functions_reporting.php
	 operation/reporting/reporting_viewer.php: Fixed a visualization 
	 problem in agent_modules report item.
	 
	 godmode/users/profile_list.php: Fixed a bug when profile creation
	fails.
	
	Merged from branches.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6621 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-06-20 11:45:12 +00:00
parent bcc468c356
commit 367ad38f93
5 changed files with 48 additions and 20 deletions

View File

@ -1,3 +1,17 @@
2012-06-20 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/graphs/pChart/pPie.class.php: ixed a bug in pie3d graph
function when graph data only has one element.
include/functions_reporting.php
operation/reporting/reporting_viewer.php: Fixed a visualization
problem in agent_modules report item.
godmode/users/profile_list.php: Fixed a bug when profile creation
fails.
Merged from branches.
2012-06-20 Vanessa Gil <vanessa.gil@artica.es> 2012-06-20 Vanessa Gil <vanessa.gil@artica.es>
* godmode/agentes/module_manager.php * godmode/agentes/module_manager.php

View File

@ -59,13 +59,13 @@ if ($delete_profile) {
$sql = sprintf ('DELETE FROM tperfil WHERE id_perfil = %d', $id_profile); $sql = sprintf ('DELETE FROM tperfil WHERE id_perfil = %d', $id_profile);
$ret = db_process_sql ($sql); $ret = db_process_sql ($sql);
if ($ret === false) { if ($ret === false) {
echo '<h3 class="error">'.__('There was a problem deleting the profile').'</h3>'; ui_print_error_message(__('There was a problem deleting the profile'));
} }
else { else {
db_pandora_audit("Profile management", db_pandora_audit("Profile management",
"Delete profile ". $profile['name']); "Delete profile ". $profile['name']);
echo '<h3 class="suc">'.__('Successfully deleted').'</h3>'; ui_print_success_message(__('Successfully deleted'));
} }
//Delete profile from user data //Delete profile from user data
@ -110,14 +110,14 @@ if ($update_profile) {
db_pandora_audit("User management", db_pandora_audit("User management",
"Update profile ". $name, false, false, $info); "Update profile ". $name, false, false, $info);
echo '<h3 class="suc">'.__('Successfully updated').'</h3>'; ui_print_success_message(__('Successfully updated'));
} }
else { else {
echo '<h3 class="error"'.__('There was a problem updating this profile').'</h3>'; ui_print_error_message(__('There was a problem updating this profile'));
} }
} }
else { else {
echo '<h3 class="error"'.__('Profile name cannot be empty').'</h3>'; ui_print_error_message(__('Profile name cannot be empty'));
} }
$id_profile = 0; $id_profile = 0;
} }
@ -153,7 +153,7 @@ if ($create_profile) {
$ret = db_process_sql_insert('tperfil', $values); $ret = db_process_sql_insert('tperfil', $values);
if ($ret !== false) { if ($ret !== false) {
echo '<h3 class="suc">'.__('Successfully created').'</h3>'; ui_print_success_message(__('Successfully created'));
$info = 'Name: ' . $name . ' Incident view: ' . $incident_view . $info = 'Name: ' . $name . ' Incident view: ' . $incident_view .
' Incident edit: ' . $incident_edit . ' Incident management: ' . $incident_management . ' Incident edit: ' . $incident_edit . ' Incident management: ' . $incident_management .
@ -165,11 +165,11 @@ if ($create_profile) {
"Created profile ". $name, false, false, $info); "Created profile ". $name, false, false, $info);
} }
else { else {
echo '<h3 class="error">'.__('There was a problem creating this profile').'</h3>'; ui_print_error_message(__('There was a problem creating this profile'));
} }
} }
else { else {
echo '<h3 class="error"'.__('There was a problem creating this profile').'</h3>'; ui_print_error_message(__('There was a problem creating this profile'));
} }
$id_profile = 0; $id_profile = 0;
} }

View File

@ -4164,18 +4164,18 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$nmodules = 0; $nmodules = 0;
foreach ($modules_by_name as $module) { foreach ($modules_by_name as $module) {
$nmodules++; $nmodules++;
// Don't use pagination
if($nmodules > $block) { //Will show only the (block) first modules /*if($nmodules > $block) { //Will show only the (block) first modules
continue; continue;
} }*/
$file_name = string2image(ui_print_truncate_text($module['name'], 'module_small', false, true, false, '...'), false, false, 6, 270, '#90B165', 'FFF', 4, 0); $file_name = string2image(ui_print_truncate_text($module['name'], 'module_small', false, true, false, '...'), false, false, 6, 270, '#90B165', 'FFF', 4, 0);
$table_data .= '<th width="22px">' . html_print_image($file_name, true, array('title' => $module['name']))."</th>"; $table_data .= '<th width="22px">' . html_print_image($file_name, true, array('title' => $module['name']))."</th>";
} }
// Dont use pagination
if ($block < $nmodules) { /*if ($block < $nmodules) {
$table_data .= "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><b>...</b></th>"; $table_data .= "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><b>...</b></th>";
} }*/
$filter_agents = false; $filter_agents = false;
if($id_group > 0) { if($id_group > 0) {
@ -4224,10 +4224,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
foreach ($modules_by_name as $module) { foreach ($modules_by_name as $module) {
$nmodules++; $nmodules++;
// Don't use pagination
if ($nmodules > $block) { /*if ($nmodules > $block) {
continue; continue;
} }*/
$match = false; $match = false;
foreach($module['id'] as $module_id){ foreach($module['id'] as $module_id){

View File

@ -293,7 +293,7 @@
/* Dump the real number of data to draw */ /* Dump the real number of data to draw */
$Values = ""; $Values = "";
foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value) foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
{ if ($Value != 0) { $Values[] = $Value; } } { if ($Value != 0) { $Values[$Key] = $Value; } }
/* Compute the wasted angular space between series */ /* Compute the wasted angular space between series */
if (count($Values)==1) { $WastedAngular = 0; } else { $WastedAngular = count($Values) * $DataGapAngle; } if (count($Values)==1) { $WastedAngular = 0; } else { $WastedAngular = count($Values) * $DataGapAngle; }
@ -306,11 +306,18 @@
/* Draw the polygon pie elements */ /* Draw the polygon pie elements */
$Step = 360 / (2 * PI * $Radius); $Step = 360 / (2 * PI * $Radius);
$Offset = 360; $ID = count($Values)-1; $Offset = 360;
$Values = array_reverse($Values); // Commented due to fix bellow
//$ID = count($Values)-1;
// Commented due to fix bellow
// $Values = array_reverse($Values);
$Slice = 0; $Slices = ""; $SliceColors = ""; $Visible = ""; $SliceAngle = ""; $Slice = 0; $Slices = ""; $SliceColors = ""; $Visible = ""; $SliceAngle = "";
foreach($Values as $Key => $Value) foreach($Values as $Key => $Value)
{ {
// Fix: ID equal to the index of array
$ID = $Key;
$Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);
$SliceColors[$Slice] = $Settings; $SliceColors[$Slice] = $Settings;

View File

@ -216,7 +216,14 @@ foreach ($contents as $content) {
reporting_render_report_html_item ($content, $table, $report); reporting_render_report_html_item ($content, $table, $report);
if ($content['type'] == 'agent_module')
echo '<div style="width: 99%; overflow: auto;">';
html_print_table ($table); html_print_table ($table);
if ($content['type'] == 'agent_module')
echo '</div>';
flush (); flush ();
} }
?> ?>