[ 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 # -------------------------------------------------------- 21 # $Id: billing_inc.php,v 1.14.2.1 2007-10-13 22:32:29 giallu Exp $ 22 # -------------------------------------------------------- 23 ?> 24 <?php 25 # This include file prints out the bug bugnote_stats 26 27 # $f_bug_id must already be defined 28 ?> 29 <?php 30 $t_core_path = config_get( 'core_path' ); 31 32 require_once( $t_core_path.'bugnote_api.php' ); 33 ?> 34 <?php 35 if ( ! config_get('time_tracking_enabled') ) 36 return; 37 ?> 38 39 <a name="bugnotestats" id="bugnotestats" /><br /> 40 41 <?php 42 collapse_open( 'bugnotestats' ); 43 ?> 44 45 <table class="width100" cellspacing="0"> 46 <tr> 47 <td class="form-title" colspan="4"> 48 <?php collapse_icon( 'bugnotestats' ); 49 echo lang_get( 'time_tracking' ) ?> 50 </td> 51 </tr> 52 </table> 53 <?php 54 collapse_closed( 'bugnotestats' ); 55 56 $t_today = date( "d:m:Y" ); 57 $t_date_submitted = isset( $t_bug ) ? date( "d:m:Y", $t_bug->date_submitted ) : $t_today; 58 59 $t_bugnote_stats_from_def = $t_date_submitted; 60 $t_bugnote_stats_from_def_ar = explode ( ":", $t_bugnote_stats_from_def ); 61 $t_bugnote_stats_from_def_d = $t_bugnote_stats_from_def_ar[0]; 62 $t_bugnote_stats_from_def_m = $t_bugnote_stats_from_def_ar[1]; 63 $t_bugnote_stats_from_def_y = $t_bugnote_stats_from_def_ar[2]; 64 65 $t_bugnote_stats_from_d = gpc_get_int('start_day', $t_bugnote_stats_from_def_d); 66 $t_bugnote_stats_from_m = gpc_get_int('start_month', $t_bugnote_stats_from_def_m); 67 $t_bugnote_stats_from_y = gpc_get_int('start_year', $t_bugnote_stats_from_def_y); 68 69 $t_bugnote_stats_to_def = $t_today; 70 $t_bugnote_stats_to_def_ar = explode ( ":", $t_bugnote_stats_to_def ); 71 $t_bugnote_stats_to_def_d = $t_bugnote_stats_to_def_ar[0]; 72 $t_bugnote_stats_to_def_m = $t_bugnote_stats_to_def_ar[1]; 73 $t_bugnote_stats_to_def_y = $t_bugnote_stats_to_def_ar[2]; 74 75 $t_bugnote_stats_to_d = gpc_get_int('end_day', $t_bugnote_stats_to_def_d); 76 $t_bugnote_stats_to_m = gpc_get_int('end_month', $t_bugnote_stats_to_def_m); 77 $t_bugnote_stats_to_y = gpc_get_int('end_year', $t_bugnote_stats_to_def_y); 78 79 $f_get_bugnote_stats_button = gpc_get_string('get_bugnote_stats_button', ''); 80 $f_bugnote_cost = gpc_get_int( 'bugnote_cost', '' ); 81 $f_project_id = helper_get_current_project(); 82 83 if ( ON == config_get( 'time_tracking_with_billing' ) ) { 84 $t_cost_col = true; 85 } else { 86 $t_cost_col = false; 87 } 88 89 ?> 90 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> 91 <input type="hidden" name="id" value="<?php echo isset( $f_bug_id ) ? $f_bug_id : 0 ?>" /> 92 <table border=0 class="width100" cellspacing="0"> 93 <tr> 94 <td class="form-title" colspan="4"> 95 <?php 96 collapse_icon( 'bugnotestats' ); 97 ?> 98 <?php echo lang_get( 'time_tracking' ) ?> 99 </td> 100 </tr> 101 <tr class="row-2"> 102 <td class="category" width="25%"> 103 <?php 104 $t_filter = array(); 105 $t_filter['do_filter_by_date'] = 'on'; 106 $t_filter['start_day'] = $t_bugnote_stats_from_d; 107 $t_filter['start_month'] = $t_bugnote_stats_from_m; 108 $t_filter['start_year'] = $t_bugnote_stats_from_y; 109 $t_filter['end_day'] = $t_bugnote_stats_to_d; 110 $t_filter['end_month'] = $t_bugnote_stats_to_m; 111 $t_filter['end_year'] = $t_bugnote_stats_to_y; 112 print_filter_do_filter_by_date(true); 113 ?> 114 </td> 115 </tr> 116 <?php if ( $t_cost_col ) { ?> 117 <tr class="row-1"> 118 <td> 119 <?php echo lang_get( 'time_tracking_cost' ) ?>: 120 <input type="text" name="bugnote_cost" value="<?php echo $f_bugnote_cost ?>" /> 121 </td> 122 </tr> 123 <?php } ?> 124 <tr> 125 <td class="center" colspan="2"> 126 <input type="submit" class="button" name="get_bugnote_stats_button" value="<?php echo lang_get( 'time_tracking_get_info_button' ) ?>" /> 127 </td> 128 </tr> 129 130 </table> 131 </form> 132 <?php 133 if ( !is_blank( $f_get_bugnote_stats_button ) ) { 134 $t_from = "$t_bugnote_stats_from_y-$t_bugnote_stats_from_m-$t_bugnote_stats_from_d"; 135 $t_to = "$t_bugnote_stats_to_y-$t_bugnote_stats_to_m-$t_bugnote_stats_to_d"; 136 $t_bugnote_stats = bugnote_stats_get_project_array( $f_project_id, $t_from, $t_to, $f_bugnote_cost ); 137 138 if ( is_blank( $f_bugnote_cost ) || ( (double)$f_bugnote_cost == 0 ) ) { 139 $t_cost_col = false; 140 } 141 142 $t_prev_id = -1; 143 ?> 144 <br /> 145 <table border="0" class="width100" cellspacing="0"> 146 <tr class="row-category-history"> 147 <td class="small-caption"> 148 <?php echo lang_get( 'username' ) ?> 149 </td> 150 <td class="small-caption"> 151 <?php echo lang_get( 'time_tracking' ) ?> 152 </td> 153 <?php if ( $t_cost_col) { ?> 154 <td class="small-caption"> 155 <?php echo lang_get( 'time_tracking_cost' ) ?> 156 </td> 157 <?php } ?> 158 159 </tr> 160 <?php 161 $t_sum_in_minutes = 0; 162 163 foreach ( $t_bugnote_stats as $t_item ) { 164 $t_sum_in_minutes += $t_item['sum_time_tracking']; 165 166 $t_item['sum_time_tracking'] = db_minutes_to_hhmm( $t_item['sum_time_tracking'] ); 167 if ( $t_item['bug_id'] != $t_prev_id) { 168 $t_link = string_get_bug_view_link( $t_item['bug_id'] ) . ": " . string_display( $t_item['summary'] ); 169 echo '<tr class="row-category-history"><td colspan="4">' . $t_link . "</td></tr>"; 170 $t_prev_id = $t_item['bug_id']; 171 } 172 ?> 173 <tr <?php echo helper_alternate_class() ?>> 174 <td class="small-caption"> 175 <?php echo $t_item['username'] ?> 176 </td> 177 <td class="small-caption"> 178 <?php echo $t_item['sum_time_tracking'] ?> 179 </td> 180 <?php if ($t_cost_col) { ?> 181 <td> 182 <?php echo string_attribute( number_format( $t_item['cost'], 2 ) ); ?> 183 </td> 184 <?php } ?> 185 </tr> 186 <?php } # end for loop 187 ?> 188 <tr <?php echo helper_alternate_class() ?>> 189 <td class="small-caption"> 190 <?php echo lang_get( 'total_time' ); ?> 191 </td> 192 <td class="small-caption"> 193 <?php echo db_minutes_to_hhmm( $t_sum_in_minutes ); ?> 194 </td> 195 </tr> 196 </table> 197 <?php } # end if ?> 198 <?php 199 collapse_end( 'bugnotestats' ); 200 ?>
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 |
![]() |