%# BEGIN LICENSE BLOCK %# %# Copyright (c) 1996-2002 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 => loc("Incident #[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> <& /RTIR/Incident/Elements/Tabs, Ticket => $Ticket, current_tab => 'RTIR/Display.html?id='.$Ticket->id, current_subtab => 'RTIR/Display.html?id='.$Ticket->id, Title => loc("Incident #[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> <& /Elements/ListActions, actions => \@Actions &> % if ($id != 'new' && $Ticket->QueueObj->Name ne "Incidents") { <&|/l&>This ticket isn't an Incident. % $m->abort(); %}
<& /Elements/TitleBoxStart, title => loc('Incident [_1]: [_2]', $Ticket->Id, $Ticket->Subject), title_class=> 'inverse' &> <& Elements/ShowBasics, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> <& /Elements/TitleBoxStart, title => loc('Incident Reports'), title_href => "$RT::WebPath/RTIR/Incident/ShowReports.html?id=".$Ticket->Id, title_class=> 'inverse', titleright => '', color=> "#336633" &> % if ($Ticket->CurrentUserHasRight('ModifyTicket')) {
| New | <%loc("Link")%> |
% } <& /RTIR/Elements/ShowChildren, Ticket => $Ticket, Type => 'Report', LimitDepth => 8, FullList => $RT::WebPath."/RTIR/Incident/ShowReports.html?id=".$Ticket->id &> <& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxStart, title => loc('Investigations'), title_href => "$RT::WebPath/RTIR/Incident/ShowInvestigations.html?id=".$Ticket->Id, title_class=> 'inverse', titleright => '', color=> "#336633" &> % if ($Ticket->CurrentUserHasRight('ModifyTicket')) {
| Launch | <%loc("Link")%> |
% } <& /RTIR/Elements/ShowChildren, Ticket => $Ticket, Type => 'Investigation', LimitDepth => 8, FullList => $RT::WebPath."/RTIR/Incident/ShowInvestigations.html?id=".$Ticket->id &> <& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxStart, title => loc('Blocks'), title_href => "$RT::WebPath/RTIR/Incident/ShowBlocks.html?id=".$Ticket->Id, title_class=> 'inverse', titleright => '', color=> "#336633" &> % if ($Ticket->CurrentUserHasRight('ModifyTicket')) {
| New | <%loc("Link")%> |
% } <& /RTIR/Elements/ShowChildren, Ticket => $Ticket, Type => 'Block', LimitDepth => 8, FullList => $RT::WebPath."/RTIR/Incident/ShowBlocks.html?id=".$Ticket->id &> <& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxStart, title => loc("Dates"), title_class=> 'inverse', color => "#663366" &> <& /RTIR/Incident/Elements/ShowDates, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &>
<& /Ticket/Elements/ShowAttachments, Ticket => $Ticket &> <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket, DisplayPath => "/RTIR/Display.html" &>
<& /RTIR/Elements/ShowHistory , Ticket => $Ticket, Collapsed => $ARGS{'Collapsed'}, ShowHeaders => $ARGS{'ShowHeaders'} &> <%INIT> my ($Ticket, $ChildObj, @Actions, @results); $Ticket = new RT::Ticket($session{'CurrentUser'}); if ($ARGS{'child'}) { $ChildObj = LoadTicket($ARGS{'child'}); } if ($SelectedTicket) { $id = $SelectedTicket; $ARGS{'Status'} = "open"; } unless ($id) { Abort('No incident specified'); } my $DoLinks = sub { my $Ticket = shift; my $Target = shift; my @linkresults; my $Type = $m->scomp("/RTIR/Elements/Type", Ticket => $Ticket->Id); $ARGS{$Ticket->Id.'-MemberOf'} = $Target->Id; # Blocks can have multiple incidents if ($Type ne 'Block') { while (my $link = $Ticket->MemberOf->Next) { my $member = $link->TargetObj; if ($member->QueueObj->Name eq "Incidents") { $RT::Logger->debug ("Deleting: ".$link->Target."\n"); $ARGS{'DeleteLink--'.$link->Type.'-'.$link->Target} = ''; } } } # If we don't own the thing we're linking to, change the owner if ($Ticket->OwnerObj->id != $session{'CurrentUser'}->id) { if ($Ticket->OwnerObj->id == $RT::Nobody->id) { $ARGS{'Action'} = 'Take'; } else { $ARGS{'Action'} = 'Steal'; } my $action = $ARGS{'Action'}; my ($res, $msg)=$Ticket->$action(); push (@results, $msg); } push @linkresults, ProcessTicketLinks(TicketObj => $Ticket, ARGSRef => \%ARGS); @linkresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @linkresults; push (@Actions, @results, @linkresults); }; if ($id eq 'new') { # {{{ Create a new ticket my $Queue = new RT::Queue($session{'CurrentUser'}); unless ($Queue->Load($ARGS{'Queue'})) { Abort('Queue not found'); } unless ($Queue->CurrentUserHasRight('CreateTicket')) { Abort('You have no permission to create tickets in that queue.'); } ($Ticket, @Actions) = CreateTicket(Attachments => $session{'Attachments'}, %ARGS); delete $session{'Attachments'}; unless ($Ticket->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view newly created ticket #".$Ticket->id."."); } # }}} if ($ChildObj) { $ARGS{'id'}=$Ticket->Id; &$DoLinks($ChildObj, $Ticket); } } else { $Ticket = LoadTicket($id); unless ($Ticket->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view ticket"); } if ($ChildObj) { $ARGS{'id'}=$Ticket->Id; &$DoLinks($ChildObj, $Ticket); } if (defined $ARGS{'Action'}) { if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { my $action = $1; my ($res, $msg)=$Ticket->$action(); push(@Actions, $msg); } } elsif ($ARGS{'BulkLink'}) { #Iterate through each ticket we've been handed my $IncidentObj = LoadTicket($id); while (my $t = $session{'tickets'}->Next) { next unless ($ARGS{"UpdateTicket".$t->Id}); &$DoLinks($t, $IncidentObj); } } $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; chomp ($ARGS{'UpdateContent'}) ; if ($ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne '' && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature ) { $ARGS{UpdateAttachments} = $session{'Attachments'}; ProcessUpdateMessage(ARGSRef=>\%ARGS, Actions=>\@Actions, TicketObj=>$Ticket); delete $session{'Attachments'}; } #Process basics updates my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket); push (@Actions, @BasicActions); } <%ARGS> $id => undef $Create => undef $ShowHeaders => undef $Collapsed => undef $SelectedTicket => undef $child => undef