import rt 3.2.2
[freeside.git] / rt / html / Ticket / Create.html
1 %# {{{ BEGIN BPS TAGGED BLOCK
2 %# 
3 %# COPYRIGHT:
4 %#  
5 %# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC 
6 %#                                          <jesse@bestpractical.com>
7 %# 
8 %# (Except where explicitly superseded by other copyright notices)
9 %# 
10 %# 
11 %# LICENSE:
12 %# 
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
16 %# from www.gnu.org.
17 %# 
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.
22 %# 
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.
26 %# 
27 %# 
28 %# CONTRIBUTION SUBMISSION POLICY:
29 %# 
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.)
35 %# 
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.
44 %# 
45 %# }}} END BPS TAGGED BLOCK
46 <& /Elements/Header, Title => loc("Create a new ticket") &>
47 <& /Elements/Tabs, 
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">
52 <A NAME="top">
53         
54         
55 [<a class="currenttab"><&|/l&>Show basics</&></a>] [<A HREF="#detail"><&|/l&>Show details</&></a>]
56 <BR>
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%>">
62 </TD>
63 <TD class=label><&|/l&>Status</&>:
64 </TD>
65 <TD class=value>
66 <& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new', DefaultValue => 0 &>
67 </TD>
68 <TD class=label>
69 <&|/l&>Owner</&>:
70 </TD>
71 <TD class=value>
72 <& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||$RT::Nobody->Id, DefaultValue => 0 &>
73 </TD>
74 </TR>
75 <TR>
76 <TD class=label>
77 <&|/l&>Requestors</&>:
78 </TD>
79 <TD class=value COLSPAN=5>
80 <INPUT Name="Requestors" Value="<% ($ARGS{Requestors}) || $session{CurrentUser}->EmailAddress %>" SIZE=40>
81 </TD>
82 </TR>
83 <TR>
84 <TD class=labeltop>
85 <&|/l&>Cc</&>:
86 </TD>
87 <TD class=value COLSPAN=5>
88 <INPUT NAME="Cc" SIZE=40 VALUE="<% $ARGS{Cc} %>"><BR>
89 <i><font size=-2>
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>
91 </TD>
92 </TR>
93 <TR>
94 <TD class=labeltop>
95 <&|/l&>Admin Cc</&>:
96 </TD>
97 <TD class=value COLSPAN=5>
98 <INPUT NAME="AdminCc" SIZE=40 VALUE="<% $ARGS{AdminCc} %>"><BR>
99 <i><font size=-2>
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>
101 </TD>
102 </TR>
103 <TR>
104 <TD class=label>
105 <&|/l&>Subject</&>:
106 </TD>
107 <TD class=value COLSPAN=5>
108 <INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="<%$ARGS{Subject} || ''%>">
109 </TD>
110 </TR>
111 <TR>
112 <TD COLSPAN=6>
113 <& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &>
114 </TD>
115 </TR>
116 <TR>
117 % if (exists $session{'Attachments'}) {
118 <TD class=label>
119 <&|/l&>Attached file</&>:
120 </TD>
121 <TD COLSPAN=5>
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>
125 % } # end of foreach
126 </TD>
127 </TR>
128 <TR>
129 % } # end of if
130 <TD>
131 <&|/l&>Attach file</&>:
132 </TD>
133 <TD class=value COLSPAN=5>
134 <INPUT TYPE=FILE NAME="Attach">
135 <INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>">
136 </TD>
137 </TR>
138 <TR>
139 <TD COLSPAN=6>
140 <&|/l&>Describe the issue below</&>:<br>
141 % if (exists $ARGS{Content}) {
142 <& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &>
143 % } else {
144 <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &>
145 %}
146
147 <BR>
148 </TD>
149 </TR>
150 <TR>
151 <TD ALIGN=RIGHT COLSPAN=2>
152 </TD>
153 </TR>
154 </TABLE>
155 <& /Elements/TitleBoxEnd &>
156 <& /Elements/Submit, Label => loc("Create")&>
157
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>
163
164 <A NAME="detail">
165         [<A HREF="#top"><&|/l&>Show basics</&></a>] [<a class="currenttab"><&|/l&>Show details</&></a>]
166 <BR>
167 <TABLE WIDTH="100%" BORDER=0>
168 <TR>
169 <TD WIDTH="50%" VALIGN=TOP>
170
171           <& /Elements/TitleBoxStart, title => loc('The Basics'), 
172                 title_class=> 'inverse',  
173                 color => "#993333" &>
174 <TABLE BORDER=0>
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>
179 </TABLE>
180 <& /Elements/TitleBoxEnd &>
181 <br>
182 <& /Elements/TitleBoxStart, title => loc("Dates"),
183                 title_class=> 'inverse',  
184                  color => "#663366" &>
185
186 <TABLE BORDER=0>
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>
190 </TABLE>
191 <& /Elements/TitleBoxEnd &>
192 <BR>
193 </TD>
194
195 <TD VALIGN="TOP">
196 <& /Elements/TitleBoxStart, title => loc('Links'), 
197         title_class=> 'inverse',  
198         titleright => '', color=> "#336633" &>
199
200 <i><&|/l&>(Enter ticket ids or URLs, separated with spaces)</&></i>
201 <TABLE BORDER=0>
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>
208
209
210 </TABLE>
211 <& /Elements/TitleBoxEnd &>
212 <BR>
213
214 </TD>
215 </TR>
216 </TABLE>
217 <& /Elements/Submit, Label => loc("Create") &>
218 </FORM>
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>
224
225 <%INIT>
226
227
228
229 my $QueueObj = new RT::Queue($session{'CurrentUser'});
230 $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded."));
231 my $CFs = $QueueObj->CustomFields();
232
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();
240 }
241
242 # {{{ deal with deleting uploaded attachments
243 foreach my $key (keys %ARGS) {
244     if ($key =~ m/^DeleteAttach-(.+)$/) {
245         delete $session{'Attachments'}{$1};
246     }
247     $session{'Attachments'} = { %{$session{'Attachments'} || {}} };
248 }
249
250 # {{{ store the uploaded attachment in session
251 if ($ARGS{'Attach'}) {                  # attachment?
252     $session{'Attachments'} = {} unless defined $session{'Attachments'};
253
254     my $subject = "$ARGS{'Attach'}";
255
256     # strip leading directories
257     $subject =~ s#^.*[\\/]##;
258
259     my $attachment = MakeMIMEEntity(
260         Subject             => $subject,
261         Body                => "",
262         AttachmentFieldName => 'Attach'
263     );
264
265     $session{'Attachments'} = { %{$session{'Attachments'} || {}},
266                                 $ARGS{'Attach'} => $attachment };
267 }
268 # }}}
269
270 # delete temporary storage entry to make WebUI clean
271 unless (keys %{$session{'Attachments'}} and $ARGS{'id'} eq 'new') {
272     delete $session{'Attachments'};
273 }
274
275
276 # }}}
277
278 if ((!exists $ARGS{'AddMoreAttach'}) && ($ARGS{'id'} eq 'new')) { # new ticket?
279     $m->comp('Display.html', %ARGS);
280     return();
281 }
282 </%INIT>
283
284 <%ARGS>
285 $DependsOn => undef
286 $DependedOnBy => undef
287 $MemberOf => undef
288 $QuoteTransaction => undef
289 $Queue => undef
290 </%ARGS>