diff options
Diffstat (limited to 'rt/share/html/Ticket/Display.html')
-rwxr-xr-x | rt/share/html/Ticket/Display.html | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/rt/share/html/Ticket/Display.html b/rt/share/html/Ticket/Display.html index 21be7953a..59adbd68d 100755 --- a/rt/share/html/Ticket/Display.html +++ b/rt/share/html/Ticket/Display.html @@ -46,12 +46,12 @@ %# %# END BPS TAGGED BLOCK }}} <& /Elements/Header, - Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject), + Title => loc("Ticket #[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject), LinkRel => \%link_rel &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_tab => 'Ticket/Display.html?id='.$TicketObj->id, - Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> + Title => loc("Ticket #[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> % $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@Actions, ARGSRef => \%ARGS, Ticket => $TicketObj); @@ -104,6 +104,14 @@ unless ($id || $TicketObj) { if ($ARGS{'id'} eq 'new') { # {{{ Create a new ticket + # Massage customer IDs into member links. + my @cust_uris = map { + /^(\d+)$/ && "freeside://freeside/cust_main/$1" + } split(' ', $ARGS{'new-Customer'}); + + $ARGS{'new-MemberOf'} = + join(' ', $ARGS{'new-MemberOf'}, @cust_uris); + my $Queue = new RT::Queue( $session{'CurrentUser'} ); $Queue->Load($ARGS{'Queue'}); unless ( $Queue->id ) { @@ -155,10 +163,13 @@ if ($ARGS{'id'} eq 'new') { push @Actions, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketLinks( ARGSRef => \%ARGS, TicketObj => $TicketObj ); push @Actions, ProcessTicketDates( ARGSRef => \%ARGS, TicketObj => $TicketObj ); - push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $TicketObj ); + push @Actions, ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $TicketObj ); + # If this fails due to required fields being empty, it will set + # notes('RedirectToBasics'). + push @Actions, ProcessTicketStatus( ARGSRef => \%ARGS, TicketObj => $TicketObj ); - # XXX: we shouldn't block actions here if user has no right to see the ticket, - # but we should allow him to see actions he has done + # XXX: we shouldn't block actions here if user has no right to see the + # ticket, but we should allow him to see actions he has done unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view ticket"); } @@ -189,7 +200,14 @@ if (@Actions) { my $key = Digest::MD5::md5_hex( rand(1024) ); push @{ $session{"Actions"}->{$key} ||= [] }, @Actions; $session{'i'}++; - my $url = RT->Config->Get('WebURL') . "Ticket/Display.html?id=" . $TicketObj->id . "&results=" . $key; + my $url = RT->Config->Get('WebURL'); + if ( $m->notes('RedirectToBasics') ) { + $url .= 'Ticket/Modify.html'; + } + else { + $url .= 'Ticket/Display.html'; + } + $url .= '?id=' . $TicketObj->id . "&results=" . $key; $url .= '#' . $ARGS{Anchor} if $ARGS{Anchor}; RT::Interface::Web::Redirect($url); } |