diff -r -u mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/billing_inc.php mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/billing_inc.php --- mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/billing_inc.php 2009-07-22 10:04:12.000000000 +0200 +++ mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/billing_inc.php 2009-08-03 14:47:10.000000000 +0200 @@ -62,6 +62,14 @@ $t_bugnote_stats_to_y = gpc_get_int('end_year', $t_bugnote_stats_to_def_y); $f_get_bugnote_stats_button = gpc_get_string('get_bugnote_stats_button', ''); + if ( access_has_project_level( config_get( 'time_tracking_reporting_select_reporter_threshold' ) ) ) { + $t_select_reporter = true; + $f_reporter_id = gpc_get_int( 'reporter_id', ALL_USERS ); + } + else { + $t_select_reporter = false; + $f_reporter_id = auth_get_current_user_id(); + } $f_bugnote_cost = gpc_get_int( 'bugnote_cost', '' ); $f_project_id = helper_get_current_project(); @@ -75,17 +83,20 @@
- +
- - - > + + + +> + + + + - +> + @@ -119,7 +145,7 @@ if ( !is_blank( $f_get_bugnote_stats_button ) ) { $t_from = "$t_bugnote_stats_from_y-$t_bugnote_stats_from_m-$t_bugnote_stats_from_d"; $t_to = "$t_bugnote_stats_to_y-$t_bugnote_stats_to_m-$t_bugnote_stats_to_d"; - $t_bugnote_stats = bugnote_stats_get_project_array( $f_project_id, $t_from, $t_to, $f_bugnote_cost ); + $t_bugnote_stats = bugnote_stats_get_project_array( $f_project_id, $t_from, $t_to, $f_bugnote_cost, $f_reporter_id ); if ( is_blank( $f_bugnote_cost ) || ( (double)$f_bugnote_cost == 0 ) ) { $t_cost_col = false; diff -r -u mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/config_defaults_inc.php mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/config_defaults_inc.php --- mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/config_defaults_inc.php 2009-08-03 10:03:23.000000000 +0200 +++ mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/config_defaults_inc.php 2009-08-03 15:08:56.000000000 +0200 @@ -3608,6 +3608,12 @@ $g_time_tracking_reporting_threshold = MANAGER; /** + * access level required to select reporter when running reports + * @global int $g_time_tracking_reporting_threshold + */ + $g_time_tracking_reporting_select_reporter_threshold = MANAGER; + + /** * allow time tracking to be recorded without a bugnote * @global int $g_time_tracking_without_note */ diff -r -u mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/core/bugnote_api.php mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/core/bugnote_api.php --- mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/core/bugnote_api.php 2009-07-10 16:04:01.000000000 +0200 +++ mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/core/bugnote_api.php 2009-08-03 15:21:59.000000000 +0200 @@ -611,10 +611,11 @@ * @param string $p_from Starting date (yyyy-mm-dd) inclusive, if blank, then ignored. * @param string $p_to Ending date (yyyy-mm-dd) inclusive, if blank, then ignored. * @param int $p_cost cost + * @param int $p_reporter_id Id of reporter, if blank, then ignored. * @return array array of bugnote stats * @access public */ -function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost ) { +function bugnote_stats_get_project_array( $p_project_id, $p_from, $p_to, $p_cost, $p_reporter_id = ALL_USERS ) { $c_project_id = db_prepare_int( $p_project_id ); $c_to = strtotime( $p_to, SECONDS_PER_DAY - 1); // @23:59:59 @@ -626,6 +627,7 @@ } $c_cost = db_prepare_double( $p_cost ); + $c_reporter_id = db_prepare_int( $p_reporter_id ); $t_bug_table = db_get_table( 'mantis_bug_table' ); $t_user_table = db_get_table( 'mantis_user_table' ); @@ -644,17 +646,23 @@ } if( ALL_PROJECTS != $c_project_id ) { - $t_project_where = " AND b.project_id = '$c_project_id' AND bn.bug_id = b.id "; + $t_project_where = " AND b.project_id = '$c_project_id' AND bn.bug_id = b.id"; } else { $t_project_where = ''; } + if( ALL_USERS != $c_reporter_id ) { + $t_reporter_where = " AND bn.reporter_id = '$c_reporter_id'"; + } else { + $t_reporter_where = ''; + } + $t_results = array(); $query = "SELECT username, summary, bn.bug_id, SUM(time_tracking) AS sum_time_tracking FROM $t_user_table u, $t_bugnote_table bn, $t_bug_table b WHERE u.id = bn.reporter_id AND bn.time_tracking != 0 AND bn.bug_id = b.id - $t_project_where $t_from_where $t_to_where + $t_project_where $t_from_where $t_to_where $t_reporter_where GROUP BY bn.bug_id, u.id, u.username, b.summary ORDER BY bn.bug_id"; diff -r -u mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/lang/strings_german_eintrag.txt mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/lang/strings_german_eintrag.txt --- mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/lang/strings_german_eintrag.txt 2009-07-16 10:03:34.000000000 +0200 +++ mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/lang/strings_german_eintrag.txt 2009-08-03 14:49:43.000000000 +0200 @@ -1443,6 +1443,7 @@ $s_time_tracking_get_info_button = 'Zeiterfassungs-Informationen abfragen'; $s_time_tracking_cost_per_hour = 'Kosten / Stunde'; $s_time_tracking_cost = 'Kosten'; +$s_time_tracking_period = 'Zeitraum'; $s_total_time_for_issue = 'Gesamtzeit für den Eintrag = %s'; $s_access_denied = $MANTIS_ERROR[ERROR_ACCESS_DENIED]; diff -r -u mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/lang/strings_german.txt mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/lang/strings_german.txt --- mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22.org/lang/strings_german.txt 2009-08-03 10:03:18.000000000 +0200 +++ mantisbt-1.2.0rc2-2009-08-03-master-1.2.x-e4c9e22/lang/strings_german.txt 2009-08-03 15:25:29.000000000 +0200 @@ -1205,6 +1205,7 @@ $s_time_tracking_get_info_button = 'Zeiterfassungs-Informationen abfragen'; $s_time_tracking_cost_per_hour = 'Kosten / Stunde'; $s_time_tracking_cost = 'Kosten'; +$s_time_tracking_period = 'Zeitraum'; $s_total_time_for_issue = 'Gesamtzeit für den Eintrag = %1$s'; $s_access_denied = 'Zugriff verweigert.'; $s_twitter_resolved = '%1$d: [%2$s] %3$s (erledigt von %4$s in %5$s)';
+
+
+ +
+ + + +
+ + - : - + name="bugnote_cost" value="" />