2014-12-22 21:58 EST

View Issue Details Jump to Notes ] Wiki ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0008357mantisbttime trackingpublic2008-08-11 09:41
ReporterSergiodf 
Assigned Todaryn 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
Product Version1.1.0a4 
Target VersionFixed in Version1.2.0a2 
Summary0008357: "Total time for issue" is shown even for users under threshold
DescriptionFor 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 Reproduce1. 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
  • diff file icon total_time_threshold.diff (471 bytes) 2008-02-01 06:56 - 
    --- 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
    
    diff file icon total_time_threshold.diff (471 bytes) 2008-02-01 06:56 + 

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

-  Notes
User avatar

~0015664

gw_accnt (reporter)

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?
User avatar

~0016906

kynx (reporter)

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

~0016926

GregorK (reporter)

Patch works great for me.
User avatar

~0017640

daryn (reporter)

Checked over patch. Looks good. Applied to trunk.
+  Notes

+ Related Changesets

- Issue History
Date Modified Username Field Change
2007-09-13 12:19 Sergiodf New Issue
2007-09-19 14:36 gw_accnt Note Added: 0015664
2008-02-01 06:56 kynx File Added: total_time_threshold.diff
2008-02-01 06:57 kynx Note Added: 0016906
2008-02-03 05:04 GregorK Note Added: 0016926
2008-04-21 09:56 daryn Status new => assigned
2008-04-21 09:56 daryn Assigned To => daryn
2008-04-21 11:03 daryn Status assigned => resolved
2008-04-21 11:03 daryn Fixed in Version => 1.2.0a2
2008-04-21 11:03 daryn Resolution open => fixed
2008-04-21 11:03 daryn Note Added: 0017640
2008-05-21 02:36 vboctor Issue cloned: 0009183
2008-05-21 02:36 vboctor Relationship added parent of 0009183
2008-08-11 09:41 giallu Status resolved => closed
2008-10-20 16:50 Changeset attached master a779d80d =>
2008-11-11 08:33 daryn Changeset attached master 50704ec7 =>
2008-11-11 08:46 daryn Changeset attached master 50704ec7 =>
+ Issue History