[Rt-commit] r8505 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: . html/NoAuth

thayes at bestpractical.com thayes at bestpractical.com
Fri Aug 10 18:18:50 EDT 2007


Author: thayes
Date: Fri Aug 10 18:18:43 2007
New Revision: 8505

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/NoAuth/Logout.html
   rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Display.html

Log:
 r8711 at toth:  toth | 2007-08-10 18:15:12 -0400
 * Changed to make use of changes to the ticket locking methods
 


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/html/NoAuth/Logout.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/html/NoAuth/Logout.html	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/html/NoAuth/Logout.html	Fri Aug 10 18:18:43 2007
@@ -45,7 +45,8 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-% RT::Ticket::RemoveUserLocks($session{'CurrentUser'});
+% $session{'CurrentUser'}->RemoveLocks;
+
 <html>
 <head>
 <title>RT: Logout</title>

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	Fri Aug 10 18:18:43 2007
@@ -128,8 +128,8 @@
     if ( defined $ARGS{'Action'} ) {
         if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) {
             my $action = $1;
-			my ($res, $msg) = $TicketObj->$action();
-			push(@Actions, $msg);
+            my ($res, $msg) = $TicketObj->$action();
+            push(@Actions, $msg);
         }
     }
     
@@ -141,39 +141,30 @@
                 push @Actions, loc('Your attempt to lock this ticket failed');
             }
         } elsif ( $ARGS{'Lock'} eq 'remove' ) {
-            my $lock = $TicketObj->Locked();
-            unless($lock) {
-                push @Actions, loc('This ticket was not locked');
-			} elsif ( $lock->Content->{'User'} == $session{'CurrentUser'}->id ) {
-				$Duration = time() - $lock->Content->{'Timestamp'};
-				$TicketObj->Unlock('Hard');
-                push @Actions, loc('You have unlocked this ticket');
-			} else {
-				push @Actions,
-					loc("You can't unlock tickets that you did not lock");
-			}
-
-		} elsif ( $ARGS{'Lock'} eq 'break' ) {
-			$TicketObj->BreakLock();
-			push @Actions, loc('You have broken the lock on this ticket');
-		}
+            my $msg;
+            ($Duration, $msg) = $TicketObj->Unlock('Hard');
+            push @Actions, loc($msg);
+        } elsif ( $ARGS{'Lock'} eq 'break' ) {
+            $TicketObj->BreakLock();
+            push @Actions, loc('You have broken the lock on this ticket');
+        }
     }
 
     $ARGS{'UpdateContent'} =~ s/\r\n/\n/g if defined $ARGS{'UpdateContent'};
     if ( $ARGS{'UpdateTimeWorked'} || (
         defined $ARGS{'UpdateContent'}
         && $ARGS{'UpdateContent'} ne ''
-	    && $ARGS{'UpdateContent'} ne "-- \n"
-	       . $session{'CurrentUser'}->UserObj->Signature ) )
+        && $ARGS{'UpdateContent'} ne "-- \n"
+           . $session{'CurrentUser'}->UserObj->Signature ) )
     {
-	    $ARGS{UpdateAttachments} = $session{'Attachments'};
-	    push @Actions, ProcessUpdateMessage(
+        $ARGS{UpdateAttachments} = $session{'Attachments'};
+        push @Actions, ProcessUpdateMessage(
             ARGSRef   => \%ARGS,
-			Actions   => \@Actions,
-			TicketObj => $TicketObj,
+            Actions   => \@Actions,
+            TicketObj => $TicketObj,
         );
-	    delete $session{'Attachments'};
-	}
+        delete $session{'Attachments'};
+    }
     push @Actions, ProcessTicketWatchers(ARGSRef => \%ARGS, TicketObj => $TicketObj );
     push @Actions, ProcessTicketBasics(   ARGSRef => \%ARGS, TicketObj => $TicketObj );
     push @Actions, ProcessTicketLinks(    ARGSRef => \%ARGS, TicketObj => $TicketObj );
@@ -194,7 +185,7 @@
 
 $m->callback(
     CallbackName => 'BeforeDisplay',
-	TicketObj => \$TicketObj,
+    TicketObj => \$TicketObj,
     Tickets => \$Tickets,
     Actions => \@Actions,
     ARGSRef => \%ARGS,


More information about the Rt-commit mailing list