1 %# {{{ BEGIN BPS TAGGED BLOCK
5 %# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
6 %# <jesse@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 %# CONTRIBUTION SUBMISSION POLICY:
30 %# (The following paragraph is not intended to limit the rights granted
31 %# to you to modify and distribute this software under the terms of
32 %# the GNU General Public License and is only of importance to you if
33 %# you choose to contribute your changes and enhancements to the
34 %# community by submitting them to Best Practical Solutions, LLC.)
36 %# By intentionally submitting any modifications, corrections or
37 %# derivatives to this work, or any other work intended for use with
38 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
39 %# you are the copyright holder for those contributions and you grant
40 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
41 %# royalty-free, perpetual, license to use, copy, create derivative
42 %# works based on those contributions, and sublicense and distribute
43 %# those contributions and any derivatives thereof.
45 %# }}} END BPS TAGGED BLOCK
46 <& /Elements/Header, Title => loc("Create a new ticket") &>
48 current_toptab => "Ticket/Create.html",
49 Title => loc("Create a new ticket") &>
50 <FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data">
51 <INPUT TYPE=HIDDEN Name="id" VALUE="new">
55 [<a class="currenttab"><&|/l&>Show basics</&></a>] [<A HREF="#detail"><&|/l&>Show details</&></a>]
57 <& /Elements/TitleBoxStart, contentbg => "#cccccc", title => loc("Create a new ticket") &>
58 <TABLE border=0 cellpadding=0 cellspacing=0>
59 <TR><TD class=label><&|/l&>Queue</&>:</TD>
60 <TD class=value><% $QueueObj->Name %>
61 <INPUT TYPE=HIDDEN NAME=Queue Value="<%$QueueObj->Name%>">
63 <TD class=label><&|/l&>Status</&>:
66 <& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new', DefaultValue => 0 &>
72 <& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||$RT::Nobody->Id, DefaultValue => 0 &>
77 <&|/l&>Requestors</&>:
79 <TD class=value COLSPAN=5>
80 <INPUT Name="Requestors" Value="<% ($ARGS{Requestors}) || $session{CurrentUser}->EmailAddress %>" SIZE=40>
87 <TD class=value COLSPAN=5>
88 <INPUT NAME="Cc" SIZE=40 VALUE="<% $ARGS{Cc} %>"><BR>
90 <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <b>will</b> receive future updates.)</&></font></i>
97 <TD class=value COLSPAN=5>
98 <INPUT NAME="AdminCc" SIZE=40 VALUE="<% $ARGS{AdminCc} %>"><BR>
100 <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <b>will</b> receive future updates.)</&></font></i>
107 <TD class=value COLSPAN=5>
108 <INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="<%$ARGS{Subject} || ''%>">
113 <& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &>
117 % if (exists $session{'Attachments'}) {
119 <&|/l&>Attached file</&>:
122 <&|/l&>Check box to delete</&><BR>
123 % foreach my $attach_name (keys %{$session{'Attachments'}}) {
124 <input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR>
131 <&|/l&>Attach file</&>:
133 <TD class=value COLSPAN=5>
134 <INPUT TYPE=FILE NAME="Attach">
135 <INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>">
140 <&|/l&>Describe the issue below</&>:<br>
141 % if (exists $ARGS{Content}) {
142 <& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &>
144 <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &>
151 <TD ALIGN=RIGHT COLSPAN=2>
155 <& /Elements/TitleBoxEnd &>
156 <& /Elements/Submit, Label => loc("Create")&>
158 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
159 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
160 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
161 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
162 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
165 [<A HREF="#top"><&|/l&>Show basics</&></a>] [<a class="currenttab"><&|/l&>Show details</&></a>]
167 <TABLE WIDTH="100%" BORDER=0>
169 <TD WIDTH="50%" VALIGN=TOP>
171 <& /Elements/TitleBoxStart, title => loc('The Basics'),
172 title_class=> 'inverse',
173 color => "#993333" &>
175 <TR><TD ALIGN=RIGHT><&|/l&>Priority</&>:</TD><TD><input size=3 name="InitialPriority" value="<% $ARGS{InitialPriority} ? $ARGS{InitialPriority} : $QueueObj->InitialPriority %>"></TD></TR>
176 <TR><TD ALIGN=RIGHT><&|/l&>Final Priority</&>:</TD><TD><input size=3 name="FinalPriority" value="<% $ARGS{FinalPriority} ? $ARGS{FinalPriority} : $QueueObj->FinalPriority %>"></TD></TR>
177 <TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><&|/l,'<input size=3 name="TimeWorked" value="'.$ARGS{TimeWorked}.'">'&>[_1] min</&></TD></TR>
178 <TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><&|/l,'<input size=3 name="TimeLeft" value="'.$ARGS{TimeLeft}.'">'&>[_1] min</&></TD></TR>
180 <& /Elements/TitleBoxEnd &>
182 <& /Elements/TitleBoxStart, title => loc("Dates"),
183 title_class=> 'inverse',
184 color => "#663366" &>
187 <TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts" value="<% $ARGS{Starts} %>"></TD></TR>
188 <TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due" value="<%
189 $ARGS{Due}%>"></TD></TR>
191 <& /Elements/TitleBoxEnd &>
196 <& /Elements/TitleBoxStart, title => loc('Links'),
197 title_class=> 'inverse',
198 titleright => '', color=> "#336633" &>
200 <i><&|/l&>(Enter ticket ids or URLs, separated with spaces)</&></i>
202 <TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn" value="<% $ARGS{'new-DependsOn'} %>"></TD></TR>
203 <TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new" value="<% $ARGS{'DependsOn-new'} %>"></TD></TR>
204 <TR><TD ALIGN=RIGHT><&|/l&>Parents</&></TD><TD><input size=10 name="new-MemberOf" value="<% $ARGS{'new-MemberOf'} %>"></TD></TR>
205 <TR><TD ALIGN=RIGHT><&|/l&>Children</&></TD><TD><input size=10 name="MemberOf-new" value="<% $ARGS{'MemberOf-new'} %>"></TD></TR>
206 <TR><TD ALIGN=RIGHT><&|/l&>Refers to</&></TD><TD><input size=10 name="new-RefersTo" value="<% $ARGS{'new-RefersTo'} %>"></TD></TR>
207 <TR><TD ALIGN=RIGHT><&|/l&>Referred to by</&></TD><TD><input size=10 name="RefersTo-new" value="<% $ARGS{'RefersTo-new'} %>"></TD></TR>
211 <& /Elements/TitleBoxEnd &>
217 <& /Elements/Submit, Label => loc("Create") &>
219 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
220 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
221 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
222 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
223 <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
229 my $QueueObj = new RT::Queue($session{'CurrentUser'});
230 $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded."));
231 my $CFs = $QueueObj->CustomFields();
233 # if no due date has been set explicitly, then use the
234 # queue's default if it exists
235 if ($QueueObj->DefaultDueIn && !$ARGS{'Due'}) {
236 my $default_due = RT::Date->new($session{'CurrentUser'});
237 $default_due->SetToNow();
238 $default_due->AddDays($QueueObj->DefaultDueIn);
239 $ARGS{'Due'} = $default_due->ISO();
242 # {{{ deal with deleting uploaded attachments
243 foreach my $key (keys %ARGS) {
244 if ($key =~ m/^DeleteAttach-(.+)$/) {
245 delete $session{'Attachments'}{$1};
247 $session{'Attachments'} = { %{$session{'Attachments'} || {}} };
250 # {{{ store the uploaded attachment in session
251 if ($ARGS{'Attach'}) { # attachment?
252 $session{'Attachments'} = {} unless defined $session{'Attachments'};
254 my $subject = "$ARGS{'Attach'}";
256 # strip leading directories
257 $subject =~ s#^.*[\\/]##;
259 my $attachment = MakeMIMEEntity(
262 AttachmentFieldName => 'Attach'
265 $session{'Attachments'} = { %{$session{'Attachments'} || {}},
266 $ARGS{'Attach'} => $attachment };
270 # delete temporary storage entry to make WebUI clean
271 unless (keys %{$session{'Attachments'}} and $ARGS{'id'} eq 'new') {
272 delete $session{'Attachments'};
278 if ((!exists $ARGS{'AddMoreAttach'}) && ($ARGS{'id'} eq 'new')) { # new ticket?
279 $m->comp('Display.html', %ARGS);
286 $DependedOnBy => undef
288 $QuoteTransaction => undef