merging RT 4.0.6
[freeside.git] / rt / lib / RT / Ticket.pm
index 176222c..de8a396 100755 (executable)
@@ -2438,20 +2438,10 @@ sub _Links {
     my $links = $self->{ $cache_key }
               = RT::Links->new( $self->CurrentUser );
     unless ( $self->CurrentUserHasRight('ShowTicket') ) {
-        $links->Limit( FIELD => 'id', VALUE => 0 );
+        $links->Limit( FIELD => 'id', VALUE => 0, SUBCLAUSE => 'acl' );
         return $links;
     }
 
-    # without this you will also get RT::User(s) instead of tickets!
-    if ($field == 'Base' and $type == 'MemberOf') {
-        my $rtname = RT->Config->Get('rtname');
-        $links->Limit(
-                       FIELD    => 'Base',
-                       OPERATOR => 'STARTSWITH',
-                       VALUE    => "fsck.com-rt://$rtname/ticket/",
-                     );
-    }
-
     # Maybe this ticket is a merge ticket
     my $limit_on = 'Local'. $field;
     # at least to myself
@@ -3604,6 +3594,16 @@ sub CurrentUserHasRight {
 }
 
 
+=head2 CurrentUserCanSee
+
+Returns true if the current user can see the ticket, using ShowTicket
+
+=cut
+
+sub CurrentUserCanSee {
+    my $self = shift;
+    return $self->CurrentUserHasRight('ShowTicket');
+}
 
 =head2 HasRight
 
@@ -3716,7 +3716,9 @@ sub Transactions {
 
 sub TransactionCustomFields {
     my $self = shift;
-    return $self->QueueObj->TicketTransactionCustomFields;
+    my $cfs = $self->QueueObj->TicketTransactionCustomFields;
+    $cfs->SetContextObject( $self );
+    return $cfs;
 }