[Rt-commit] r8484 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: .

thayes at bestpractical.com thayes at bestpractical.com
Thu Aug 9 16:46:32 EDT 2007


Author: thayes
Date: Thu Aug  9 16:46:31 2007
New Revision: 8484

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock

Log:
 r8690 at toth:  toth | 2007-08-09 16:43:26 -0400
 * Since $ago is a string and not a number, we can't use it in a comparison, so a new variable, $timePassed, was added as a numeric version of the same value for purposes of comparison (seems to be simpler than moving DurationAsString conversion to conditionals)
 


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Elements/ShowLock	Thu Aug  9 16:46:31 2007
@@ -31,7 +31,7 @@
     <&|/l, $TicketLabel, $ago &>You had [_1] locked for [_2]. It is now unlocked</&>.
 % #Do not display time if it is very little time, since such a short time probably 
 % #means the lock was just created.
-% } elsif($ago < 5) {    
+% } elsif($timePassed < 5) {    
         <&|/l, $TicketLabel &>You have locked [_1]</&>.
 %    if($Unlock && !$Id) {
         [<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->id%>&Lock=remove"><&|/l&>Unlock</&></a>]
@@ -60,16 +60,18 @@
 
 return unless (defined $Ticket && defined $Lock) || defined $Duration;
 
-my $ago;
+my $timePassed;
 my $date = RT::Date->new($session{'CurrentUser'});
 
 if(defined $Duration) {
-    $ago = $date->DurationAsString($Duration);
+    $timePassed = $Duration;
 }
 elsif($Lock) {
-    $ago = $date->DurationAsString(time() - $Lock->Content->{'Timestamp'});
+    $timePassed = time() - $Lock->Content->{'Timestamp'};
 }
 
+my $ago = $date->DurationAsString($timePassed);
+
 my $u = RT::User->new($session{'CurrentUser'});
 $u->Load($Lock->Content->{'User'}) if $Lock;
 


More information about the Rt-commit mailing list