[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/graphs/ -> graph_assigned_to_me.php (source)

   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      # --------------------------------------------------------
  21      # $Id: graph_assigned_to_me.php,v 1.8.22.1 2007-10-13 22:35:51 giallu Exp $
  22      # --------------------------------------------------------
  23  ?>
  24  <?php
  25      require_once ( '../core.php' );
  26  
  27      $t_core_path = config_get( 'core_path' );
  28  
  29      require_once( $t_core_path.'graph_api.php' );
  30  ?>
  31  <?php
  32      # Grab Data
  33      # ---
  34  
  35      $t_project_id = helper_get_current_project();
  36  
  37      $data_category_arr = array();
  38      $data_count_arr = array();
  39      $t_user_id = auth_get_current_user_id();
  40      $query = "SELECT status, COUNT( status ) as count
  41              FROM mantis_bug_table
  42              WHERE project_id='$t_project_id' AND
  43                    handler_id='$t_user_id'
  44              GROUP BY status
  45              ORDER BY status";
  46      $result = db_query( $query );
  47      $status_count = db_num_rows( $result );
  48  
  49      $status_arr = array();
  50      $status_arr[10] = 0;
  51      $status_arr[20] = 0;
  52      $status_arr[30] = 0;
  53      $status_arr[40] = 0;
  54      $status_arr[50] = 0;
  55      $status_arr[80] = 0;
  56      $status_arr[90] = 0;
  57      for ($i=0;$i<$status_count;$i++) {
  58          $row = db_fetch_array( $result );
  59          extract( $row );
  60  
  61          $status_arr[$status] = $count;
  62      }
  63  
  64      # Setup Graph
  65      # ---
  66  
  67      $graph = new Graph( 150, 150, 'auto' );
  68      $graph->SetScale('textint');
  69      $graph->SetMarginColor('whitesmoke');
  70      $graph->img->SetMargin( 30, 12, 32, 22 );
  71  
  72      $t_label_arr[] = 'Status';
  73      $graph->xaxis->SetTickLabels( $t_label_arr );
  74      $graph->xaxis->SetFont( FF_FONT1 );
  75      $graph->yaxis->SetFont( FF_FONT0 );
  76  
  77      $graph->title->Set( $s_assigned_to );
  78      $graph->title->SetFont( FF_FONT1 );
  79      $graph->title->SetMargin( 0 );
  80  
  81      $t_arr1 = array();
  82      $t_arr2 = array();
  83      $t_arr3 = array();
  84      $t_arr4 = array();
  85      $t_arr5 = array();
  86      $t_arr6 = array();
  87      $t_arr7 = array();
  88  
  89      $t_arr1[0] = $status_arr[10];
  90      $t_arr2[0] = $status_arr[20];
  91      $t_arr3[0] = $status_arr[30];
  92      $t_arr4[0] = $status_arr[40];
  93      $t_arr5[0] = $status_arr[50];
  94      $t_arr6[0] = $status_arr[80];
  95      $t_arr7[0] = $status_arr[90];
  96  
  97      $bplot1 = new BarPlot( $t_arr1 );
  98      $bplot2 = new BarPlot( $t_arr2 );
  99      $bplot3 = new BarPlot( $t_arr3 );
 100      $bplot4 = new BarPlot( $t_arr4 );
 101      $bplot5 = new BarPlot( $t_arr5 );
 102      $bplot6 = new BarPlot( $t_arr6 );
 103      $bplot7 = new BarPlot( $t_arr7 );
 104  
 105      $bplot1->SetFillColor( 'indianred2' );
 106      $bplot2->SetFillColor( 'maroon1' );
 107      $bplot3->SetFillColor( 'gold1' );
 108      $bplot4->SetFillColor( 'lightyellow' );
 109      $bplot5->SetFillColor( 'cornflowerblue' );
 110      $bplot6->SetFillColor( 'darkseagreen2' );
 111      $bplot7->SetFillColor( 'white' );
 112  
 113      $bplot1->SetShadow();
 114      $bplot2->SetShadow();
 115      $bplot3->SetShadow();
 116      $bplot4->SetShadow();
 117      $bplot5->SetShadow();
 118      $bplot6->SetShadow();
 119      $bplot7->SetShadow();
 120  
 121  /*    $bplot1->SetLegend( 'New' );
 122      $bplot2->SetLegend( 'Feedback' );
 123      $bplot3->SetLegend( 'Acked' );
 124      $bplot4->SetLegend( 'Fixed' );
 125      $bplot5->SetLegend( 'Assigned' );
 126      $bplot6->SetLegend( 'Resolved' );
 127      $bplot7->SetLegend( 'Closed' );*/
 128  
 129  /*    $bplot1->value->Show();
 130      $bplot2->value->Show();
 131      $bplot3->value->Show();
 132      $bplot4->value->Show();
 133      $bplot5->value->Show();
 134      $bplot6->value->Show();
 135      $bplot7->value->Show();*/
 136  
 137      $bplot1->value->SetFont( FF_FONT0 );
 138      $bplot2->value->SetFont( FF_FONT0 );
 139      $bplot3->value->SetFont( FF_FONT0 );
 140      $bplot4->value->SetFont( FF_FONT0 );
 141      $bplot5->value->SetFont( FF_FONT0 );
 142      $bplot6->value->SetFont( FF_FONT0 );
 143      $bplot7->value->SetFont( FF_FONT0 );
 144  
 145      $bplot1->value->SetColor( 'black', 'darkred' );
 146      $bplot2->value->SetColor( 'black', 'darkred' );
 147      $bplot3->value->SetColor( 'black', 'darkred' );
 148      $bplot4->value->SetColor( 'black', 'darkred' );
 149      $bplot5->value->SetColor( 'black', 'darkred' );
 150      $bplot6->value->SetColor( 'black', 'darkred' );
 151      $bplot7->value->SetColor( 'black', 'darkred' );
 152  
 153      $bplot1->value->SetFormat( '%d' );
 154      $bplot2->value->SetFormat( '%d' );
 155      $bplot3->value->SetFormat( '%d' );
 156      $bplot4->value->SetFormat( '%d' );
 157      $bplot5->value->SetFormat( '%d' );
 158      $bplot6->value->SetFormat( '%d' );
 159      $bplot7->value->SetFormat( '%d' );
 160  
 161      $gbarplot = new GroupBarPlot( array( $bplot1, $bplot2, $bplot3, $bplot4, $bplot5, $bplot6, $bplot7 ) );
 162  
 163      $gbarplot->SetWidth( 1.0 );
 164      $graph->Add( $gbarplot );
 165  
 166      $graph->Stroke();
 167  ?>


Généré le : Thu Nov 29 09:42:17 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics