X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FTicket%2FElements%2FLoadTextAttachments;h=129dfc7cc5f7168e5339670a51f3a1147dc71792;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=b36dd617842953982cf53220a4631474b4b528f3;hpb=45d35d5739d05e602bc317739485693e0e9ff0b5;p=freeside.git diff --git a/rt/share/html/Ticket/Elements/LoadTextAttachments b/rt/share/html/Ticket/Elements/LoadTextAttachments index b36dd6178..129dfc7cc 100644 --- a/rt/share/html/Ticket/Elements/LoadTextAttachments +++ b/rt/share/html/Ticket/Elements/LoadTextAttachments @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,48 +46,9 @@ %# %# END BPS TAGGED BLOCK }}} <%INIT> - -my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); - -$attachments->Columns( qw(id Content ContentType TransactionId ContentEncoding)); - -if ( $Ticket->CurrentUserHasRight('ShowTicket') ) { - my $transactions = $attachments->NewAlias('Transactions'); - $attachments->Join( ALIAS1 => 'main', - FIELD1 => 'TransactionId', - ALIAS2 => $transactions, - FIELD2 => 'id' ); - - my $tickets = $attachments->NewAlias('Tickets'); - - - $attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'ObjectId', - ALIAS2 => $tickets, - FIELD2 => 'id' ); - - $attachments->Limit( ALIAS => $transactions, - FIELD => 'ObjectType', - VALUE => 'RT::Ticket'); - - - $attachments->Limit( ALIAS => $tickets, - FIELD => 'EffectiveId', - VALUE => $Ticket->id() ); - # if the user may not see comments do not return them - unless ( $Ticket->CurrentUserHasRight('ShowTicketComments') ) { - $attachments->Limit( ALIAS => $transactions, FIELD => 'Type', OPERATOR => '!=', VALUE => "Comment" ); - } - - $attachments->Limit ( FIELD => 'ContentType', OPERATOR => '=', VALUE => 'text/plain'); - $attachments->Limit ( FIELD => 'ContentType', OPERATOR => 'STARTSWITH', VALUE => 'message/'); - $attachments->Limit ( FIELD => 'ContentType', OPERATOR => '=', VALUE => 'text'); - $attachments->Limit ( FIELD => 'Filename', OPERATOR => 'IS', VALUE => 'NULL') - if RT->Config->Get('SuppressInlineTextFiles', $Ticket->CurrentUser ); -} -return ($attachments); +RT->Deprecated( Remove => "4.4", Instead => "RT::Ticket->TextAttachments" ); +return $Ticket->TextAttachments; <%ARGS> -$Ticket => undef +$Ticket -