summaryrefslogtreecommitdiff
path: root/rt/html/SelfService/Display.html
diff options
context:
space:
mode:
authorivan <ivan>2004-03-11 02:05:38 +0000
committerivan <ivan>2004-03-11 02:05:38 +0000
commit289340780927b5bac2c7604d7317c3063c6dd8cc (patch)
treec4100ab9857ae00c330213af8a46e66c208580e6 /rt/html/SelfService/Display.html
parent945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd (diff)
import of rt 3.0.9RT_3_0_9
Diffstat (limited to 'rt/html/SelfService/Display.html')
-rw-r--r--rt/html/SelfService/Display.html43
1 files changed, 41 insertions, 2 deletions
diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html
index fc3fcb2..124ecf4 100644
--- a/rt/html/SelfService/Display.html
+++ b/rt/html/SelfService/Display.html
@@ -38,7 +38,7 @@
<& /Elements/TitleBoxStart, title => loc("Dates"),
title_class=> 'inverse',
color => "#663366" &>
- <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
+ <& /Ticket/Elements/ShowDates, Ticket => $Ticket, UpdatedLink => 0 &>
<& /Elements/TitleBoxEnd &>
</TD>
</TR>
@@ -46,7 +46,7 @@
-<& /Ticket/Elements/ShowHistory, Ticket => $Ticket&>
+<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment" &>
@@ -101,6 +101,12 @@ if ( $id[0] eq 'new' ) {
push ( @results, $ErrMsg );
# }}}
+
+# delete temporary storage entry to make WebUI clean
+unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
+ delete $session{'Attachments'};
+}
+# }}}
}
else {
unless ( $Ticket->Load( $id[0] ) ) {
@@ -127,10 +133,43 @@ if ( ( defined $ARGS{'Status'} )
push @results, "$msg";
}
+# {{{ store the uploaded attachment in session
+if ($ARGS{'Attach'}) { # attachment?
+ $session{'Attachments'} = {} unless defined $session{'Attachments'};
+
+ my $subject = "$ARGS{'Attach'}";
+ # 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 => 'Attach'
+ );
+
+ $session{'Attachments'} = { %{$session{'Attachments'} || {}},
+ $ARGS{'Attach'} => $attachment };
+}
+# }}}
+
+if ( $session{'Attachments'} ||
+ ( $ARGS{'UpdateContent'} ne ''
+ && $ARGS{'UpdateContent'} ne "-- \n"
+ . $session{'CurrentUser'}->UserObj->Signature )) {
+ $ARGS{UpdateAttachments} = $session{'Attachments'};
+}
ProcessUpdateMessage( ARGSRef => \%ARGS,
Actions => \@results,
TicketObj => $Ticket );
+# delete temporary storage entry to make WebUI clean
+unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
+ delete $session{'Attachments'};
+}
+# }}}
+
my $Transactions = $Ticket->Transactions;
</%INIT>