View Issue Details

IDProjectCategoryView StatusLast Update
0008357mantisbttime trackingpublic2008-08-11 09:41
ReporterSergiodf Assigned Todaryn  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.0a4 
Fixed in Version1.2.0a2 
Summary0008357: "Total time for issue" is shown even for users under threshold
Description

For a bug with time tracking data, in bug details page, at botom of "Notes" box a message is shown: "Total time for issue = ##:##" (this is OK).

But I have configured config_inc.php as follows:

--8<--------------------------------------

$g_time_tracking_view_threshold = DEVELOPER;
# --8<--------------------------------------

But if you set an user as "updater", the message is even shown for him.

Steps To Reproduce
  1. Enable time tracking with following parameters in config_inc.php:

    --8<--------------------------------------

    $g_time_tracking_enabled = ON;
    $g_time_tracking_with_billing = ON;

    Instead of a text field turning this option on places a stopwatch on the page with “Start/Stop” and “Reset” buttons next to it. You must have $g_use_javascript switched on for this to take effect. A bit gimickie, but who cares.

    $g_time_tracking_stopwatch = OFF;

    Access level required to view time tracking information - Default DEVELOPER.

    $g_time_tracking_view_threshold = DEVELOPER;

    Access level required to add/edit time tracking information - Default DEVELOPER.

    $g_time_tracking_edit_threshold = DEVELOPER;

    Access level required to run reports (not completed yet) - Default MANAGER.

    $g_time_tracking_reporting_threshold = MANAGER;

    --8<--------------------------------------

  2. Set up an user with a role under $g_time_tracking_view_threshold, for example: reporter.
  3. Login as that user and go to a bug with time tracking information filled.
  4. Scroll until end of "Notes" box, the message "Total time for issue: ##:##" appears for this user, who have a role under threshold.
TagsNo tags attached.
Attached Files
total_time_threshold.diff (471 bytes)   
--- bugnote_view_inc.php.orig	2008-02-01 11:54:46.000000000 +0000
+++ bugnote_view_inc.php	2008-01-30 10:21:28.000000000 +0000
@@ -210,7 +210,7 @@
 <?php
 		} # end for loop
 
-		if ( $t_total_time > 0 ) {
+		if ( $t_total_time > 0 && access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $f_bug_id ) ) {
 			echo '<tr><td colspan="2">', sprintf ( lang_get( 'total_time_for_issue' ), db_minutes_to_hhmm( $t_total_time ) ), '</td></tr>';
 		}
 	} # end else
total_time_threshold.diff (471 bytes)   

Relationships

parent of 0009183 closedvboctor Port 0008357: "Total time for issue" is shown even for users under threshold 

Activities

gw_accnt

gw_accnt

2007-09-19 14:36

reporter   ~0015664

I think the bug is in bugnote_view_inc.php, ca. 20 lines from the end:

It is now


if ( $t_total_time > 0 ) {
echo ..., sprintf ( lang_get( 'total_time_for_issue' ), db_minutes_to_hhmm( $t_total_time ) ), ...;
}

But schould be


if ( ( $t_total_time > 0 )
&& ( access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $f_bug_id ) ) )
{
...
}

Can anybody verify this?

kynx

kynx

2008-02-01 06:57

reporter   ~0016906

Yup, that looks right to me. Patch to fix (against 1.1.1) attached.

GregorK

GregorK

2008-02-03 05:04

reporter   ~0016926

Patch works great for me.

daryn

daryn

2008-04-21 11:03

reporter   ~0017640

Checked over patch. Looks good. Applied to trunk.

Related Changesets

MantisBT: master 50704ec7

2008-04-21 11:01

daryn


Details Diff
Apply patch for bug 0008357 - "Total time for issue" is shown even for users under threshold

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5186 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0008357
mod - bugnote_view_inc.php Diff File