[ Index ]
 

Code source de Mantis 1.1.0rc3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/ -> bug_graph_page.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: bug_graph_page.php,v 1.2.2.1 2007-10-13 22:32:42 giallu Exp $
  22      # --------------------------------------------------------
  23  ?>
  24  <?php
  25      require_once ( 'core.php' );
  26  
  27      $t_core_path = config_get( 'core_path' );
  28      require_once( $t_core_path.'class.period.php' );
  29  
  30      access_ensure_project_level( config_get( 'view_summary_threshold' ) );
  31  
  32      $f_interval = gpc_get_int( 'interval', 0 );
  33      $t_today = date( 'Y-m-d' );
  34      $f_type = gpc_get_int( 'graph_type', config_get( 'default_graph_type' ) );
  35      $f_show_as_table = gpc_get_bool( 'show_table', FALSE );
  36  
  37      html_page_top1( lang_get( 'graph_page' ) );
  38      $t_path = config_get( 'path' );
  39      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $t_path . "javascript/jscalendar/calendar-blue.css\" /> \n";
  40      echo "<script type=\"text/javascript\" src=\"" . $t_path . "javascript/jscalendar/calendar.js\"></script> \n";
  41      echo "<script type=\"text/javascript\" src=\"" . $t_path . "javascript/jscalendar/lang/calendar-en.js\"></script> \n";
  42      echo "<script type=\"text/javascript\" src=\"" . $t_path . "javascript/jscalendar/calendar-setup.js\"></script> \n";
  43      html_page_top2();
  44  
  45      $t_period = new Period();
  46      $t_period->set_period_from_selector( 'interval' );
  47      $t_types = array(
  48          0 => lang_get( 'select' ),
  49          1 => lang_get( 'select_bystatus'),
  50          2 => lang_get( 'select_summbystatus'),
  51          3 => lang_get( 'select_bycat'),
  52          6 => lang_get( 'select_both')
  53      );
  54      
  55      $t_show = array(
  56          0 => lang_get( 'show_as_graph' ),
  57          1 => lang_get( 'show_as_table' ),
  58      );
  59      
  60  ?>
  61      <form name="graph_form" method="post" action="bug_graph_page.php">
  62      <table class="width100" cellspacing="1">
  63  
  64      <tr>
  65          <td>
  66              <?php echo get_dropdown( $t_types, 'graph_type', $f_type ); ?>
  67          </td>
  68          <td>
  69              <?php echo $t_period->period_selector( 'interval' ); ?>
  70          </td>
  71          <td>
  72              <?php echo get_dropdown( $t_show, 'show_table', $f_show_as_table ? 1 : 0 ); ?>
  73          </td>
  74          <td>
  75              <input type="submit" name="show" value="<?php echo lang_get( 'show_graph' ); ?>"/>
  76          </td>
  77      </tr>
  78      </table>
  79      </form>
  80  <?php
  81      if ( ( 0 != $f_type ) && ( $f_interval > 0 ) && ( gpc_get( 'show', '' ) != '') ) {   // show selected info
  82          $t_width = config_get( 'graph_window_width' );
  83          $t_summary = ( $f_type % 2 ) == 0;
  84          $t_body = (int)( $f_type / 2 );
  85          $f_start = $t_period->get_start_formatted();
  86          $f_end = $t_period->get_end_formatted();
  87          if ( ($t_body == 1 ) || ($t_body == 3) ) {
  88              if ( $f_show_as_table ) {
  89                  echo '<br /><IFRAME SRC="bug_graph_bystatus.php?width='.$t_width.'&interval=' . $f_interval . 
  90                      '&start_date=' . $f_start . '&end_date=' . $f_end .
  91                      '&summary=' . $t_summary . '&show_table=1" width="100%" height="80%" frameborder="0"' .
  92                      ' marginwidth="0" marginheight="0"></IFRAME>';
  93              } else {
  94                  echo '<br /><img src="bug_graph_bystatus.php?width=600&interval=' . $f_interval . 
  95                      '&start_date=' . $f_start . '&end_date=' . $f_end .
  96                      '&summary=' . $t_summary . '&show_table=0" alt="Bug Graph"';
  97              }
  98          }       
  99          if ( ($t_body == 2 ) || ($t_body == 3) ) {
 100              if ( $f_show_as_table ) {
 101                  echo '<br /><IFRAME SRC="bug_graph_bycategory.php?width='.$t_width.'&interval=' . $f_interval . 
 102                      '&start_date=' . $f_start . '&end_date=' . $f_end .
 103                      '&summary=' . $t_summary . '&show_table=1" width="100%" height="80%" frameborder="0"' .
 104                      ' marginwidth="0" marginheight="0"></IFRAME>';
 105              } else {
 106                  echo '<br /><img src="bug_graph_bycategory.php?width=600&interval=' . $f_interval . 
 107                      '&start_date=' . $f_start . '&end_date=' . $f_end .
 108                      '&summary=' . $t_summary . '&show_table=0" alt="Bug Graph"';
 109              }
 110          }
 111      }
 112  
 113      html_page_bottom1( __FILE__ );
 114  ?>


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