2014-12-18 18:01 EST

View Issue Details Jump to Notes ] Wiki ]
IDProjectCategoryView StatusLast Update
0008860mantisbttime trackingpublic2014-10-12 18:35
Reporterkynx 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
Product Version1.3.0-beta.1 
Target VersionFixed in Version 
Summary0008860: User entered time is overwritten
DescriptionIf you enter a time (say '0:15:00') for a note then click the 'Start' button, the time you enter is overwritten with whatever value the stopwatch already has.

This is annoying when you've already put time into the bug but have only just gone to the bug page.

The attached patch adds an onblur handler to the time input that updates the stopwatch with the user-entered value. It also adds some (very basic) validation to the time entered. Tested in FF2.0.0.11 and IE6.
Tagspatch
Attached Files
  • diff file icon time_tracking_edit.diff (1,473 bytes) 2008-02-06 05:56 - 
    Index: javascript/time_tracking_stopwatch.js
    ===================================================================
    --- javascript/time_tracking_stopwatch.js	(revision 4960)
    +++ javascript/time_tracking_stopwatch.js	(working copy)
    @@ -42,5 +42,21 @@
     	}
     }
     
    +function time_tracking_swonblur(input) {
    +	var time = input.value.split(/:/);
    +	var mult = [3600, 60, 1];
    +	var new_ms = 0;
    +	for (i=0; i<time.length && i<3; i++)
    +	{
    +		if (isNaN(parseInt(time[i])))
    +		{
    +			alert('Please enter a valid time');
    +			return false;
    +		}
    +		new_ms += parseInt(time[i]) * mult[i] * 1000;
    +	}	
    +	time_tracking_ms = new_ms;
    +}
    +
     setTimeout("time_tracking_display();", 1000);
     
    Index: bugnote_add_inc.php
    ===================================================================
    --- bugnote_add_inc.php	(revision 4960)
    +++ bugnote_add_inc.php	(working copy)
    @@ -77,7 +77,7 @@
     	<td>
     		<?php if ( config_get('time_tracking_stopwatch') && ON == config_get( 'use_javascript' )) { ?>
     		<script type="text/javascript" language="JavaScript" src="javascript/time_tracking_stopwatch.js"></script>
    -		<input type="text" name="time_tracking" size="5" value="00:00" />
    +		<input type="text" name="time_tracking" onblur="time_tracking_swonblur(this)" size="5" value="00:00" />
     		<input type="button" name="time_tracking_ssbutton" value="Start" onclick="time_tracking_swstartstop()" />
     		<input type="button" name="time_tracking_reset" value="R" onclick="time_tracking_swreset()" />
     		<?php } else { ?>
    
    diff file icon time_tracking_edit.diff (1,473 bytes) 2008-02-06 05:56 + 

- Relationships
+ Relationships

-  Notes
User avatar

~0030691

AbsolutelyFreeWeb (reporter)

LOL, assigned since 2008 and NO UPDATE?
User avatar

~0039270

atrol (developer)

Unassigned after having been assigned for a long time without progress.
+  Notes

- Issue History
Date Modified Username Field Change
2008-02-06 05:56 kynx New Issue
2008-02-06 05:56 kynx File Added: time_tracking_edit.diff
2008-04-21 09:56 daryn Status new => assigned
2008-04-21 09:56 daryn Assigned To => daryn
2011-12-24 05:12 AbsolutelyFreeWeb Note Added: 0030691
2014-02-01 06:14 atrol Tag Attached: patch
2014-02-01 06:14 atrol Note Added: 0039270
2014-02-01 06:14 atrol Assigned To daryn =>
2014-02-01 06:14 atrol Status assigned => acknowledged
2014-10-12 18:35 grangeway Product Version git trunk => 1.3.0-beta.1
+ Issue History