missing pieces from #14837
authormark <mark>
Thu, 26 Jan 2012 03:08:40 +0000 (03:08 +0000)
committermark <mark>
Thu, 26 Jan 2012 03:08:40 +0000 (03:08 +0000)
rt/lib/RT/Ticket_Vendor.pm
rt/lib/RT/Transaction_Vendor.pm

index 9fa24a2..a55bb7b 100644 (file)
@@ -13,6 +13,37 @@ sub SetPriority {
   $Ticket->SUPER::SetPriority($value);
 }
 
+=head2 Touch
+
+Creates a Touch transaction (a null transaction).  Like Comment and 
+Correspond but without any content.
+
+=cut
+
+sub Touch {
+    my $self = shift;
+    my %args = (
+        TimeTaken => 0,
+        ActivateScrips => 1,
+        CommitScrips => 1,
+        CustomFields => {},
+        @_
+    );
+    unless ( $self->CurrentUserHasRight('ModifyTicket')
+              or $self->CurrentUserHasRight('CommentOnTicket')
+              or $self->CurrentUserHasRight('ReplyToTicket')) {
+        return ( 0, $self->loc("Permission Denied"));
+    }
+    $self->_NewTransaction(
+        Type => 'Touch',
+        TimeTaken => $args{'TimeTaken'},
+        ActivateScrips => $args{'ActivateScrips'},
+        CommitScrips => $args{'CommitScrips'},
+        CustomFields => $args{'CustomFields'},
+    );
+}
+
+
 =head2 MissingRequiredFields {
 
 Return all custom fields with the Required flag set for which this object
index caeb3f7..99198c2 100644 (file)
@@ -31,5 +31,7 @@ $_BriefDescriptions{'Set'} = sub {
     }
 };
 
+$_BriefDescriptions{'Touch'} = sub { 'Updated' };
+
 1;