diff options
author | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
commit | c582e92888b4a5553e1b4e5214cf35217e4a0cf0 (patch) | |
tree | 3fe7cd7bf22bd356b478f0de0dd8f0b140fcee23 /rt/html/Ticket | |
parent | 289340780927b5bac2c7604d7317c3063c6dd8cc (diff) |
import rt 3.0.12
Diffstat (limited to 'rt/html/Ticket')
-rw-r--r-- | rt/html/Ticket/Create.html | 12 | ||||
-rw-r--r-- | rt/html/Ticket/Display.html | 36 | ||||
-rwxr-xr-x | rt/html/Ticket/Elements/FindAttachments | 46 | ||||
-rwxr-xr-x | rt/html/Ticket/Elements/LoadTextAttachments | 39 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowAttachments | 22 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowDates | 2 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowHistory | 66 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowRequestor | 5 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowSummary | 3 | ||||
-rw-r--r-- | rt/html/Ticket/Elements/ShowTransaction | 67 | ||||
-rw-r--r-- | rt/html/Ticket/History.html | 13 | ||||
-rw-r--r-- | rt/html/Ticket/ModifyAll.html | 28 | ||||
-rw-r--r-- | rt/html/Ticket/ModifyDates.html | 2 | ||||
-rw-r--r-- | rt/html/Ticket/ModifyLinks.html | 2 | ||||
-rw-r--r-- | rt/html/Ticket/Update.html | 2 |
15 files changed, 261 insertions, 84 deletions
diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html index 435447a8f..9b5783cee 100644 --- a/rt/html/Ticket/Create.html +++ b/rt/html/Ticket/Create.html @@ -117,7 +117,7 @@ <TD COLSPAN=6> <&|/l&>Describe the issue below</&>:<br> % if (exists $ARGS{Content}) { -<& /Elements/MessageBox, Default => $ARGS{Content} &> +<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &> % } else { <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> %} @@ -152,8 +152,8 @@ <TABLE BORDER=0> <TR><TD ALIGN=RIGHT><&|/l&>Priority</&>:</TD><TD><input size=3 name="InitialPriority" value="<% $ARGS{InitialPriority} ? $ARGS{InitialPriority} : $QueueObj->InitialPriority %>"></TD></TR> <TR><TD ALIGN=RIGHT><&|/l&>Final Priority</&>:</TD><TD><input size=3 name="FinalPriority" value="<% $ARGS{FinalPriority} ? $ARGS{FinalPriority} : $QueueObj->FinalPriority %>"></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><input size=3 name="TimeWorked" value="<% $ARGS{TimeWorked} %>"></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><input size=3 name="TimeLeft" value="<% $ARGS{TimeLeft} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><&|/l,'<input size=3 name="TimeWorked" value="'.$ARGS{TimeWorked}.'">'&>[_1] min</&></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><&|/l,'<input size=3 name="TimeLeft" value="'.$ARGS{TimeLeft}.'">'&>[_1] min</&></TD></TR> </TABLE> <& /Elements/TitleBoxEnd &> <br> @@ -175,7 +175,7 @@ $ARGS{Due}%>"></TD></TR> title_class=> 'inverse', titleright => '', color=> "#336633" &> -<i><&|/l&>(Enter ticket ids or URLs, seperated with spaces)</&></i> +<i><&|/l&>(Enter ticket ids or URLs, separated with spaces)</&></i> <TABLE BORDER=0> <TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn" value="<% $ARGS{'new-DependsOn'} %>"></TD></TR> <TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new" value="<% $ARGS{'DependsOn-new'} %>"></TD></TR> @@ -208,7 +208,9 @@ my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); my $CFs = $QueueObj->CustomFields(); -if ($QueueObj->DefaultDueIn) { +# if no due date has been set explicitly, then use the +# queue's default if it exists +if ($QueueObj->DefaultDueIn && !$ARGS{'Due'}) { my $default_due = RT::Date->new($session{'CurrentUser'}); $default_due->SetToNow(); $default_due->AddDays($QueueObj->DefaultDueIn); diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html index 276cee62a..4a8983e6e 100644 --- a/rt/html/Ticket/Display.html +++ b/rt/html/Ticket/Display.html @@ -30,14 +30,18 @@ <& /Elements/ListActions, actions => \@Actions &> -<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj &> +<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj, Attachments => $attachments &> <BR> <& /Ticket/Elements/ShowHistory , Ticket => $TicketObj, Collapsed => $ARGS{'Collapsed'}, - ShowHeaders => $ARGS{'ShowHeaders'} &> + ShowHeaders => $ARGS{'ShowHeaders'}, + Attachments => $attachments, + AttachmentContent => $attachment_content + + &> <%ARGS> @@ -92,18 +96,17 @@ if ($ARGS{'id'} eq 'new') { } } - if ( $ARGS{'UpdateContent'} || $session{'Attachments'}) { - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; - if ( $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature )) { - $ARGS{UpdateAttachments} = $session{'Attachments'}; - ProcessUpdateMessage( ARGSRef => \%ARGS, - Actions => \@Actions, - TicketObj => $TicketObj ); - delete $session{'Attachments'}; - } + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + if ( $ARGS{'UpdateTimeWorked'} || + $session{'Attachments'} || + ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature )) { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@Actions, + TicketObj => $TicketObj ); + delete $session{'Attachments'}; } #Process status updates my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$TicketObj); @@ -111,6 +114,11 @@ if ($ARGS{'id'} eq 'new') { push (@Actions, @BasicActions, @results); } + +my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj); +my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj); + + </%INIT> diff --git a/rt/html/Ticket/Elements/FindAttachments b/rt/html/Ticket/Elements/FindAttachments new file mode 100755 index 000000000..b8a0dd8b6 --- /dev/null +++ b/rt/html/Ticket/Elements/FindAttachments @@ -0,0 +1,46 @@ +<%INIT> +my %documents; + +#A default implementation here loops through all transactions and pulls out all their attachments. +# We end up doing an end-run around that to get a bit more performance + +# We force the cache of ticket transactions to get populated up front. otherwise, the +# code that looks at attachments will look at each one in turn. +my $transactions = $Ticket->Transactions->First; + + +my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); + +$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId Created)); + +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 => 'Ticket', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $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" ); + } +} +return ($attachments); +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/LoadTextAttachments b/rt/html/Ticket/Elements/LoadTextAttachments new file mode 100755 index 000000000..084502e4c --- /dev/null +++ b/rt/html/Ticket/Elements/LoadTextAttachments @@ -0,0 +1,39 @@ +<%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 => 'Ticket', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $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'); + +} +return ($attachments); +</%INIT> +<%ARGS> +$Ticket => undef +</%ARGS> + diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments index 590a011fb..bdda1692c 100644 --- a/rt/html/Ticket/Elements/ShowAttachments +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -47,7 +47,10 @@ if ($size) { </%PERL> <li><font <%$fontsize%>> - <A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionObj->Id%>/<%$rev->Id%>/<%$rev->Filename | u%>"><%$rev->CreatedAsString%> (<% $size %>)</a></font></li> +<A HREF="<%$RT::WebPath%>/Ticket/Attachment/<%$rev->TransactionId%>/<%$rev->Id%>/<%$rev->Filename | u%>"> +<&|/l, $rev->CreatedAsString, $size, $rev->CreatorObj->Name &>[_1] ([_2]) by [_3]</&> +</a> +</font></li> % } % $fontsize='size="-2"'; % } @@ -60,20 +63,15 @@ if ($size) { <%INIT> my %documents; -my $transactions = $Ticket->Transactions(); -while (my $trans = $transactions->Next()) { - my $attachments = $trans->Attachments(); - $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); - $attachments->Limit(FIELD => 'Filename', OPERATOR => 'IS NOT', VALUE => 'NULL', QUOTEVALUE => 0, ENTRYAGGREGATOR => 'AND'); - $attachments->Limit(FIELD => 'Filename', OPERATOR => '!=', VALUE => '', ENTRYAGGREGATOR => 'AND'); - while (my $attach = $attachments->Next()) { - next unless ($attach->Filename()); - # most recent at the top - unshift (@{$documents{$attach->Filename}}, $attach); - } + +while ( my $attach = $Attachments->Next() ) { + next unless ($attach->Filename()); + unshift( @{ $documents{ $attach->Filename } }, $attach ); } + </%INIT> <%ARGS> $Ticket => undef +$Attachments => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates index b09b4bf7b..70c95efc0 100644 --- a/rt/html/Ticket/Elements/ShowDates +++ b/rt/html/Ticket/Elements/ShowDates @@ -36,7 +36,7 @@ <TD class="value"><% $Ticket->StartedObj->AsString %></TD> </TR> <TR> - <TD class="label"><a href="Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</TD> + <TD class="label"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->id%>&Action=SetTold"><&|/l&>Last Contact</&></a>:</TD> <TD class="value"><% $Ticket->ToldObj->AsString %></TD> </TR> <TR> diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory index 194be9b37..c4fe41747 100644 --- a/rt/html/Ticket/Elements/ShowHistory +++ b/rt/html/Ticket/Elements/ShowHistory @@ -54,16 +54,50 @@ else { % } <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0> -% while (my $Transaction = $Transactions->Next) { -% my $skip = 0; -% $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS); -% next if $skip; -% $i++; -% if ($Transactions->IsLast) { - <a name="lasttrans"></a> -% } - <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands, %ARGS &> -% } +<%perl> +my @attachments = @{$Attachments->ItemsArrayRef()}; +my @attachment_content = @{$AttachmentContent->ItemsArrayRef()}; + + + + + +while ( my $Transaction = $Transactions->Next ) { + my $skip = 0; + $m->comp( '/Elements/Callback', + _CallbackName => 'SkipTransaction', + Transaction => $Transaction, + skip => \$skip, + %ARGS ); + next if $skip; + $i++; + + $m->out('<a name="lasttrans"></a>') if ( $Transactions->IsLast ); + + my @trans_attachments = grep { $_->TransactionId == $Transaction->Id } @attachments; + + my $trans_content = {}; + grep { ($_->TransactionId == $Transaction->Id ) && ($trans_content->{$_->Id} = $_) } @attachment_content; + + + #Args is first because we're clobbering the "Attachments" parameter + $m->comp( 'ShowTransaction', + %ARGS, + + AttachPath => $AttachPath, + UpdatePath => $UpdatePath, + Ticket => $Ticket, + Transaction => $Transaction, + ShowHeaders => $ShowHeaders, + Collapsed => $Collapsed, + RowNum => $i, + ShowTitleBarCommands => $ShowTitleBarCommands, + Attachments => \@trans_attachments, + AttachmentContent => $trans_content + ); +} + +</%perl> </TABLE> % if ($ShowDisplayModes or $ShowTitle) { <& /Elements/TitleBoxEnd &> @@ -74,13 +108,23 @@ my $Transactions = $Ticket->Transactions; my $i; +$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); +$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket); + + + </%INIT> <%ARGS> -$URIFile => 'Display.html' +$URIFile => $RT::WebPath."/Ticket/Display.html" $Ticket => undef +$Attachments => undef +$AttachmentContent => undef $ShowHeaders => undef $Collapsed => undef $ShowTitle => 1 $ShowDisplayModes => 1 $ShowTitleBarCommands => 1 +$AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" + </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor index cc91f590f..a6398efc7 100644 --- a/rt/html/Ticket/Elements/ShowRequestor +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -23,9 +23,8 @@ %# END LICENSE BLOCK <%PERL> my $rows = 10; -my $people = $Ticket->Requestors->MembersObj; -while (my $member=$people->Next) { -my $requestor = $member->MemberObj->Object; +my $people = $Ticket->Requestors->UserMembersObj; +while (my $requestor=$people->Next) { my $name=$requestor->RealName || $requestor->EmailAddress; my $tickets = RT::Tickets->new($session{'CurrentUser'}); $tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $requestor->EmailAddress ); diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary index 6ae875832..5bcc94b41 100644 --- a/rt/html/Ticket/Elements/ShowSummary +++ b/rt/html/Ticket/Elements/ShowSummary @@ -65,7 +65,7 @@ <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> <BR> - <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket &> + <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &> <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> @@ -75,6 +75,7 @@ </TABLE> <%ARGS> $Ticket => undef +$Attachments => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction index 2d710fcbc..8cde03870 100644 --- a/rt/html/Ticket/Elements/ShowTransaction +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -36,8 +36,7 @@ <%PERL> unless ($Collapsed) { - $attachments->GotoFirstItem; - while (my $message=$attachments->Next) { + foreach my $message (@$Attachments) { my ($headers, $quoted); if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) { @@ -50,20 +49,31 @@ unless ($Collapsed) { # 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 - # It's here to catch anyone who hasn't updated RT_Config.pm since this - # constant was moved out there. + + my $MAX_INLINE_BODY = $RT::MaxInlineBody || 13456; - if ($message->ContentType =~ m{^(text/plain|message|text$)}i && - $message->ContentLength < $MAX_INLINE_BODY ) { - eval { - require Text::Quoted; - $quoted = Text::Quoted::extract($message->Content); - }; + if ( $message->ContentType =~ m{^(text/plain|message|text$)}i + && $message->ContentLength < $MAX_INLINE_BODY ) { + + my $content; + # If we've preloaded all the content, let's pull from there + # if we haven't, load it now + if ($AttachmentContent->{$message->id}) { + $content = $AttachmentContent->{$message->id}->Content; + } else { + $content = $message->Content; + } + + + + eval { + require Text::Quoted; + $quoted = Text::Quoted::extract( $content ); + }; if ($@) { - $quoted = $message->Content; + $quoted = $content; } - } + } </%PERL> <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" > @@ -74,7 +84,7 @@ unless ($Collapsed) { <PRE> <& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &> </PRE> -% if (!length($quoted) && $message->ContentType =~ m#^text/#) { +% if ($message->ContentLength && !length($quoted) && $message->ContentType =~ m#^text/#) { <blockquote><i><&|/l&>Message body not shown because it is too large or is not plain text.</&><br> <&|/l&>You can access it with the Download button on the right.</&></i></blockquote> % } else { @@ -115,6 +125,9 @@ $Collapsed => undef $ShowTitleBarCommands => 1 $RowNum => 1 $AttachPath => $RT::WebPath."/Ticket/Attachment" +$UpdatePath => $RT::WebPath."/Ticket/Update.html" +$Attachments => undef +$AttachmentContent => undef </%ARGS> <%INIT> @@ -126,12 +139,7 @@ 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"; @@ -154,25 +162,30 @@ if ($Ticket->Id != $Transaction->Ticket) { $TicketString = "Ticket ".$Transaction->Ticket .": "; } -if ($Transaction->TimeTaken > 0) { +if ($Transaction->TimeTaken != 0) { $TimeTaken = $Transaction->TimeTaken." min" } -my $attachments = $Transaction->Attachments; -$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + +unless ($Attachments) { + my $attachments = $Transaction->Attachments; + $attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId) ); + $Attachments = $attachments->ItemsArrayRef(); +} + my $titlebar_commands=' '; # If the transaction has anything attached to it at all -if ($Transaction->Attachments->First && $ShowTitleBarCommands) { - if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) { +if ($Attachments->[0] && $ShowTitleBarCommands) { + if ($Ticket->CurrentUserHasRight('ReplyToTicket')) { $titlebar_commands .= - "[<a href=\"Update.html?id=". + "[<a href=\"".$UpdatePath."?id=". $Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id. "&Action=Respond\">". loc('Reply') ."</a>] "; } - if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) { + if ($Ticket->CurrentUserHasRight('CommentOnTicket')) { $titlebar_commands .= - "[<a href=\"Update.html?id=".$Transaction->Ticket. + "[<a href=\"".$UpdatePath."?id=".$Transaction->Ticket. "&QuoteTransaction=".$Transaction->Id. "&Action=Comment\">". loc('Comment') ."</a>]"; } diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html index cb02f1c75..95a21deec 100644 --- a/rt/html/Ticket/History.html +++ b/rt/html/Ticket/History.html @@ -28,7 +28,13 @@ <BR> -<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &> +<& /Ticket/Elements/ShowHistory , + Ticket => $Ticket, + ShowHeaders => $ARGS{'ShowHeaders'}, + URIFile => 'History.html', + Attachments => $attachments, + AttachmentContent => $attachment_content + &> <%ARGS> @@ -45,6 +51,11 @@ unless ($Ticket->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view ticket"); } +my $attachments = $m->comp('Elements/FindAttachments', Ticket => $Ticket); +my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => +$Ticket); + + </%INIT> diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html index 1163f3fa5..1d0500d16 100644 --- a/rt/html/Ticket/ModifyAll.html +++ b/rt/html/Ticket/ModifyAll.html @@ -76,7 +76,7 @@ </tr> <tr> <td class="label"><&|/l&>Subject</&>:</td> - <td class="entry"><input name="UpdateSubject" size=60 value=""></td> + <td class="entry"><input name="UpdateSubject" size=60 value="<%$Ticket->Subject%>"></td> </tr> <tr> <td class="label"><&|/l&>Attach</&>:</td> @@ -119,13 +119,29 @@ unless ($OnlySearchForPeople) { @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; - - if ($ARGS{'UpdateContent'} && - $ARGS{'UpdateContent'} ne '' && + if ($ARGS{'UpdateAttachment'}) { + my $subject = "$ARGS{'UpdateAttachment'}"; + # since CGI.pm deutf8izes the magic field, we need to add it back. + Encode::_utf8_on($subject); + # strip leading directories + $subject =~ s#^.*[\\/]##; + + my $attachment = MakeMIMEEntity( + Subject => $subject, + Body => "", + AttachmentFieldName => 'UpdateAttachment' + ); + delete $ARGS{'UpdateAttachment'}; + $ARGS{'UpdateAttachments'}->{ $subject } = $attachment; + } + + $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g; + + if ($ARGS{'UpdateAttachments'} || ( + $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature - ) { + )) { ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results); diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html index 3ccae4431..5339e4283 100644 --- a/rt/html/Ticket/ModifyDates.html +++ b/rt/html/Ticket/ModifyDates.html @@ -35,7 +35,7 @@ <& Elements/EditDates, TicketObj => $TicketObj &> <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, color => "#663366" &> +<& /Elements/Submit, Label => loc('Save Changes'), color => "#663366" &> </form> diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html index 1d050088b..d7e39f3d2 100644 --- a/rt/html/Ticket/ModifyLinks.html +++ b/rt/html/Ticket/ModifyLinks.html @@ -35,7 +35,7 @@ <& /Elements/TitleBoxStart, title => loc('Edit Relationships'), color => "#336633"&> <& Elements/EditLinks, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, color => "#336633", Caption=> loc('Save Changes') &> +<& /Elements/Submit, color => "#336633", Label => loc('Save Changes') &> </form> diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html index ad3b21787..1df8084e5 100644 --- a/rt/html/Ticket/Update.html +++ b/rt/html/Ticket/Update.html @@ -112,7 +112,7 @@ value=<% $ARGS{UpdateCc} %>><BR> -<& /Elements/Submit, Name => 'SubmitTicket' &> +<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &> </FORM> |