import of rt 3.0.9
[freeside.git] / rt / html / Ticket / Modify.html
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
10 %# from www.gnu.org.
11 %# 
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 %# General Public License for more details.
16 %# 
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
24 <& /Elements/Header, Title => loc('Modify ticket #[_1]', $TicketObj->Id) &>
25 <& /Ticket/Elements/Tabs, 
26     Ticket => $TicketObj, current_subtab => "Ticket/Modify.html?id=".$TicketObj->Id, 
27     Title => loc('Modify ticket #[_1]', $TicketObj->Id) &>
28
29 <& /Elements/ListActions, actions => \@results &>
30 <FORM METHOD=POST ACTION="Modify.html">
31 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>">
32
33 <& /Elements/TitleBoxStart, title => loc('Modify ticket #[_1]',$TicketObj->Id),   color=> "#993333", width => "100%" &>
34 <& Elements/EditBasics, TicketObj => $TicketObj &>
35 <& Elements/EditCustomFields, TicketObj => $TicketObj &>
36 <& /Elements/TitleBoxEnd &>
37
38 <& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#993333" &>
39 </form>
40 <%INIT>
41   
42 my $TicketObj = LoadTicket($id);
43 my $CustomFields = $TicketObj->QueueObj->CustomFields();
44
45 # Now let callbacks have a chance at editing %ARGS
46 $m->comp('/Elements/Callback', TicketObj => $TicketObj, CustomFields => $CustomFields, %ARGS);
47
48 my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS);
49 my @cf_results = ProcessTicketCustomFieldUpdates(TicketObj => $TicketObj, ARGSRef => \%ARGS);
50 push (@results, @cf_results);
51
52 # TODO: display the results, even if we can't display the ticket
53
54 unless ($TicketObj->CurrentUserHasRight('ShowTicket')) {
55     Abort("No permission to view ticket");
56
57
58 </%INIT>
59
60
61 <%ARGS>
62 $id => undef
63 </%ARGS>