1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2009 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., 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.
30 %# CONTRIBUTION SUBMISSION POLICY:
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.)
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.
47 %# END BPS TAGGED BLOCK }}}
48 <& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &>
49 <& /Ticket/Elements/Tabs,
51 current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id,
52 Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &>
54 % $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
55 <& /Elements/ListActions, actions => \@results &>
57 <form method="post" action="ModifyAll.html" enctype="multipart/form-data">
58 % $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS );
59 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
61 <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id), class=>'ticket-info-basics' &>
62 <& Elements/EditBasics, TicketObj => $Ticket &>
63 <& Elements/EditCustomFields, TicketObj => $Ticket &>
68 <&| /Widgets/TitleBox, title => loc('Dates'), class=>'ticket-info-dates'&>
69 <& Elements/EditDates, TicketObj => $Ticket &>
75 <&| /Widgets/TitleBox, title => loc('People'), class=>'ticket-info-people' &>
76 <& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp, GroupString => $GroupString, GroupOp => $GroupOp, GroupField => $GroupField &>
81 <&| /Widgets/TitleBox, title => loc('Links'), class=>'ticket-info-links' &>
82 <& /Elements/EditLinks, Object => $Ticket, Merge => 1 &>
87 <&| /Widgets/TitleBox, title => loc('Update ticket') &>
90 <td class="label"><&|/l&>Update Type</&>:</td>
92 <select name="UpdateType">
94 <option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option>
97 <option value="response"><&|/l&>Reply to requestors</&></option>
100 % $m->callback( %ARGS, CallbackName => 'AfterUpdateType' );
104 <td class="label"><&|/l&>Subject</&>:</td>
105 <td class="entry"><input name="UpdateSubject" size="60" value="<%$Ticket->Subject%>" /></td>
107 % if (my $TxnCFs = $Ticket->TransactionCustomFields) {
108 % while (my $CF = $TxnCFs->Next()) {
110 <td class="label"><% loc($CF->Name) %>:</td>
111 <td class="entry"><& /Elements/EditCustomField,
113 NamePrefix => "Object-RT::Transaction--CustomField-"
114 &><em><% $CF->FriendlyType %></em>
118 % if (exists $session{'Attachments'}) {
119 <tr><td><&|/l&>Attached file</&>:</td>
121 <&|/l&>Check box to delete</&><br />
122 % foreach my $attach_name (keys %{$session{'Attachments'}}) {
123 <input type="checkbox" class="checkbox" name="DeleteAttach-<%$attach_name%>" value="1" /><%$attach_name%><br />
130 <td class="label"><&|/l&>Attach</&>:</td>
131 <td class="entry"><input name="Attach" type="file" />
132 <input type="submit" class="button" name="AddMoreAttach" value="<&|/l&>Add More Files</&>" />
133 <input type="hidden" class="hidden" name="UpdateAttach" value="1" /></td>
136 <td class="labeltop"><&|/l&>Content</&>:</td>
138 % if (exists $ARGS{UpdateContent}) {
139 <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0 &>
141 <& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
149 Name => 'SubmitTicket',
150 Label => loc('Save Changes'),
151 Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
158 my $Ticket = LoadTicket($id);
159 my $CustomFields = $Ticket->CustomFields;
161 # call this to show up hints of valid cf values.
163 '/Elements/ValidateCustomFields',
164 CustomFields => $CustomFields,
172 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
173 $Ticket->CurrentUserHasRight('ModifyTicket') );
175 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
176 $Ticket->CurrentUserHasRight('ModifyTicket') );
178 # {{{ deal with deleting uploaded attachments
179 foreach my $key (keys %ARGS) {
180 if ($key =~ m/^DeleteAttach-(.+)$/) {
181 delete $session{'Attachments'}{$1};
183 $session{'Attachments'} = { %{$session{'Attachments'} || {}} };
187 # {{{ store the uploaded attachment in session
188 if ($ARGS{'Attach'}) { # attachment?
189 my $attachment = MakeMIMEEntity(
190 AttachmentFieldName => 'Attach'
193 my $file_path = Encode::decode_utf8("$ARGS{'Attach'}");
194 $session{'Attachments'} = {
195 %{$session{'Attachments'} || {}},
196 $file_path => $attachment,
201 # delete temporary storage entry to make WebUI clean
202 unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
203 delete $session{'Attachments'};
208 $m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS );
211 unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) {
212 # There might be two owners.
213 if ( ref ($ARGS{'Owner'} )) {
214 my @owners =@{$ARGS{'Owner'}};
215 delete $ARGS{'Owner'};
216 foreach my $owner(@owners){
217 $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
222 push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
223 push @results, ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS);
224 push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
226 # Add session attachments if any to be processed by ProcessUpdateMessage
227 $ARGS{'UpdateAttachments'} = $session{'Attachments'} if ( $session{'Attachments'} );
228 push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
230 delete $session{'Attachments'};
232 push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
233 push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
236 $Ticket->ApplyTransactionBatch;
238 # If they've gone and moved the ticket to somewhere they can't see, etc...
239 # TODO: display the results, even if we can't display the ticket.
241 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
242 Abort("No permission to view ticket");
251 $OnlySearchForPeople => undef
252 $OnlySearchForGroup => undef
256 $GroupString => undef