diff -r -u mantis.org/billing_inc.php mantis/billing_inc.php --- mantis.org/billing_inc.php 2008-05-22 04:50:55.000000000 +0200 +++ mantis/billing_inc.php 2009-07-02 14:43:43.000000000 +0200 @@ -65,6 +65,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(); @@ -77,17 +85,20 @@ ?>
- +
- - - > + + + +> + + + + - +> + @@ -121,7 +147,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_reporter_id, $f_bugnote_cost ); if ( is_blank( $f_bugnote_cost ) || ( (double)$f_bugnote_cost == 0 ) ) { $t_cost_col = false; diff -r -u mantis.org/config_defaults_inc.php mantis/config_defaults_inc.php --- mantis.org/config_defaults_inc.php 2009-07-02 14:02:27.000000000 +0200 +++ mantis/config_defaults_inc.php 2009-07-02 14:22:17.000000000 +0200 @@ -1914,6 +1914,9 @@ # access level required to run reports $g_time_tracking_reporting_threshold = MANAGER; + # access level required to select reporter when running reports + $g_time_tracking_reporting_select_reporter_threshold = MANAGER; + #allow time tracking to be recorded without a bugnote $g_time_tracking_without_note = ON; diff -r -u mantis.org/core/bugnote_api.php mantis/core/bugnote_api.php --- mantis.org/core/bugnote_api.php 2008-07-13 00:23:36.000000000 +0200 +++ mantis/core/bugnote_api.php 2009-07-02 13:49:23.000000000 +0200 @@ -525,10 +525,11 @@ # Returns an array of bugnote stats # $p_from - Starting date (yyyy-mm-dd) inclusive, if blank, then ignored. # $p_to - Ending date (yyyy-mm-dd) inclusive, if blank, then ignored. - 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_reporter_id, $p_cost ) { $c_project_id = db_prepare_int( $p_project_id ); $c_to = db_prepare_date( $p_to ); $c_from = db_prepare_date( $p_from ); + $c_reporter_id = db_prepare_int( $p_reporter_id ); $c_cost = db_prepare_double( $p_cost ); // MySQL @@ -549,17 +550,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 mantis.org/lang/strings_german_8859-1.txt mantis/lang/strings_german_8859-1.txt --- mantis.org/lang/strings_german_8859-1.txt 2007-10-19 09:07:18.000000000 +0200 +++ mantis/lang/strings_german_8859-1.txt 2009-07-02 12:18:21.000000000 +0200 @@ -1412,6 +1412,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_from_date = 'Von'; $s_to_date = 'Bis'; diff -r -u mantis.org/lang/strings_german_eintrag.txt mantis/lang/strings_german_eintrag.txt --- mantis.org/lang/strings_german_eintrag.txt 2007-10-19 09:07:18.000000000 +0200 +++ mantis/lang/strings_german_eintrag.txt 2009-07-02 12:19:04.000000000 +0200 @@ -1413,6 +1413,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_from_date = 'Von'; $s_to_date = 'Bis'; diff -r -u mantis.org/lang/strings_german.txt mantis/lang/strings_german.txt --- mantis.org/lang/strings_german.txt 2007-10-19 09:07:18.000000000 +0200 +++ mantis/lang/strings_german.txt 2009-07-02 12:19:47.000000000 +0200 @@ -1412,6 +1412,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_from_date = 'Von'; $s_to_date = 'Bis';
+
+
+ +
+ + + +
+ + - : - + name="bugnote_cost" value="" />