[Rt-commit] r8381 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: lib/RT

thayes at bestpractical.com thayes at bestpractical.com
Thu Aug 2 10:39:54 EDT 2007


Author: thayes
Date: Thu Aug  2 10:39:52 2007
New Revision: 8381

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket.pm

Log:
 r8561 at toth:  toth | 2007-08-02 10:39:08 -0400
 * Changed locking methods to use string parameters, rather than booleans
 


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket.pm	Thu Aug  2 10:39:52 2007
@@ -236,7 +236,7 @@
 
 sub Lock {
     my $ticket = shift;
-    my $hard = shift;
+    my $type = shift;
 
     if ( $ticket->Locked() ) {
         return undef;
@@ -246,7 +246,7 @@
             Content => {
                 User      => $ticket->CurrentUser->id,
                 Timestamp => time(),
-                Hard => $hard
+                Type => $type
             }
         );
     }
@@ -255,12 +255,13 @@
 
 sub Unlock {
     my $ticket = shift;
-    my $hard = shift;
+    my $type = shift;
 
     my $lock = $ticket->RT::Ticket::Locked();
     return undef unless $lock;
     return undef unless $lock->Content->{User} ==  $ticket->CurrentUser->id;
-    return undef if $lock->Content->{'Hard'} && !$hard;
+    return undef if $lock->Content->{'Type'} eq 'Hard' && !($type eq 'Hard');
+    return undef if $lock->Content->{'Type'} eq 'IR' && !($type eq 'IR');
     $ticket->DeleteAttribute('RT_Lock');
 }
 


More information about the Rt-commit mailing list