1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
6 %# <sales@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) &>
51 % $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
52 <& /Elements/ListActions, actions => \@results &>
54 <form method="post" action="ModifyAll.html" name="TicketModifyAll" enctype="multipart/form-data">
55 % $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS );
56 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
57 <input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
59 <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id), class=>'ticket-info-basics' &>
60 <& Elements/EditBasics, TicketObj => $Ticket, defaults => \%ARGS &>
61 <& /Elements/EditCustomFields, Object => $Ticket, Grouping => 'Basics' &>
64 % $m->callback(CallbackName => 'AfterBasics', Ticket => $Ticket);
66 <& /Elements/EditCustomFieldCustomGroupings, Object => $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 &>
87 <&| /Widgets/TitleBox, title => loc('Merge'), class=>'ticket-info-merge' &>
88 <& Elements/EditMerge, Ticket => $Ticket, %ARGS &>
93 <&| /Widgets/TitleBox, title => loc('Update ticket') &>
96 <td class="label"><&|/l&>Update Type</&>:</td>
98 <select name="UpdateType">
100 <option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option>
103 <option value="response"><&|/l&>Reply to requestors</&></option>
106 % $m->callback( %ARGS, CallbackName => 'AfterUpdateType' );
110 <td class="label"><&|/l&>Subject</&>:</td>
111 <td class="entry"><input name="UpdateSubject" size="60" value="<%$Ticket->Subject%>" />
112 % $m->callback( %ARGS, CallbackName => 'AfterSubject' );
116 <tr><td colspan="2"><& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket &></td></tr>
118 <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &>
121 <td class="labeltop"><&|/l&>Content</&>:</td>
123 % if (defined $ARGS{UpdateContent} && length($ARGS{UpdateContent})) {
124 <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0 &>
126 <& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
134 Name => 'SubmitTicket',
135 Label => loc('Save Changes'),
136 Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
143 my $Ticket = LoadTicket($id);
144 my $CustomFields = $Ticket->CustomFields;
150 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
151 $Ticket->CurrentUserHasRight('ModifyTicket') );
153 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
154 $Ticket->CurrentUserHasRight('ModifyTicket') );
156 ProcessAttachments(ARGSRef => \%ARGS);
160 $m->callback( TicketObj => $Ticket, ARGSRef => \%ARGS, skip_update => \$skip_update );
163 my ($status, @msg) = $m->comp(
164 '/Elements/ValidateCustomFields',
166 CustomFields => $CustomFields,
175 # There might be two owners.
176 if ( ref ($ARGS{'Owner'} )) {
177 my @owners =@{$ARGS{'Owner'}};
178 delete $ARGS{'Owner'};
179 foreach my $owner(@owners){
180 if (defined($owner) && $owner =~ /\D/) {
181 $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->Name eq $owner);
183 elsif (length $owner) {
184 $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
189 unless ($skip_update or $OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} ) {
190 push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
191 push @results, ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS);
192 push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
193 push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
194 push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
195 push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
197 $Ticket->ApplyTransactionBatch;
199 MaybeRedirectForResults(
200 Actions => \@results,
201 Path => "/Ticket/ModifyAll.html",
202 Arguments => { id => $Ticket->id },
206 # If they've gone and moved the ticket to somewhere they can't see, etc...
207 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
209 Abort("A change was applied successfully, but you no longer have permissions to view the ticket", Actions => \@results);
211 Abort("No permission to view ticket");
221 $OnlySearchForPeople => undef
222 $OnlySearchForGroup => undef
226 $GroupString => undef