View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008849 | mantisbt | time tracking | public | 2008-02-01 07:52 | 2008-08-11 09:41 |
| Reporter | kynx | Assigned To | daryn | ||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Linux | OS | RHEL | OS Version | 5 |
| Product Version | 1.1.1 | ||||
| Fixed in Version | 1.2.0a2 | ||||
| Summary | 0008849: Emails ignore time tracking view threshold | ||||
| Description | The emailing script contains time tracking information, even if the user they are sent to is below the timetracking view threshold. I notice that the check for the threshold is being made in bugnote_get_all_visible_bugnotes(), but then ignored email_format_bug_message(). The attached patch (against 1.1.1) corrects that. | ||||
| Tags | No tags attached. | ||||
| Attached Files | email_timetracking.diff (904 bytes)
diff -ru mantis-1.1.1.orig/core/email_api.php mantis-1.1.1/core/email_api.php
--- mantis-1.1.1.orig/core/email_api.php 2008-01-19 07:43:47.000000000 +0000
+++ mantis-1.1.1/core/email_api.php 2008-02-01 12:45:56.000000000 +0000
@@ -1056,9 +1056,8 @@
$t_formatted_bugnote_id = bugnote_format_id( $t_bugnote->id );
$t_bugnote_link = string_process_bugnote_link ( config_get( 'bugnote_link_tag' ) . $t_bugnote->id, false, false, true );
- $t_time_tracking_minutes = bugnote_get_field ( $t_bugnote->id, 'time_tracking' );
- if ( $t_time_tracking_minutes > 0 ) {
- $t_time_tracking = ' ' . lang_get( 'time_tracking' ) . ' ' . db_minutes_to_hhmm( $t_time_tracking_minutes ) . "\n";
+ if ( $t_bugnote->time_tracking > 0 ) {
+ $t_time_tracking = ' ' . lang_get( 'time_tracking' ) . ' ' . db_minutes_to_hhmm( $t_bugnote->time_tracking ) . "\n";
} else {
$t_time_tracking = '';
}
| ||||
|
Looked over changes in patch. Looks good so applied to trunk. |
|
|
Hum, this patch does does not work here (mantis 1.1.1), and probably In case user hasn't enough rights to see time tracking info, $t_bugnote->time_tracking is set to 0 (bugnote_api.php, L283) However, if the user has enough rights, the problem is that $t_bugnote->time_tracking is already formatted as hh:mm I would suggest : if ( $t_bugnote->time_tracking !== 0 && $t_bugnote->time_tracking != '00:00') { It works, but it does not look very nice. In any case, I think bug should be reopened. |
|
|
reopening to check note 0008849:0017775. |
|
|
lolotrav can you check this with svn-revision 5303? I think another change slipped in between my original fix and your testing that broke the display and calculation of time tracking. I've removed the extra formatting and it seems to work correctly for me. This only applies to trunk. I did not patch the 1.1.x branch (I think victor did that earlier though). Thanks. |
|
|
This works correctly for me now. I'm looking for confirmation from others, specifically lolotrav, that this is fixed in trunk. |
|
|
I received your email. Unfortunately I can't test your patch, our Mantis 1.1.1 is now in production. |
|
|
I'm going to resolve this as my testing indicates that it is fixed. lolotrav to present we haven't really supported outside use of the apis other than through the soap interface. All internal calls to this function already format the string as needed so i'm not too worried that someone is expecting a formatted string. I'm not sure when or why the db_minutes_to_hhmm call was added to the bugnotes... function but returning the actual value and allowing the caller to format it is the correct way to do this under the current api. Providing an additional function in the nature of bugnote->time_tracking->to_string is being discussed as a future possibility. |
|
|
MantisBT: master e6c44ba1 2008-04-21 10:52 Details Diff |
Apply patch for bug 8849 - Emails ignore time tracking view threshold git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5185 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0008849 |
|
| mod - core/email_api.php | Diff File | ||