[Rt-commit] r8359 - in rtir/branches/2.3-EXPERIMENTAL: . html/RTIR

thayes at bestpractical.com thayes at bestpractical.com
Wed Aug 1 14:03:40 EDT 2007


Author: thayes
Date: Wed Aug  1 14:03:40 2007
New Revision: 8359

Modified:
   rtir/branches/2.3-EXPERIMENTAL/   (props changed)
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Edit.html
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Edit.html
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html

Log:
 r8529 at toth:  toth | 2007-08-01 14:03:28 -0400
 * Changed RTIR locking to accomodate new hard/auto locking system
 


Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html	Wed Aug  1 14:03:40 2007
@@ -261,7 +261,7 @@
     if ( $ARGS{'Lock'} ) {
 
         if ( $ARGS{'Lock'} eq 'add' ) {
-            if ( $Ticket->Lock() ) {
+            if ( $Ticket->Lock(1) ) {
                 push @results, loc('You now have a lock on this ticket');
             } else {
                 push @results, loc('Your attempt to lock this ticket failed');
@@ -273,7 +273,7 @@
                 push @results, loc('This ticket was not locked');
             } elsif ( $lock->Content->{'User'} == $session{'CurrentUser'}->id ) {
                 $Duration = time() - $lock->Content->{'Timestamp'};
-				$Ticket->Unlock();
+				$Ticket->Unlock(1);
                 push @results, loc('You have unlocked this ticket');
             } else {
                 push @results,

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Edit.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Edit.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Edit.html	Wed Aug  1 14:03:40 2007
@@ -285,7 +285,13 @@
         push (@results, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
     }
     if ( !$checks_failure && RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
-        return $m->comp("/RTIR/Display.html", results => [@results], id => $id, Lock => 'remove');
+    	my $Duration;
+    	if(my $lock = $Ticket->Locked()) {
+    		$Duration = time() - $lock->Content->{'Timestamp'};
+    		$Ticket->Unlock();
+    	}
+    		
+        return $m->comp("/RTIR/Display.html", results => [@results], id => $id, Duration => $Duration);
     }
 }
  

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html	Wed Aug  1 14:03:40 2007
@@ -330,7 +330,7 @@
     if ( $ARGS{'Lock'} ) {
 
         if ( $ARGS{'Lock'} eq 'add' ) {
-            if ( $TicketObj->Lock() ) {
+            if ( $TicketObj->Lock(1) ) {
                 push @results, loc('You now have a lock on this ticket');
             } else {
                 push @results, loc('Your attempt to lock this ticket failed');
@@ -342,7 +342,7 @@
                 push @results, loc('This ticket was not locked');
             } elsif ( $lock->Content->{'User'} == $session{'CurrentUser'}->id ) {
                 $Duration = time() - $lock->Content->{'Timestamp'};
-				$TicketObj->Unlock();
+				$TicketObj->Unlock(1);
                 push @results, loc('You have unlocked this ticket');
             } else {
                 push @results,

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Edit.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Edit.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Edit.html	Wed Aug  1 14:03:40 2007
@@ -196,7 +196,12 @@
         push (@results, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
     }
     if ( !$checks_failure && RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
-        return $m->comp("/RTIR/Incident/Display.html", results => [@results], id => $id, Lock => 'remove' );
+    	my $Duration;
+    	if(my $lock = $Ticket->Locked()) {
+    		$Duration = time() - $lock->Content->{'Timestamp'};
+    		$Ticket->Unlock();
+    	}
+        return $m->comp("/RTIR/Incident/Display.html", results => [@results], id => $id, Duration => $Duration );
     }
 }
 

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Reply.html	Wed Aug  1 14:03:40 2007
@@ -208,7 +208,13 @@
         push @results, loc("State of the Incident left unchanged; not all children were updated");
     }
 
-    return $m->comp("Display.html", results => \@results, id => $id, Lock => 'remove');
+	my $Duration;
+	if(my $lock = $Ticket->Locked()) {
+		$Duration = time() - $lock->Content->{'Timestamp'};
+		$Ticket->Unlock();
+	}
+
+    return $m->comp("Display.html", results => \@results, id => $id, Duration => $Duration);
 }
 
 # XXX, BLOODY-DIRTY-EVIL HACK: when we load the page first time we should


More information about the Rt-commit mailing list