[ PHPXref.com ] [ Generated: Sun Jul 20 18:33:16 2008 ] [ Mantis 1.0.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> my_view_page.php (source)

   1  <?php
   2      # Mantis - a php based bugtracking system
   3      # Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
   4      # Copyright (C) 2002 - 2004  Mantis Team   - mantisbt-dev@lists.sourceforge.net
   5      # This program is distributed under the terms and conditions of the GPL
   6      # See the README and LICENSE files for details
   7  
   8      # --------------------------------------------------------
   9      # $Id: my_view_page.php,v 1.12.8.1 2006/01/24 04:10:44 thraxisp Exp $
  10      # --------------------------------------------------------
  11  ?>
  12  <?php
  13      require_once ( 'core.php' );
  14  
  15      $t_core_path = config_get( 'core_path' );
  16  
  17      require_once( $t_core_path . 'compress_api.php' );
  18      require_once( $t_core_path . 'filter_api.php' );
  19  
  20      auth_ensure_user_authenticated();
  21  
  22      $t_current_user_id = auth_get_current_user_id();
  23  
  24      compress_enable();
  25  
  26      html_page_top1( lang_get( 'my_view_link' ) );
  27  
  28      if ( current_user_get_pref( 'refresh_delay' ) > 0 ) {
  29          html_meta_redirect( 'my_view_page.php', current_user_get_pref( 'refresh_delay' )*60 );
  30      }
  31  
  32      html_page_top2();
  33  
  34      $f_page_number        = gpc_get_int( 'page_number', 1 );
  35  
  36      $t_per_page = config_get( 'my_view_bug_count' );
  37      $t_bug_count = null;
  38      $t_page_count = null;
  39  
  40      $t_boxes = config_get( 'my_view_boxes' );
  41      asort ($t_boxes);
  42      reset ($t_boxes);
  43      #print_r ($t_boxes);
  44  
  45      $t_project_id = helper_get_current_project();
  46  ?>
  47  
  48  <div align="center">
  49  <table class="hide" border="0" cellspacing="3" cellpadding="0">
  50  
  51  <?php
  52      if ( STATUS_LEGEND_POSITION_TOP == config_get( 'status_legend_position' ) ) {
  53          echo '<tr>';
  54          echo '<td colspan="2">';
  55          html_status_legend();
  56          echo '</td>';
  57          echo '</tr>';
  58      }
  59      if ( ON == config_get( 'status_percentage_legend' ) ) {
  60          echo '<tr>';
  61          echo '<td colspan="2">';
  62          html_status_percentage_legend();
  63          echo '</td>';
  64          echo '</tr>';
  65      }
  66  ?>
  67  
  68  <?php
  69      $t_number_of_boxes = count ( $t_boxes );
  70      $t_boxes_position = config_get( 'my_view_boxes_fixed_position' );
  71      $t_counter = 0;
  72  
  73      while (list ($t_box_title, $t_box_display) = each ($t_boxes)) {
  74          # don't display bugs that are set as 0
  75          if ($t_box_display == 0) {
  76              $t_number_of_boxes = $t_number_of_boxes - 1;
  77          }
  78  
  79          # don't display "Assigned to Me" bugs to users that bugs can't be assigned to
  80          else if ( $t_box_title == 'assigned' && ( current_user_is_anonymous() OR user_get_assigned_open_bug_count( $t_current_user_id, $t_project_id ) == 0 ) ) {
  81              $t_number_of_boxes = $t_number_of_boxes - 1;
  82          }
  83  
  84          # don't display "Monitored by Me" bugs to users that can't monitor bugs
  85          else if ( $t_box_title == 'monitored' && ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'monitor_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
  86              $t_number_of_boxes = $t_number_of_boxes - 1;
  87          }
  88  
  89          # don't display "Reported by Me" bugs to users that can't report bugs
  90          else if ( in_array( $t_box_title, array( 'reported', 'feedback', 'verify' ) ) && 
  91                  ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
  92              $t_number_of_boxes = $t_number_of_boxes - 1;
  93          }
  94  
  95          # display the box
  96          else {
  97              $t_counter++;
  98  
  99              # check the style of displaying boxes - fixed (ie. each box in a separate table cell) or not
 100              if ( ON == $t_boxes_position ) {
 101                  # for even box number start new row and column
 102                  if ( 1 == $t_counter%2 ) {
 103                      echo '<tr><td valign="top" width="50%">';
 104                      include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
 105                      echo '</td>';
 106                  }
 107  
 108                  # for odd box number only start new column
 109                  elseif ( 0 == $t_counter%2 ) {
 110                      echo '<td valign="top" width="50%">';
 111                      include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
 112                      echo '</td></tr>';
 113                  }
 114  
 115                  # for odd number of box display one empty table cell in second column
 116                  if ( ( $t_counter == $t_number_of_boxes ) && 1 == $t_counter%2 ) {
 117                      echo '<td valign="top" width="50%"></td></tr>';
 118                  }
 119              }
 120              else if ( OFF == $t_boxes_position ) {
 121                  # start new table row and column for first box
 122                  if ( 1 == $t_counter ) {
 123                      echo '<tr><td valign="top" width="50%">';
 124                  }
 125  
 126                  # start new table column for the second half of boxes
 127                  if ( $t_counter == ceil ($t_number_of_boxes/2) + 1 ) {
 128                      echo '<td valign="top" width="50%">';
 129                  }
 130  
 131                  # display the required box
 132                  include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
 133                  echo '<br />';
 134  
 135                  # close the first column for first half of boxes
 136                  if ( $t_counter == ceil ($t_number_of_boxes/2) ) {
 137                      echo '</td>';
 138                  }
 139  
 140                  # close the table row after all of the boxes
 141                  if ( $t_counter == $t_number_of_boxes ) {
 142                      echo '</td></tr>';
 143                  }
 144              }
 145          }
 146      }
 147  
 148  ?>
 149  
 150  <?php
 151      if ( STATUS_LEGEND_POSITION_BOTTOM == config_get( 'status_legend_position' ) ) {
 152          echo '<tr>';
 153          echo '<td colspan="2">';
 154          html_status_legend();
 155          echo '</td>';
 156          echo '</tr>';
 157      }
 158  ?>
 159  
 160  </table>
 161  </div>
 162  
 163  <?php
 164      html_page_bottom1( __FILE__ );
 165  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]