[Rt-commit] r2605 - in rt/branches/QUEBEC-EXPERIMENTAL: .
html/Ticket html/Ticket/Elements lib/RT/Interface lib/t/regression
jesse at bestpractical.com
jesse at bestpractical.com
Mon Apr 11 10:48:28 EDT 2005
Author: jesse
Date: Mon Apr 11 10:48:28 2005
New Revision: 2605
Modified:
rt/branches/QUEBEC-EXPERIMENTAL/ (props changed)
rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Elements/EditBasics
rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web.pm
rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t
Log:
r12532 at hualien: jesse | 2005-04-11 10:47:38 -0400
* When entering time worked/left/etc, you can select minutes or hours
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Elements/EditBasics
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Elements/EditBasics (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Elements/EditBasics Mon Apr 11 10:48:28 2005
@@ -59,15 +59,29 @@
</TR>
<TR>
<td class="label"><&|/l&>Time Estimated</&>:</td>
- <td class="value"><input name=TimeEstimated value="<%$TicketObj->TimeEstimated|h%>" SIZE="5"></td>
+ <td class="value"><input name=TimeEstimated value="<%$TicketObj->TimeEstimated|h%>" SIZE="5">
+<select name="TimeEstimatedUnits">
+ <option value="mins"><&|/l&>mins</&></option>
+ <option value="hrs"><&|/l&>hrs</&></option>
+</select></td>
</TR>
<TR>
<td class="label"><&|/l&>Time Worked</&>:</td>
- <td class="value"><input name=TimeWorked value="<%$TicketObj->TimeWorked|h%>" SIZE="5"></td>
+ <td class="value"><input name=TimeWorked value="<%$TicketObj->TimeWorked|h%>" SIZE="5">
+<select name="TimeWorkedUnits">
+ <option value="mins"><&|/l&>mins</&></option>
+ <option value="hrs"><&|/l&>hrs</&></option>
+</select></td>
+
</TR>
<TR>
<td class="label"><&|/l&>Time Left</&>:</td>
- <td class="value"><input name=TimeLeft value="<%$TicketObj->TimeLeft|h%>" SIZE="5"></td>
+ <td class="value"><input name=TimeLeft value="<%$TicketObj->TimeLeft|h%>" SIZE="5">
+<select name="TimeLeftUnits">
+ <option value="mins"><&|/l&>mins</&></option>
+ <option value="hrs"><&|/l&>hrs</&></option>
+</select></td>
+ </TR>
</TR>
<TR>
Modified: rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/html/Ticket/Update.html Mon Apr 11 10:48:28 2005
@@ -61,7 +61,13 @@
<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", loc($TicketObj->Status)), Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&>
<&|/l&>Owner</&>:
<& /Elements/SelectOwner, Name=>"Owner", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->OwnerObj->Name()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj, Default => $ARGS{'Owner'} &>
-<&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&></td></tr>
+<&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<%
+$ARGS{UpdateTimeWorked}%>">
+<select name="TimeWorkedUnits">
+ <option value="mins"><&|/l&>mins</&></option>
+ <option value="hrs"><&|/l&>hrs</&></option>
+</select>
+</td></tr>
% my $skip;
<& /Elements/Callback, _CallbackName => 'BeforeUpdateType', skip => \$skip, %ARGS &>
% if (!$skip) {
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Interface/Web.pm Mon Apr 11 10:48:28 2005
@@ -1032,6 +1032,10 @@
Queue
);
+ for my $arg (qw(TimeLeft TimeEstimated TimeWorked)) {
+ $ARGSRef->{$arg} *= 60 if $ARGSRef->{$arg."Units"} eq "hrs";
+ }
+
if ( $ARGSRef->{'Queue'} and ( $ARGSRef->{'Queue'} !~ /^(\d+)$/ ) ) {
my $tempqueue = RT::Queue->new($RT::SystemUser);
$tempqueue->Load( $ARGSRef->{'Queue'} );
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/t/regression/02basic_web.t Mon Apr 11 10:48:28 2005
@@ -64,7 +64,13 @@
like( $agent->{'content'}, qr{$string} , "Found the content");
+# Update time worked in hours
+$agent->follow_link( text_regex => qr/Basics/ );
+$agent->submit_form( form_number => 3,
+ fields => { TimeWorked => 5, TimeWorkedUnits => "hrs" }
+);
+like ($agent->{'content'}, qr/to '300'/, "5 hours is 300 minutes");
# }}}
More information about the Rt-commit
mailing list