1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2007 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/copyleft/gpl.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 <& /Elements/ListActions, actions => \@results &>
56 <form method="post" action="ModifyAll.html" enctype="multipart/form-data">
57 <& /Elements/Callback, _CallbackName => 'FormStart',ARGSRef =>\%ARGS &>
58 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
60 <&| /Widgets/TitleBox, title => loc('Modify ticket # [_1]', $Ticket->Id) &>
61 <& Elements/EditBasics, TicketObj => $Ticket &>
62 <& Elements/EditCustomFields, TicketObj => $Ticket &>
67 <&| /Widgets/TitleBox, title => loc('Dates') &>
68 <& Elements/EditDates, TicketObj => $Ticket &>
74 <&| /Widgets/TitleBox, title => loc('People') &>
75 <& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
80 <&| /Widgets/TitleBox, title => loc('Links') &>
81 <& /Elements/EditLinks, Object => $Ticket, Merge => 1 &>
86 <&| /Widgets/TitleBox, title => loc('Update ticket') &>
89 <td class="label"><&|/l&>Update Type</&>:</td>
91 <select name="UpdateType">
93 <option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option>
96 <option value="response"><&|/l&>Reply to requestors</&></option>
102 <td class="label"><&|/l&>Subject</&>:</td>
103 <td class="entry"><input name="UpdateSubject" size="60" value="<%$Ticket->Subject%>" /></td>
105 % if (my $TxnCFs = $Ticket->TransactionCustomFields) {
106 % while (my $CF = $TxnCFs->Next()) {
108 <td class="label"><% $CF->Name %>:</td>
109 <td class="entry"><& /Elements/EditCustomField,
111 NamePrefix => "Object-RT::Transaction--CustomField-"
112 &><em><% $CF->FriendlyType %></em></td>
117 <td class="label"><&|/l&>Attach</&>:</td>
118 <td class="entry"><input name="UpdateAttachment" type="file" /></td>
121 <td class="labeltop"><&|/l&>Content</&>:</td>
122 <td class="entry"><& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &></td>
129 Label => loc('Save Changes'),
130 Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
137 my $Ticket = LoadTicket($id);
143 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
144 $Ticket->CurrentUserHasRight('ModifyTicket') );
146 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
147 $Ticket->CurrentUserHasRight('ModifyTicket') );
150 $m->comp('/Elements/Callback', TicketObj => $Ticket, ARGSRef => \%ARGS);
151 my (@wresults, @results, @dresults, @lresults, @cf_results);
153 unless ($OnlySearchForPeople) {
154 # There might be two owners.
155 if ( ref ($ARGS{'Owner'} )) {
156 my @owners =@{$ARGS{'Owner'}};
157 delete $ARGS{'Owner'};
158 foreach my $owner(@owners){
159 $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
164 @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
165 @cf_results = ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS);
166 @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
167 @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
169 if ($ARGS{'UpdateAttachment'}) {
170 my $subject = "$ARGS{'UpdateAttachment'}";
171 # since CGI.pm deutf8izes the magic field, we need to add it back.
172 Encode::_utf8_on($subject);
173 # strip leading directories
174 $subject =~ s#^.*[\\/]##;
176 my $attachment = MakeMIMEEntity(
179 AttachmentFieldName => 'UpdateAttachment'
181 delete $ARGS{'UpdateAttachment'};
182 $ARGS{'UpdateAttachments'}->{ $subject } = $attachment;
185 $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g if $ARGS{'UpdateContent'};
187 if ($ARGS{'UpdateAttachments'} || ( $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" .
188 $session{'CurrentUser'}->UserObj->Signature)) {
189 ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results);
191 @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
193 push @results, @wresults;
194 push @results, @dresults;
195 push @results, @lresults;
196 push @results, @cf_results;
198 # undef so that TransactionBatch scrips run and update the ticket
200 $Ticket = LoadTicket($id);
202 # If they've gone and moved the ticket to somewhere they can't see, etc...
203 # TODO: display the results, even if we can't display the ticket.
205 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
206 Abort("No permission to view ticket");
215 $OnlySearchForPeople => undef