X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2FTicket%2FElements%2FShowTransaction;h=9fe08cedee090b2ce6733d5adbc5aa77f1815c67;hp=f2f89d35c4fa5ca1f3fc065a802e681be66fdb17;hb=24548f7cf666bac02335d0bc74f81251c7b4ab50;hpb=945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction index f2f89d35c..9fe08cede 100644 --- a/rt/html/Ticket/Elements/ShowTransaction +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,88 +20,61 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) %# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. %# -%# END LICENSE BLOCK - -#  -   -<% $transdate|n %>  +%# END BPS TAGGED BLOCK }}} +
<% $RowNum % 2 ? ' odd' : ' even' %>"> +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS); + + + + + % my $desc = $Transaction->BriefDescription; % $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS); - - - - -<%PERL> - -unless ($Collapsed) { - $attachments->GotoFirstItem; - while (my $message=$attachments->Next) { - #we don't want to show any empty transactions, unless they have kids - next unless ($message->ContentLength || $message->Children->Count); - - my ($headers, $quoted); - if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) { - $headers = $message->Headers; - } else { - $headers = $message->NiceHeaders; - } - chomp $headers; - if ($headers) { - # localize the common headers (like 'Subject:'), too. - eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics - } - # 13456 is a random # of about the biggest size we want to see inline text - my $MAX_INLINE_BODY = 13456; - if ($message->ContentType =~ m{^(text/plain|message|text$)}i && - $message->ContentLength < $MAX_INLINE_BODY ) { - require Text::Quoted; - $quoted = Text::Quoted::extract($message->Content); - } - - - - - - - + + + + + + - -% } -% } - +% $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody); + + +
+ # + <% $LastTransaction ? ' ' : ' ' |n %> + <% $transdate|n %><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%> - -<%$TimeTaken%> <%$titlebar_commands|n%>
     - -
-<& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &>
-
-<& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &> -
-
- -% if ($message->Parent == 0 ) { -
+
+ <%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%> + <%$TimeTaken%><%$titlebar_commands|n%>
+% if ($Transaction->CustomFieldValues->Count) { + <& /Elements/ShowCustomFields, Object => $Transaction &> % } -<%PERL> -my $size = $message->ContentLength; - -if ($size) { - if ($size > 1024) { - $size = loc("[_1]k", int($size/102.4)/10); - } - else { - $size = loc("[_1]b", $size); - } - -<&|/l&>Download <% $message->Filename|| loc('(untitled)') %> <% $size %> -% } -
+
<%ARGS> $Ticket => undef @@ -104,66 +83,115 @@ $ShowHeaders => 0 $Collapsed => undef $ShowTitleBarCommands => 1 $RowNum => 1 +$DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id +$AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" +$EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html" +$Attachments => undef +$AttachmentContent => undef +$ShowBody => 1 +$LastTransaction => 0 <%INIT> - -my ($TimeTaken, $TicketString, $bgcolor); +my ( $TimeTaken, $TicketString, $type_class ); my $transdate = $Transaction->CreatedAsString(); $transdate =~ s/\s/ /g; -if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) { - if ($Transaction->IsInbound) { - $bgcolor="#336699"; - } - else { - $bgcolor="#339999"; - } -} elsif (($Transaction->Field =~ /^Owner$/) or - ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) { - $bgcolor="#333399"; - -} elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) { - $bgcolor="#336633"; -} elsif ($Transaction->Type =~ /^(Status|Set|Told)$/) { - if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) { - $bgcolor="#663366"; - } - else { - $bgcolor="#993333"; - } +if ( $Transaction->Type =~ /^(Create|Correspond|Comment$)/ ) { + if ( $Transaction->IsInbound ) { + $type_class = 'message'; + } + else { + $type_class = 'message'; + } +} +elsif ( ( $Transaction->Field =~ /^Owner$/ ) + or ( $Transaction->Type =~ /^(AddWatcher|DelWatcher)$/ ) ) { + $type_class = 'people'; + +} +elsif ( $Transaction->Type =~ /^(AddLink|DeleteLink)$/ ) { + $type_class = 'links'; +} +elsif ( $Transaction->Type =~ /^(Status|Set|Told)$/ ) { + if ( $Transaction->Field =~ /^(Told|Starts|Started|Due)$/ ) { + $type_class = 'dates'; + } + else { + $type_class = 'basics'; + } } else { - $bgcolor="#cccccc"; + $type_class = 'other'; +} + +if ( $Ticket->Id != $Transaction->Ticket ) { + $TicketString = "Ticket " . $Transaction->Ticket . ": "; } +$TicketString ||= ''; -if ($Ticket->Id != $Transaction->Ticket) { - $TicketString = "Ticket ".$Transaction->Ticket .": "; +if ( $Transaction->TimeTaken != 0 ) { + $TimeTaken = $Transaction->TimeTaken . " min"; +} else { + $TimeTaken = ''; } -if ($Transaction->TimeTaken > 0) { - $TimeTaken = $Transaction->TimeTaken." min" +unless ($Attachments) { + my $attachments = $Transaction->Attachments; + $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + $Attachments = $attachments->ItemsArrayRef(); +} +my $titlebar_commands = ' '; + +my @DisplayHeaders=qw ( _all); + +if ( $Transaction->Type =~ /EmailRecord$/ ) { + @DisplayHeaders = qw(To Cc Bcc); + + $titlebar_commands .= + "[Ticket + . "&Transaction=" + . $Transaction->Id + . "&Attachment=" + . ( $Attachments->[0] && $Attachments->[0]->id ) + . '">' . loc('Show') . "] "; + $ShowBody = 0; } -my $attachments = $Transaction->Attachments; -my $titlebar_commands=' '; # If the transaction has anything attached to it at all -if ($Transaction->Attachments->First && $ShowTitleBarCommands) { - if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) { - $titlebar_commands .= - "[Ticket . "&QuoteTransaction=".$Transaction->Id. - "&Action=Respond\">". loc('Reply') ."] "; - } - if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) { - $titlebar_commands .= - "[Ticket. - "&QuoteTransaction=".$Transaction->Id. - "&Action=Comment\">". loc('Comment') ."]"; - } -} +else { + unless ( $ShowHeaders ) { + @DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject); + } + + if ( $Attachments->[0] && $ShowTitleBarCommands ) { + if ( $Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket') + or $Transaction->TicketObj->CurrentUserHasRight('ModifyTicket')) { + $titlebar_commands .= + "[Ticket + . "&QuoteTransaction=" + . $Transaction->Id + . "&Action=Respond\">" + . loc('Reply') + . "] "; + } + if ( $Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket') + or $Transaction->TicketObj->CurrentUserHasRight('ModifyTicket')) { + $titlebar_commands .= + "[Ticket + . "&QuoteTransaction=" + . $Transaction->Id + . "&Action=Comment\">" + . loc('Comment') . "]"; + } + } +}