Putting 4.2.0 on top of 4.0.17
[usit-rt.git] / share / html / SelfService / Create.html
CommitLineData
84fb5b46
MKG
1%# BEGIN BPS TAGGED BLOCK {{{
2%#
3%# COPYRIGHT:
4%#
403d7b0b 5%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
84fb5b46
MKG
6%# <sales@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., 51 Franklin Street, Fifth Floor, Boston, MA
26%# 02110-1301 or visit their web page on the internet at
27%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
28%#
29%#
30%# CONTRIBUTION SUBMISSION POLICY:
31%#
32%# (The following paragraph is not intended to limit the rights granted
33%# to you to modify and distribute this software under the terms of
34%# the GNU General Public License and is only of importance to you if
35%# you choose to contribute your changes and enhancements to the
36%# community by submitting them to Best Practical Solutions, LLC.)
37%#
38%# By intentionally submitting any modifications, corrections or
39%# derivatives to this work, or any other work intended for use with
40%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41%# you are the copyright holder for those contributions and you grant
42%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43%# royalty-free, perpetual, license to use, copy, create derivative
44%# works based on those contributions, and sublicense and distribute
45%# those contributions and any derivatives thereof.
46%#
47%# END BPS TAGGED BLOCK }}}
48<& Elements/Header, Title => loc("Create a ticket") &>
49
50<& /Elements/ListActions, actions => \@results &>
af59614d 51<form action="Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
84fb5b46 52<input type="hidden" class="hidden" name="id" value="new" />
af59614d
MKG
53<input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
54% for my $key (grep {defined $ARGS{$_}} map {+("new-$_", "$_-new")} keys %RT::Link::DIRMAP) {
55<input type="hidden" class="hidden" name="<% $key %>" value="<% $ARGS{$key} %>" />
56% }
84fb5b46
MKG
57
58<table width="100%">
59<tr>
60<td class="label">
61<&|/l&>Queue</&>:
62</td>
63<td class="value">
64 <input type="hidden" class="hidden" name="Queue" value="<%$queue_obj->id || ''%>" />
65 <strong><%$queue_obj->Name || ''%></strong> <% $queue_obj->Description ? '('.$queue_obj->Description.')' : '' %>
66</td>
67</tr>
68<% $m->callback( CallbackName => 'AfterQueue', %ARGS, QueueObj => $queue_obj ) %>
69<tr>
70<td class="label">
71<&|/l&>Requestors</&>:
72</td>
73<td class="value">
af59614d 74<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1 &>
84fb5b46
MKG
75</td>
76</tr>
77<tr>
78<td class="label">
79<&|/l&>Cc</&>:
80</td>
81<td class="value">
82<& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '' &>
83</td>
84</tr>
85<tr>
86<td class="label">
87<&|/l&>Subject</&>:
88</td>
89<td class="value">
90<input name="Subject" size="60" maxsize="200" value="<%$ARGS{Subject} || ''%>" />
91</td>
92</tr>
93<tr>
94 <td colspan="2">
af59614d
MKG
95 <& /Elements/EditCustomFields,
96 %ARGS,
97 Object => RT::Ticket->new($session{CurrentUser}),
98 CustomFields => $queue_obj->TicketCustomFields,
99 AsTable => 0,
100 &>
84fb5b46
MKG
101 </td>
102</tr>
5b0d0914 103<& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $queue_obj &>
84fb5b46
MKG
104</table>
105<table width="100%">
106<tr>
107<td colspan="2">
108<&|/l&>Describe the issue below</&>:<br />
109<& /Elements/MessageBox, Default => $ARGS{Content} || '' &>
110</td>
111</tr>
112</table>
113<& /Elements/Submit, Label => loc("Create ticket")&>
114
115
116</form>
117<%args>
118$Queue => undef
119</%args>
120<%init>
121my @results;
122my $queue_obj = RT::Queue->new($session{'CurrentUser'});
123$queue_obj->Load($Queue);
84fb5b46 124
5b0d0914
MKG
125ProcessAttachments(ARGSRef => \%ARGS);
126
84fb5b46 127my $skip_create = 0;
af59614d
MKG
128
129{
130 my ($status, @msg) = $m->comp(
131 '/Elements/ValidateCustomFields',
132 CustomFields => $queue_obj->TicketCustomFields,
133 ARGSRef => \%ARGS
134 );
135 unless ($status) {
136 push @results, @msg;
137 $skip_create = 1;
138 }
139}
140
84fb5b46
MKG
141$m->callback( CallbackName => 'BeforeCreate', ARGSRef => \%ARGS, skip_create => \$skip_create, results => \@results );
142
5b0d0914 143if ( !exists $ARGS{'AddMoreAttach'} and defined($ARGS{'id'}) and $ARGS{'id'} eq 'new' ) { # new ticket?
af59614d 144 if ( !$skip_create ) {
84fb5b46
MKG
145 $m->comp('Display.html', %ARGS);
146 $RT::Logger->crit("After display call; error is $@");
147 $m->abort();
148 }
84fb5b46
MKG
149}
150
151</%init>