[Rt-commit] r8334 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: .
thayes at bestpractical.com
thayes at bestpractical.com
Tue Jul 31 17:39:43 EDT 2007
Author: thayes
Date: Tue Jul 31 17:39:42 2007
New Revision: 8334
Modified:
rt/branches/3.7-EXPERIMENTAL-TUNIS/ (props changed)
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html
rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html
Log:
r8499 at toth: toth | 2007-07-31 17:39:28 -0400
* Fixed up locking
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html Tue Jul 31 17:39:42 2007
@@ -52,7 +52,7 @@
current_tab => 'Ticket/Display.html?id='.$TicketObj->id,
Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &>
-% $Duration ||= $ARGS{'Duration'};
+% $Duration ||= $ARGS{'Duration'} unless defined $Duration;
<& /Elements/ShowLock, Ticket => $TicketObj, Duration => $Duration &>
<& /Elements/ListActions, actions => \@Actions &>
@@ -92,6 +92,7 @@
my (@Actions, $Tickets);
my $Duration;
+my $time;
unless ($id || $TicketObj) {
Abort('No ticket specified');
@@ -155,8 +156,9 @@
unless($lock) {
push @Actions, loc('This ticket was not locked');
} elsif ( $lock->Content->{'User'} == $session{'CurrentUser'}->id ) {
- $Duration = time() - $lock->Content->{'Timestamp'};
- $Duration = time() - $lock->Content->{'Timestamp'};
+ $time = time();
+ print "Time is $time.<br />Timestamp of lock: " . $lock->Content->{'Timestamp'};
+ $Duration = $time - $lock->Content->{'Timestamp'};
$TicketObj->Unlock();
push @Actions, loc('You have unlocked this ticket');
} else {
Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html (original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Update.html Tue Jul 31 17:39:42 2007
@@ -150,7 +150,7 @@
my $TicketObj = LoadTicket($id);
-$TicketObj->Lock() unless $TicketObj->Locked();
+$TicketObj->Lock();
unless($DefaultStatus){
$DefaultStatus=($ARGS{'Status'} ||$TicketObj->Status());
@@ -234,8 +234,9 @@
# }}}
if ( exists $ARGS{SubmitTicket} ) {
- $ARGS{'Lock'} = 'remove';
- $m->comp('Display.html', TicketObj => $TicketObj, %ARGS);
+ my $lock = $TicketObj->Locked();
+ my $Duration = time() - $lock->Content->{'Timestamp'} if $lock;
+ $m->comp('Display.html', TicketObj => $TicketObj, Duration => $Duration, %ARGS);
return;
}
More information about the Rt-commit
mailing list