%# 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/Incident/Elements/Tabs, current_toptab => "RTIR/Listing.html", current_tab => $current_tab, current_subtab => $current_subtab, Title => $Title, Ticket => $TicketObj &> <& /RTIR/Elements/ListActions, actions => \@results &> % if ($link && % !$link->CurrentUserHasRight('ModifyTicket')) { <&|/l&>You are not allowed to edit this Incident. % $m->abort(); % }
> > <& /Elements/TitleBoxStart, contentbg => "#cccccc", title => $Title &> % if ($link) { % my $Type = $m->scomp("/RTIR/Elements/Type", Ticket => $link->Id); % $Type =~ s/\s*$//; % } % if ($ChildObj) { OwnerObj->id%>> % } else { % } <& Elements/Create, Title => $Title, TicketObj => $TicketObj, QueueObj => $QueueObj, %ARGS &>
<%$label%>: <% loc("[_1] #[_2]: [_3]", $Type, $link->Id, $link->Subject) %>
<&|/l&>Owner: <%$ChildObj->OwnerObj->Name%> <&|/l&>Owner: <& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||$session{'CurrentUser'}->Id||undef &>
<&|/l&>Message: % if (!exists $ARGS{Content}) { % my $Transactions; % if ($TicketObj) { % $Transactions = $TicketObj->Transactions; % } elsif ($ChildObj) { % $Transactions = $ChildObj->Transactions; % } % if ($Transactions) { % $ARGS{Content} = $m->scomp("/RTIR/Elements/TransactionData", % Transactions => $Transactions, % Type => 'messages', % Include => {'Create', 'Correspond'}); % $ARGS{Content} =~ s/\>/>/g; % } % } <& /Elements/MessageBox, Default => $ARGS{Content} &>
<& /Elements/TitleBoxStart, title => loc('The Basics'), title_class=> 'inverse', color => "#993333" &>
<&|/l&>Priority:
<&|/l&>Final Priority:
<&|/l&>Time Worked: >
<&|/l&>Time Left: >
<& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxStart, title => loc("Dates"), title_class=> 'inverse', color => "#663366" &> % if ($ARGS{Starts}) { % } else { % }
<&|/l&>Starts:
<&|/l&>Due: >
<& /Elements/TitleBoxEnd &>
<& /Elements/TitleBoxEnd &> <& /Elements/Submit, Label => loc("Create")&> <%INIT> # if there isn't a subject, but there is a child, use that one my $ChildObj; if ((!$ARGS{'Subject'}) and $child) { $ChildObj = LoadTicket($child); $ARGS{'Subject'} = $ChildObj->Subject; } my ($link, $label); if ($ARGS{'new-MemberOf'}) { $link = LoadTicket($ARGS{'new-MemberOf'}); $label = loc("Split from"); } elsif ($ARGS{'MemberOf-new'}) { $link = LoadTicket($ARGS{'MemberOf-new'}); $label = loc("Link with"); } elsif ($child) { $link = LoadTicket($child); $label = loc("Link with"); } my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load("Incidents") || Abort(loc("Queue could not be loaded.")); my $CFs = $QueueObj->CustomFields(); my $TicketObj = $ARGS{TicketObj}; # {{{ deal with deleting uploaded attachments foreach my $key (keys %ARGS) { if ($key =~ m/^DeleteAttach-(.+)$/) { delete $session{'Attachments'}{$1}; } $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; } # {{{ store the uploaded attachment in session if ($ARGS{'Attach'}) { # attachment? $session{'Attachments'} = {} unless defined $session{'Attachments'}; # strip leading directories $ARGS{'Attach'} =~ s#^.*[\\/]##; my $attachment = MakeMIMEEntity( Subject => "$ARGS{'Attach'}", Body => "", AttachmentFieldName => 'Attach' ); $session{'Attachments'} = { %{$session{'Attachments'} || {}}, $ARGS{'Attach'} => $attachment }; } # }}} # delete temporary storage entry to make WebUI clean unless (keys %{$session{'Attachments'}} and $ARGS{'id'} eq 'new') { delete $session{'Attachments'}; } # }}} my @results; if ((!exists $ARGS{'AddMoreAttach'}) && ($ARGS{'id'} eq 'new')) { # new ticket? if ($ARGS{'Function'} and $ARGS{$ARGS{'Function'}}) { $m->comp('Display.html', %ARGS); $m->abort(); } else { push @results, "Incident creation failed: Function must be set."; } } <%ARGS> $QuoteTransaction => undef $Title => loc("Create a new Incident") $current_tab => "RTIR/Create.html?Queue=Incidents" $current_subtab => "RTIR/Create.html?Queue=Incidents" $child => undef