1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA.
28 %# CONTRIBUTION SUBMISSION POLICY:
30 %# (The following paragraph is not intended to limit the rights granted
31 %# to you to modify and distribute this software under the terms of
32 %# the GNU General Public License and is only of importance to you if
33 %# you choose to contribute your changes and enhancements to the
34 %# community by submitting them to Best Practical Solutions, LLC.)
36 %# By intentionally submitting any modifications, corrections or
37 %# derivatives to this work, or any other work intended for use with
38 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
39 %# you are the copyright holder for those contributions and you grant
40 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
41 %# royalty-free, perpetual, license to use, copy, create derivative
42 %# works based on those contributions, and sublicense and distribute
43 %# those contributions and any derivatives thereof.
45 %# END BPS TAGGED BLOCK }}}
46 <& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &>
47 <& /Ticket/Elements/Tabs,
49 current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id,
50 Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &>
52 <& /Elements/ListActions, actions => \@results &>
54 <FORM METHOD=POST ACTION="ModifyAll.html" ENCTYPE="multipart/form-data">
55 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>">
58 <& /Elements/TitleBoxStart, title => loc('Modify ticket # [_1]', $Ticket->Id), color=> "#993333", width => "100%" &>
59 <& Elements/EditBasics, TicketObj => $Ticket &>
60 <& Elements/EditCustomFields, TicketObj => $Ticket &>
61 <& /Elements/TitleBoxEnd &>
65 <& /Elements/TitleBoxStart, title => loc('Dates'), width => "100%", color => "#663366" &>
66 <& Elements/EditDates, TicketObj => $Ticket &>
67 <& /Elements/TitleBoxEnd &>
72 <& /Elements/TitleBoxStart, title => loc('People'),width => "100%", color=> "#333399" &>
73 <& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
74 <& /Elements/TitleBoxEnd &>
78 <& /Elements/TitleBoxStart, title => loc('Links'), color => "#336633"&>
79 <& /Elements/EditLinks, Object => $Ticket, Merge => 1 &>
80 <& /Elements/TitleBoxEnd &>
84 <& /Elements/TitleBoxStart, title => loc('Update ticket') &>
87 <td class="label"><&|/l&>Update Type</&>:</td>
89 <select name="UpdateType">
91 <option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option>
94 <option value="response"><&|/l&>Reply to requestors</&></option>
100 <td class="label"><&|/l&>Subject</&>:</td>
101 <td class="entry"><input name="UpdateSubject" size=60 value="<%$Ticket->Subject%>"></td>
103 % if (my $TxnCFs = $Ticket->TransactionCustomFields) {
104 % while (my $CF = $TxnCFs->Next()) {
106 <TD class="label"><% $CF->Name %>:</TD>
107 <TD class="entry"><& /Elements/EditCustomField,
109 NamePrefix => "Object-RT::Transaction--CustomField-"
110 &><em><% $CF->FriendlyType %></em></TD>
115 <td class="label"><&|/l&>Attach</&>:</td>
116 <td class="entry"><input name="UpdateAttachment" type=file></td>
119 <td class="labeltop"><&|/l&>Content</&>:</td>
120 <td class="entry"><& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &></td>
123 <& /Elements/TitleBoxEnd &>
127 Label => loc('Save Changes'),
128 Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
135 my $Ticket = LoadTicket($id);
141 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
142 $Ticket->CurrentUserHasRight('ModifyTicket') );
144 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
145 $Ticket->CurrentUserHasRight('ModifyTicket') );
148 my (@wresults, @results, @dresults, @lresults, @cf_results);
150 unless ($OnlySearchForPeople) {
151 @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
152 @cf_results = ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS);
153 @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
154 @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
156 if ($ARGS{'UpdateAttachment'}) {
157 my $subject = "$ARGS{'UpdateAttachment'}";
158 # since CGI.pm deutf8izes the magic field, we need to add it back.
159 Encode::_utf8_on($subject);
160 # strip leading directories
161 $subject =~ s#^.*[\\/]##;
163 my $attachment = MakeMIMEEntity(
166 AttachmentFieldName => 'UpdateAttachment'
168 delete $ARGS{'UpdateAttachment'};
169 $ARGS{'UpdateAttachments'}->{ $subject } = $attachment;
172 $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g;
174 if ($ARGS{'UpdateAttachments'} || ( $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" .
175 $session{'CurrentUser'}->UserObj->Signature)) {
176 ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results);
178 @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
180 push @results, @wresults;
181 push @results, @dresults;
182 push @results, @lresults;
183 push @results, @cf_results;
185 # If they've gone and moved the ticket to somewhere they can't see, etc...
186 # TODO: display the results, even if we can't display the ticket.
188 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
189 Abort("No permission to view ticket");
198 $OnlySearchForPeople => undef