I was having trouble following the control flow in Display.html,
due to mis-aligned braces and bad indentation.
(no functional changes)
html/SelfService/Display.html | 69 ++++++++++++++++++++±-------------------
1 files changed, 35 insertions(+), 34 deletions(-)
diff --git a/html/SelfService/Display.html b/html/SelfService/Display.html
index 0410e1b…e3b9054 100755
— a/html/SelfService/Display.html
+++ b/html/SelfService/Display.html
@@ -143,27 +143,28 @@ if ( $id[0] eq ‘new’ ) {
unless ( $Ticket->id ) {
$m->comp( ‘Error.html’, Why => join( “\n”, @results ));
$m->abort();
-
}
- }
-
# }}}
-
delete temporary storage entry to make WebUI clean
- unless ( keys %{ $session{‘Attachments’} } and $ARGS{‘UpdateAttach’} ) {
-
delete $session{'Attachments'};
- }
-
# delete temporary storage entry to make WebUI clean
-
unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) {
-
delete $session{'Attachments'};
-
}
-
}}}
+}
+else {
-
# }}}
-
{{{ Update an existing ticket
- unless ( $Ticket->Load( $id[0] ) ) {
-
$m->comp( 'Error.html',
-
Why => loc( "Couldn't load ticket '[_1]'", $id ) );
-
}$m->abort();
-
else {
-
unless ( $Ticket->Load( $id[0] ) ) {
-
$m->comp( 'Error.html',
-
Why => loc( "Couldn't load ticket '[_1]'", $id ) );
-
$m->abort();
-
}
my ( $code, $msg );
-
#Update the status
-
{{{ Update the status
if ( ( defined $ARGS{‘Status’} )
and $ARGS{‘Status’}
and ( $ARGS{‘Status’} ne $Ticket->Status ) )
@@ -200,31 +201,31 @@ if ( $id[0] eq ‘new’ ) {}}}
-
}
+} -
This code does automatic redirection if any updates happen.
+# This code does automatic redirection if any updates happen.
- unless ( $Ticket->CurrentUserHasRight(‘ShowTicket’) ) {
-
$m->comp( 'Error.html',
-
Why => loc("No permission to display that ticket") );
-
$m->abort();
- }
+unless ( $Ticket->CurrentUserHasRight(‘ShowTicket’) ) {
- $m->comp( ‘Error.html’,
-
Why => loc("No permission to display that ticket") );
- $m->abort();
+}
- if (@results) {
-
# We've done something, so we need to clear the decks to avoid
-
# resubmission on refresh.
-
# But we need to store Actions somewhere too, so we don't lose them.
-
$session{"Actions"} = \@results;
-
RT::Interface::Web::Redirect($RT::WebURL."SelfService/Display.html?id="
-
. $Ticket->id);
- } else {
-
@results = @{ delete $session{"Actions"} || [] };
- }
+if (@results) {
-
We’ve done something, so we need to clear the decks to avoid
-
resubmission on refresh.
-
But we need to store Actions somewhere too, so we don’t lose them.
- $session{“Actions”} = @results;
- RT::Interface::Web::Redirect($RT::WebURL.“SelfService/Display.html?id=”
-
. $Ticket->id);
+} else {
-
@results = @{ delete $session{“Actions”} || [] };
+}
-
my $Transactions = $Ticket->Transactions;
+my $Transactions = $Ticket->Transactions; -
my $attachments =
-
$m->comp( '/Ticket/Elements/FindAttachments', Ticket => $Ticket );
+my $attachments =
- $m->comp( ‘/Ticket/Elements/FindAttachments’, Ticket => $Ticket );
</%INIT>