mantis 在查看需求中增加显示“完成度”列信息

方法一:

mantis目录下找出文件view_all_inc.php,在文件中相应的位置添加红色字体段落。

<?php

# Mantis - a php based bugtracking system

# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org

# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net

# Mantis is free software: you can redistribute it and/or modify

# it under the terms of the GNU General Public License as published by

# the Free Software Foundation, either version 2 of the License, or

# (at your option) any later version.

#

# Mantis is distributed in the hope that it will be useful,

# but WITHOUT ANY WARRANTY; without even the implied warranty of

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

# GNU General Public License for more details.

#

# You should have received a copy of the GNU General Public License

# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.

      # --------------------------------------------------------

      # $Id: view_all_inc.php,v 1.172.2.1 2007-10-13 22:34:48 giallu Exp $

      # --------------------------------------------------------

?>

<?php

      $t_core_path = config_get( 'core_path' );

      require_once( $t_core_path.'current_user_api.php' );

      require_once( $t_core_path.'bug_api.php' );

      require_once( $t_core_path.'string_api.php' );

      require_once( $t_core_path.'date_api.php' );

      require_once( $t_core_path.'icon_api.php' );

      require_once( $t_core_path.'columns_api.php' );

      $t_filter = current_user_get_bug_filter();

      if( $t_filter ) {

           list( $t_sort, ) = split( ',', $t_filter['sort'] );

           list( $t_dir, ) = split( ',', $t_filter['dir'] );

      }

      $t_checkboxes_exist = false;

      $t_icon_path = config_get( 'icon_path' );

      $t_update_bug_threshold = config_get( 'update_bug_threshold' );

      $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_VIEW_PAGE );

      $col_count = sizeof( $t_columns );

      $t_filter_position = config_get( 'filter_position' );

      # -- ====================== FILTER FORM ========================= --

      if ( ( $t_filter_position & FILTER_POSITION_TOP ) == FILTER_POSITION_TOP ) {

           filter_draw_selection_area( $f_page_number );

      }

      # -- ====================== end of FILTER FORM ================== --

      # -- ====================== BUG LIST ============================ --

      $t_status_legend_position = config_get( 'status_legend_position' );

      if ( $t_status_legend_position == STATUS_LEGEND_POSITION_TOP || $t_status_legend_position == STATUS_LEGEND_POSITION_BOTH ) {

           html_status_legend();

      }

