[ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 # Mantis - a php based bugtracking system 3 4 # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 5 # Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net 6 7 # Mantis is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Mantis is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Mantis. If not, see <http://www.gnu.org/licenses/>. 19 ?> 20 <?php 21 require_once ( '../core.php' ); 22 23 $t_core_path = config_get( 'core_path' ); 24 25 require_once( $t_core_path.'graph_api.php' ); 26 ?> 27 <?php 28 # Grab Data 29 # --- 30 31 $t_project_id = helper_get_current_project(); 32 33 $data_category_arr = array(); 34 $data_count_arr = array(); 35 $t_user_id = auth_get_current_user_id(); 36 $query = "SELECT status, COUNT( status ) as count 37 FROM mantis_bug_table 38 WHERE project_id='$t_project_id' AND 39 reporter_id='$t_user_id' 40 GROUP BY status 41 ORDER BY status"; 42 $result = db_query( $query ); 43 $status_count = db_num_rows( $result ); 44 45 $status_arr = array(); 46 $status_arr[10] = 0; 47 $status_arr[20] = 0; 48 $status_arr[30] = 0; 49 $status_arr[40] = 0; 50 $status_arr[50] = 0; 51 $status_arr[80] = 0; 52 $status_arr[90] = 0; 53 for ($i=0;$i<$status_count;$i++) { 54 $row = db_fetch_array( $result ); 55 extract( $row ); 56 57 $status_arr[$status] = $count; 58 } 59 60 # Setup Graph 61 # --- 62 63 $graph = new Graph( 150, 150, 'auto' ); 64 $graph->SetScale('textint'); 65 $graph->SetMarginColor('whitesmoke'); 66 $graph->img->SetMargin( 30, 12, 32, 22 ); 67 68 $t_label_arr[] = 'Status'; 69 $graph->xaxis->SetTickLabels( $t_label_arr ); 70 $graph->xaxis->SetFont( FF_FONT1 ); 71 $graph->yaxis->SetFont( FF_FONT0 ); 72 73 $graph->title->Set( $s_reporter ); 74 $graph->title->SetFont( FF_FONT1 ); 75 $graph->title->SetMargin( 0 ); 76 77 $t_arr1 = array(); 78 $t_arr2 = array(); 79 $t_arr3 = array(); 80 $t_arr4 = array(); 81 $t_arr5 = array(); 82 $t_arr6 = array(); 83 $t_arr7 = array(); 84 85 $t_arr1[0] = $status_arr[10]; 86 $t_arr2[0] = $status_arr[20]; 87 $t_arr3[0] = $status_arr[30]; 88 $t_arr4[0] = $status_arr[40]; 89 $t_arr5[0] = $status_arr[50]; 90 $t_arr6[0] = $status_arr[80]; 91 $t_arr7[0] = $status_arr[90]; 92 93 $bplot1 = new BarPlot( $t_arr1 ); 94 $bplot2 = new BarPlot( $t_arr2 ); 95 $bplot3 = new BarPlot( $t_arr3 ); 96 $bplot4 = new BarPlot( $t_arr4 ); 97 $bplot5 = new BarPlot( $t_arr5 ); 98 $bplot6 = new BarPlot( $t_arr6 ); 99 $bplot7 = new BarPlot( $t_arr7 ); 100 101 $bplot1->SetFillColor( 'indianred2' ); 102 $bplot2->SetFillColor( 'maroon1' ); 103 $bplot3->SetFillColor( 'gold1' ); 104 $bplot4->SetFillColor( 'lightyellow' ); 105 $bplot5->SetFillColor( 'cornflowerblue' ); 106 $bplot6->SetFillColor( 'darkseagreen2' ); 107 $bplot7->SetFillColor( 'white' ); 108 109 $bplot1->SetShadow(); 110 $bplot2->SetShadow(); 111 $bplot3->SetShadow(); 112 $bplot4->SetShadow(); 113 $bplot5->SetShadow(); 114 $bplot6->SetShadow(); 115 $bplot7->SetShadow(); 116 117 /* $bplot1->SetLegend( 'New' ); 118 $bplot2->SetLegend( 'Feedback' ); 119 $bplot3->SetLegend( 'Acked' ); 120 $bplot4->SetLegend( 'Fixed' ); 121 $bplot5->SetLegend( 'Assigned' ); 122 $bplot6->SetLegend( 'Resolved' ); 123 $bplot7->SetLegend( 'Closed' );*/ 124 125 /* $bplot1->value->Show(); 126 $bplot2->value->Show(); 127 $bplot3->value->Show(); 128 $bplot4->value->Show(); 129 $bplot5->value->Show(); 130 $bplot6->value->Show(); 131 $bplot7->value->Show();*/ 132 133 $bplot1->value->SetFont( FF_FONT0 ); 134 $bplot2->value->SetFont( FF_FONT0 ); 135 $bplot3->value->SetFont( FF_FONT0 ); 136 $bplot4->value->SetFont( FF_FONT0 ); 137 $bplot5->value->SetFont( FF_FONT0 ); 138 $bplot6->value->SetFont( FF_FONT0 ); 139 $bplot7->value->SetFont( FF_FONT0 ); 140 141 $bplot1->value->SetColor( 'black', 'darkred' ); 142 $bplot2->value->SetColor( 'black', 'darkred' ); 143 $bplot3->value->SetColor( 'black', 'darkred' ); 144 $bplot4->value->SetColor( 'black', 'darkred' ); 145 $bplot5->value->SetColor( 'black', 'darkred' ); 146 $bplot6->value->SetColor( 'black', 'darkred' ); 147 $bplot7->value->SetColor( 'black', 'darkred' ); 148 149 $bplot1->value->SetFormat( '%d' ); 150 $bplot2->value->SetFormat( '%d' ); 151 $bplot3->value->SetFormat( '%d' ); 152 $bplot4->value->SetFormat( '%d' ); 153 $bplot5->value->SetFormat( '%d' ); 154 $bplot6->value->SetFormat( '%d' ); 155 $bplot7->value->SetFormat( '%d' ); 156 157 $gbarplot = new GroupBarPlot( array( $bplot1, $bplot2, $bplot3, $bplot4, $bplot5, $bplot6, $bplot7 ) ); 158 159 $gbarplot->SetWidth( 1.0 ); 160 $graph->Add( $gbarplot ); 161 162 $graph->Stroke(); 163 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |