[Rt-commit] r18601 - in rt/3.8/trunk: .
sartak at bestpractical.com
sartak at bestpractical.com
Thu Feb 26 17:14:20 EST 2009
Author: sartak
Date: Thu Feb 26 17:14:20 2009
New Revision: 18601
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/share/html/Ticket/Elements/EditBasics
Log:
r80652 at onn: sartak | 2009-02-26 17:13:03 -0500
When defaulting to hours, convert minutes into hours
Modified: rt/3.8/trunk/share/html/Ticket/Elements/EditBasics
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Elements/EditBasics (original)
+++ rt/3.8/trunk/share/html/Ticket/Elements/EditBasics Thu Feb 26 17:14:20 2009
@@ -74,21 +74,21 @@
<td class="label"><&|/l&>Time Estimated</&>:</td>
<td class="value">
<input name="TimeEstimated"
- value="<% $TicketObj->TimeEstimated || '' |h%>" size="5" />
+ value="<% $TimeEstimated || '' |h%>" size="5" />
<& /Elements/SelectTimeUnits, Name =>'TimeEstimated' &>
</td>
</tr>
<tr>
<td class="label"><&|/l&>Time Worked</&>:</td>
<td class="value">
- <input name="TimeWorked" value="<% $TicketObj->TimeWorked || '' |h%>" size="5" />
+ <input name="TimeWorked" value="<% $TimeWorked || '' |h%>" size="5" />
<& /Elements/SelectTimeUnits, Name =>'TimeWorked' &>
</td>
</tr>
<tr>
<td class="label"><&|/l&>Time Left</&>:</td>
<td class="value">
- <input name="TimeLeft" value="<%$TicketObj->TimeLeft || ''|h%>" size="5" />
+ <input name="TimeLeft" value="<%$TimeLeft || ''|h%>" size="5" />
<& /Elements/SelectTimeUnits, Name =>'TimeLeft' &>
</td>
</tr>
@@ -118,6 +118,18 @@
my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",loc($TicketObj->Status)));
my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id);
+my $TimeEstimated = $TicketObj->TimeEstimated;
+my $TimeWorked = $TicketObj->TimeWorked;
+my $TimeLeft = $TicketObj->TimeLeft;
+
+# Convert these values from minutes to hours
+if (RT->Config->Get('DefaultTimeUnitsToHours')) {
+ for ($TimeEstimated, $TimeWorked, $TimeLeft) {
+ # Do some rounding since 0.166666666666667 is pretty unhelpful
+ $_ = sprintf '%.3g', $_ / 60;
+ }
+}
+
</%INIT>
<%ARGS>
More information about the Rt-commit
mailing list