# @@@ (thraxisp) this may want a browser check  ( MS IE >= 5.0, Mozilla >= 1.0, Safari >=1.2, ...)

      if ( ( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ){

           ?>

           <script type="text/javascript" language="JavaScript">

           <!--

                 var string_loading = '<?php echo lang_get( 'loading' );?>';

           // -->

           </script>

           <script type="text/javascript" language="JavaScript" src="javascript/xmlhttprequest.js"></script>

           <script type="text/javascript" language="JavaScript" src="javascript/addLoadEvent.js"></script>

           <script type="text/javascript" language="JavaScript" src="javascript/dynamic_filters.js"></script>

           <?php

      }

?>

<br />

<form name="bug_action" method="get" action="bug_actiongroup_page.php">

<table id="buglist" class="width100" cellspacing="1">

<tr>

      <td class="form-title" colspan="<?php echo $col_count - 2; ?>">

           <?php

                 # -- Viewing range info --

                 $v_start = 0;

                 $v_end   = 0;

                 if ( sizeof( $rows ) > 0 ) {

                      if( $t_filter )

                            $v_start = $t_filter['per_page'] * (int)($f_page_number-1) +1;

                      else

                            $v_start = 1;

                      $v_end   = $v_start + sizeof( $rows ) -1;

                 }

                 echo lang_get( 'viewing_bugs_title' );

                 echo " ($v_start - $v_end / $t_bug_count)";

           ?>

           <span class="small"> <?php

                      # -- Print and Export links --

                      print_bracket_link( 'print_all_bug_page.php', lang_get( 'print_all_bug_page_link' ) );

                      echo '&nbsp;';

                      if ( ON == config_get( 'use_jpgraph' ) ) {

                          print_bracket_link( 'bug_graph_page.php', lang_get( 'graph_bug_page_link' ) );

                          echo '&nbsp;';

                      }

                      print_bracket_link( 'csv_export.php', lang_get( 'csv_export' ) );

           ?> </span>

      </td>

      <td class="right" colspan="2">

           <span class="small"> <?php

                 # -- Page number links --

                 $f_filter = gpc_get_int( 'filter', 0);

                 print_page_links( 'view_all_bug_page.php', 1, $t_page_count, (int)$f_page_number, $f_filter );

           ?> </span>

      </td>

</tr>

<?php # -- Bug list column header row -- ?>

<tr class="row-category">

<?php

           foreach( $t_columns as $t_column ) {

                 $t_title_function = 'print_column_title';

                 helper_call_custom_function( $t_title_function, array( $t_column ) );

           }

      helper_call_custom_function( $t_title_function, lang_get( 'description' ) );

?>

</tr>

 

<?php # -- Spacer row -- ?>

<tr class="spacer">

      <td colspan="<?php echo $col_count; ?>"></td>

</tr>

<?php

      function write_bug_rows ( $p_rows )

      {

           global $t_columns, $t_filter;

           $t_in_stickies = ( $t_filter && ( 'on' == $t_filter['sticky_issues'] ) );

           mark_time( 'begin loop' );

           # -- Loop over bug rows --

            $t_rows = sizeof( $p_rows );

           for( $i=0; $i < $t_rows; $i++ ) {

                 $t_row = $p_rows[$i];

           $bugid=$t_row['id'];

           $query="SELECT description FROM mantis_bug_text_table

                    where id='$bugid'";

          $result = db_query($query);

         $Description=db_result($result);

                 if ( ( 0 == $t_row['sticky'] ) && ( 0 == $i ) ) {

                      $t_in_stickies = false;

                 }

                 if ( ( 0 == $t_row['sticky'] ) && $t_in_stickies ) {   # demarcate stickies, if any have been shown

?>

               <tr>

                       <td class="left" colspan="<?php echo sizeof( $t_columns ); ?>" bgcolor="#999999">&nbsp;</td>

               </tr>

<?php

                      $t_in_stickies = false;

                 }

                 # choose color based on status

                 $status_color = get_status_color( $t_row['status'] );

                 echo '<tr bgcolor="', $status_color, '" border="1">';

                 foreach( $t_columns as $t_column ) {

                      $t_column_value_function = 'print_column_value';

                      helper_call_custom_function( $t_column_value_function, array( $t_column, $t_row ) );

                 }

             helper_call_custom_function( $t_column_value_function, array($Description , $i) );

                 echo '</tr>';

           }

      }

      write_bug_rows($rows);

      # -- ====================== end of BUG LIST ========================= --

      # -- ====================== MASS BUG MANIPULATION =================== --

?>

      <tr>

           <td class="left" colspan="<?php echo $col_count-2; ?>">

<?php

           if ( $t_checkboxes_exist && ON == config_get( 'use_javascript' ) ) {

                 echo "<input type=/"checkbox/" name=/"all_bugs/" value=/"all/" οnclick=/"checkall('bug_action', this.form.all_bugs.checked)/" /><span class=/"small/">" . lang_get( 'select_all' ) . '</span>';

           }

           if ( $t_checkboxes_exist ) {

?>

                 <select name="action">

                      <?php print_all_bug_action_option_list() ?>

                 </select>

                 <input type="submit" class="button" value="<?php echo lang_get( 'ok' ); ?>" />

方法二:

 

1、在代码 custom_function_api.php 中增加     $t_columns[]='resolution'; 在文件中相应的位置添加红色字体段落。

 function custom_function_default_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
  $t_columns = array();

  if ( $p_columns_target == COLUMNS_TARGET_CSV_PAGE ) {
   $t_columns[] = 'id'; // localized: 'id',
   $t_columns[] = 'project_id'; // 'email_project'
   $t_columns[] = 'reporter_id'; // 'reporter'
   $t_columns[] = 'handler_id'; // 'assigned_to'
   $t_columns[] = 'priority'; // 'priority'
   $t_columns[] = 'severity'; // 'severity'
   $t_columns[] = 'reproducibility'; // 'reproducibility'
   $t_columns[] = 'version'; // 'version'
   $t_columns[] = 'projection'; // 'projection'
   $t_columns[] = 'category'; // 'category'
   $t_columns[] = 'date_submitted'; // 'date_submitted'
   $t_columns[] = 'eta'; // 'eta'
   $t_columns[] = 'os'; // 'os'
   $t_columns[] = 'os_build'; // 'os_version'
   $t_columns[] = 'platform'; // 'platform'
   $t_columns[] = 'view_state'; // 'view_status'
   $t_columns[] = 'last_updated'; // 'last_update'
   $t_columns[] = 'summary'; // 'summary'
   $t_columns[] = 'status'; // 'status'
   $t_columns[] = 'resolution'; // 'resolution'
   $t_columns[] = 'fixed_in_version'; // 'fixed_in_version';

   if ( OFF == config_get( 'enable_relationship' ) ) {
    $t_columns[] = 'duplicate_id'; // 'duplicate_id'
   }
  } else {
   $t_columns[] = 'selection';

   if ( $p_columns_target == COLUMNS_TARGET_VIEW_PAGE ) {
    $t_columns[] = 'edit';
   }

   $t_columns[] = 'priority';
   $t_columns[] = 'id';

   $t_enable_sponsorship = config_get( 'enable_sponsorship' );
   if ( ON == $t_enable_sponsorship ) {
    $t_columns[] = 'sponsorship_total';
   }

   $t_columns[] = 'bugnotes_count';

   $t_show_attachments = config_get( 'show_attachment_indicator' );
   if ( ON == $t_show_attachments ) {
    $t_columns[] = 'attachment';
   }

   $t_columns[] = 'category';
   $t_columns[] = 'severity';
   $t_columns[]='resolution';
   $t_columns[] = 'status';
   $t_columns[] = 'last_updated';
   $t_columns[] = 'summary';
  }

  return $t_columns;
 }
2、在columns_api.php中增加        
      function print_column_resolution($p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ){
        echo '<td class="center">';
        printf( '<u>%s</a></u>'
          ,get_enum_element('resolution', $p_row['resolution'] )
          );
        echo '</td>';
       }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值