summaryrefslogtreecommitdiff
path: root/rt/html/SelfService
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/SelfService')
-rw-r--r--rt/html/SelfService/Display.html43
-rw-r--r--rt/html/SelfService/Elements/MyRequests1
-rw-r--r--rt/html/SelfService/Update.html19
3 files changed, 60 insertions, 3 deletions
diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html
index fc3fcb289..124ecf407 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>
diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests
index 95ede0811..839359aed 100644
--- a/rt/html/SelfService/Elements/MyRequests
+++ b/rt/html/SelfService/Elements/MyRequests
@@ -49,6 +49,7 @@ $title ||= loc("My [_1] tickets", $friendly_status);
my $MyTickets;
$MyTickets = new RT::Tickets ($session{'CurrentUser'});
$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress);
+$MyTickets->OrderBy(FIELD => 'id', ORDER => 'ASC');
foreach my $status (@status) {
diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html
index 9ff31775f..9444aa706 100644
--- a/rt/html/SelfService/Update.html
+++ b/rt/html/SelfService/Update.html
@@ -29,7 +29,24 @@
<&|/l&>Status</&>: <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &><br>
<&|/l&>Subject</&>: <input name="UpdateSubject" size=60 value="Re: <% $Ticket->Subject %>"> <br>
-<&|/l&>Attach</&>: <input name="UpdateAttachment" type=file><br>
+<table>
+<tr>
+% if (exists $session{'Attachments'}) {
+<TD>
+<&|/l&>Attached file</&>:
+</TD>
+<TD COLSPAN=5>
+<&|/l&>Check box to delete</&><BR>
+% foreach my $attach_name (keys %{$session{'Attachments'}}) {
+<input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR>
+% } # end of foreach
+</TD>
+</TR>
+<TR>
+% } # end of if
+<tr><td align=right><&|/l&>Attach</&>:</td><td><input name="Attach" type="file"><input type="hidden" name="UpdateAttach" value="1">
+</td></tr>
+</table>
<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>