%# BEGIN LICENSE BLOCK %# %# Copyright (c) 1996-2003 Jesse Vincent %# %# (Except where explictly superceded by other copyright notices) %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have %# been provided with this software, but in any event can be snarfed %# from www.gnu.org %# %# This work is distributed in the hope that it will be useful, but %# WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# %# %# Unless otherwise specified, all modifications, corrections or %# extensions to this work which alter its source code become the %# property of Best Practical Solutions, LLC when submitted for %# inclusion in the work. %# %# %# END LICENSE BLOCK <& /RTIR/Elements/Header, Title => $Title &> <& "/RTIR/".$Type."/Elements/Tabs", Ticket => $Ticket, current_tab => 'RTIR/Display.html?id='.$Ticket->id, current_subtab => 'RTIR/Display.html?id='.$Ticket->id, Title => $Title &> % $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket); <& /Elements/ListActions, actions => \@results &>
% $m->callback( %ARGS, Ticket => $Ticket, CallbackName => 'LeftColumnStart' ); <&| /Widgets/TitleBox, title => loc("The Basics"), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$Ticket->Id, class => 'ticket-info-basics', &>
<% loc("Incident") %>: <& /RTIR/Elements/ShowIncidents, Ticket => $Ticket &>
<&|/l&>Time Worked: <%loc('[_1] min', $TimeWorked)%>
<& /Elements/ShowCustomFields, Object => $Ticket &> % if ($RT::FM::VERSION) { <&| /Widgets/TitleBox, title => loc("Articles"), title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id, class=> 'ticket-info-articles', &> % if ($Ticket->CurrentUserHasRight('ModifyTicket')) { % my $qs = $m->comp("/Elements/QueryString", "RefersTo-new" => "t:$id", next => RT->Config->Get('WebPath')."/RTIR/Display.html?id=$id");
| <%loc('New')%> | <%loc("Link")%> |
% } % }
% $m->callback( %ARGS, Ticket => $Ticket, CallbackName => 'RightColumnStart' ); <&| /Widgets/TitleBox, title => loc('People'), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id, class => 'ticket-info-people', &> <& /RTIR/Elements/ShowPeople, Ticket => $Ticket &> <&| /Widgets/TitleBox, title => loc("Dates"), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id, class => 'ticket-info-dates', &> <& /RTIR/Elements/ShowDates, Ticket => $Ticket &>
<& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $attachments &> <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket, DisplayPath => '/RTIR/Display.html' &>
<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, Collapsed => $ARGS{'Collapsed'}, ShowHeaders => $ARGS{'ShowHeaders'}, DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id", UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html", ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html", EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/GnuPG.html", WarnUnsigned => 1, &> <%INIT> my ($name); my $Ticket = new RT::Ticket( $session{'CurrentUser'} ); my $QueueObj; unless ( $id eq 'new' ) { $Ticket = LoadTicket( $id ); unless ($Ticket->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view ticket"); } $QueueObj = $Ticket->QueueObj; } else { $QueueObj = new RT::Queue( $session{'CurrentUser'} ); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); } my $Type = RT::IR::TicketType( Queue => $QueueObj ); return $m->comp( '/Ticket/Display.html', %ARGS ) unless $Type; if ($Type eq 'Block' && RT->Config->Get('RTIR_DisableBlocksQueue') ) { Abort(loc("Blocks queue is disabled via config file")); } if ( $m->comp_exists("/RTIR/$Type/Display.html") ) { return $m->comp("/RTIR/$Type/Display.html", %ARGS); } my @results; if ( $id eq 'new' ) { unless ($QueueObj->CurrentUserHasRight('CreateTicket')) { Abort('You have no permission to create tickets in that queue.'); } ($Ticket, @results) = CreateTicket( %ARGS, Attachments => delete $session{'Attachments'} ); } elsif( $id ) { my $oldstate = $Ticket->FirstCustomFieldValue('State') ||''; $m->callback( CallbackName => 'ProcessArguments', Ticket => $Ticket, ARGSRef => \%ARGS, Actions => \@results ); if ( $ARGS{'Action'} && $ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/ ) { my $action = $1; my ($status, $msg) = $Ticket->$action(); push @results, $msg; # If they succeeded in taking the ticket, they should also get a lock if ($status && $action =~ /^(?:Take|Steal)$/) { $m->callback(CallbackName => 'TicketTakeOrSteal', %ARGS, Ticket => $Ticket, Type => $Type, Results => \@results); } } if ( $ARGS{'TakeOrStealFirst'} and $Ticket->Owner != $Ticket->CurrentUser->Id) { my ($status, $msg) = $Ticket->SetOwner($Ticket->CurrentUser->Id, 'Force'); push @results, $msg if $msg; # If they succeeded in taking the ticket, they should also get a lock ## Should they? This should only happen when a ticket is rejected, do we want to lock it? if ($status) { $m->callback(CallbackName => 'TicketTakeOrSteal', %ARGS, Ticket => $Ticket, Type => $Type, Results => \@results); } } $ARGS{UpdateAttachments} = delete $session{'Attachments'}; push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS ); if ( $Type eq 'Block' && ($ARGS{'Status'}||'') eq 'open' && $Ticket->Status eq 'open' ) { my ($id, $msg) = $Ticket->AddCustomFieldValue( Field => 'State', Value => 'active', ); $RT::Logger->error("Couldn't set state: $msg"); } push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS ); my $strict_acl = RT->Config->Set( StrictLinkACL => 0 ); push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS ); RT->Config->Set( StrictLinkACL => $strict_acl ); push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS ); my $newstate = $Ticket->FirstCustomFieldValue('State') || ''; if ($newstate ne $oldstate) { push (@results, loc("State changed from [_1] to [_2]", $oldstate, $newstate)); } } if ( $ARGS{'BulkArticles'} && @SelectedTickets ) { my $ref = join " ", map "a:$_", @SelectedTickets; push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => {$Ticket->Id."-RefersTo" => $ref} ); } unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { if( $id eq 'new' ) { Abort("No permission to view newly created ticket #".$Ticket->id."."); } Abort("No permission to view ticket"); } # update id argument in the case we took merged or created new $ARGS{'id'} = $id = $Ticket->Id; 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. my $key = Digest::MD5::md5_hex( rand(1024) ); push @{ $session{"Actions"}{ $key } ||= [] }, @results; $session{'i'}++; RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."RTIR/Display.html?id=". $id ."&results=" . $key ); } if ( $Type eq 'Report' ) { $name = "Incident Report"; } else { $name = $Type; } my $Title = loc("[_1] #[_2]: [_3]", $name, $Ticket->Id, $Ticket->Subject); my $TimeWorked = $Ticket->TimeWorked; if (defined $Ticket->TimeLeft && $Ticket->TimeLeft > 0 ) { $TimeWorked .= "/".$Ticket->TimeLeft; } my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); <%ARGS> $id => 0 $Queue => undef @SelectedTickets => ()