%# 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 &>
<&| /Widgets/TitleBox, title => loc("The Basics"), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$Ticket->Id, title_class => 'inverse' &> % if ($Type eq 'Report') { % } elsif ($Type eq "Block") { % } elsif ($Type eq "Investigation") { % }
<% loc("State") %>: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'State' &>
<% loc("Incident") %>: <& /RTIR/Elements/ShowIncidents, Ticket => $Ticket &>
<&|/l&>Constituency: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'Constituency' &>
<&|/l&>Time Worked: <%loc('[_1] min', $TimeWorked)%>
<&|/l&>SLA: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'SLA' &>
<&|/l&>Customer: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'Customer' &>
<%loc("How Reported")%>: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'HowReported' &>
<%loc("Reporter Type")%>: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'ReporterType' &>
<&|/l&>Netmask: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'Netmask' &>
<&|/l&>Port: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'Port' &>
<&|/l&>Where Blocked: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'WhereBlocked' &>
<&|/l&>Customer: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'Customer' &>
<&|/l&>IP Address: <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'IP' &>
<& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> % if ($RT::FM::VERSION) { <&| /Widgets/TitleBox, title => loc("Articles"), title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id, title_class=> 'inverse', color => "#663366" &> % if ($Ticket->CurrentUserHasRight('ModifyTicket')) { % my $qs = $m->comp("/Elements/QueryString", "RefersTo-new" => "t:$id", next => "/RTIR/Display.html?id=$id");
| <%loc('New')%> | <%loc("Link")%> |
% } % }
%#
<&| /Widgets/TitleBox, title => loc('People'), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id, title_class => 'inverse' &> <& /RTIR/Elements/ShowPeople, Ticket => $Ticket &>
%#

<&| /Widgets/TitleBox, title => loc("Dates"), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id, title_class => 'inverse', color => "#663366" &> <& /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", 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); } 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('_RTIR_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 ); 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('_RTIR_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 ( $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 ($Ticket->TimeLeft > 0 ) { $TimeWorked .= "/".$Ticket->TimeLeft; } my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); <%ARGS> $id => 0 $Queue => undef @results => undef @SelectedTickets => ()