%# 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 &> % if ($Split) { <& '/RTIR/'.$Type.'/Elements/Tabs', Ticket => $TicketObj, current_tab => "RTIR/Split.html?Ticket=".$TicketObj->Id, current_subtab => "RTIR/Split.html?Ticket=".$TicketObj->Id, Title => $Title &> % } elsif ($Incident) { <& "/RTIR/Incident/Elements/".$Type."Tabs", Ticket => $IncidentObj, current_toptab => "RTIR/".$Type."/Listing.html", current_tab => "RTIR/Create.html?Incident=".$Incident."&Queue=".$Queue, Title => $Title &> % } else { <& "/RTIR/".$Type."/Elements/Tabs", Ticket => $TicketObj, current_toptab => "RTIR/Incident/Listing.html", current_tab => "RTIR/Create.html?Queue=".$Queue, current_subtab => "RTIR/Create.html?Queue=".$Queue, Title => $Title &> % } % if ($Split && !$TicketObj->CurrentUserHasRight('ModifyTicket')) { <%loc("You are not allowed to split this [_1].", $name)%> % $m->abort(); % } <& /RTIR/Elements/Create, Type => $Type, Queue => $q->Id, Status => 'new', %ARGS &> <%INIT> my $q = RT::Queue->new($session{'CurrentUser'}); $q->Load($Queue); my ($Title, $IncidentObj); my $TicketObj = $ARGS{TicketObj}; if ($Incident) { $IncidentObj = new RT::Ticket($session{'CurrentUser'}); $IncidentObj = LoadTicket($Incident); } my $Type; if ($Queue eq "Incidents") { $Type = "Incident"; } elsif ($Queue eq "Incident Reports") { $Type = "Report"; } elsif ($Queue eq "Investigations") { $Type = "Investigation"; } elsif ($Queue eq "Blocks") { $Type = "Block"; } my $name; if ($Type eq 'Report') { $name = "Incident Report"; } else { $name = $Type; } if ($Type eq 'Incident') { $m->comp("/RTIR/Incident/Create.html", %ARGS); $m->abort; } if ($Split) { $Title = loc("Split [_1] #[_2]: [_3]", $name, $TicketObj->id, $TicketObj->Subject); } else { $Title = loc("Create a new [_1]", $name); } <%ARGS> $Queue => undef $Incident => undef $Split => 0