1 %# {{{ BEGIN BPS TAGGED BLOCK
5 %# This software is Copyright (c) 1996-2004 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>
104 <td class="label"><&|/l&>Attach</&>:</td>
105 <td class="entry"><input name="UpdateAttachment" type=file></td>
108 <td class="labeltop"><&|/l&>Content</&>:</td>
109 <td class="entry"><& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &></td>
112 <& /Elements/TitleBoxEnd &>
115 <& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
122 my $Ticket = LoadTicket($id);
128 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
129 $Ticket->CurrentUserHasRight('ModifyTicket') );
131 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
132 $Ticket->CurrentUserHasRight('ModifyTicket') );
135 my (@wresults, @results, @dresults, @lresults, @cf_results);
137 unless ($OnlySearchForPeople) {
138 @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
139 @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
140 @cf_results = ProcessTicketCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS);
141 @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
142 @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
144 if ($ARGS{'UpdateAttachment'}) {
145 my $subject = "$ARGS{'UpdateAttachment'}";
146 # since CGI.pm deutf8izes the magic field, we need to add it back.
147 Encode::_utf8_on($subject);
148 # strip leading directories
149 $subject =~ s#^.*[\\/]##;
151 my $attachment = MakeMIMEEntity(
154 AttachmentFieldName => 'UpdateAttachment'
156 delete $ARGS{'UpdateAttachment'};
157 $ARGS{'UpdateAttachments'}->{ $subject } = $attachment;
160 $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g;
162 if ($ARGS{'UpdateAttachments'} || (
163 $ARGS{'UpdateContent'} &&
164 $ARGS{'UpdateContent'} ne "-- \n" .
165 $session{'CurrentUser'}->UserObj->Signature
167 ProcessUpdateMessage(TicketObj => $Ticket,
172 push @results, @wresults;
173 push @results, @dresults;
174 push @results, @lresults;
175 push @results, @cf_results;
177 # If they've gone and moved the ticket to somewhere they can't see, etc...
178 # TODO: display the results, even if we can't display the ticket.
180 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
181 Abort("No permission to view ticket");
190 $OnlySearchForPeople => undef