3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &>
25 <& /Ticket/Elements/Tabs,
27 current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id,
28 Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &>
30 <& /Elements/ListActions, actions => \@results &>
32 <FORM METHOD=POST ACTION="ModifyAll.html" ENCTYPE="multipart/form-data">
33 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>">
36 <& /Elements/TitleBoxStart, title => loc('Modify ticket # [_1]', $Ticket->Id), color=> "#993333", width => "100%" &>
37 <& Elements/EditBasics, TicketObj => $Ticket &>
38 <& Elements/EditCustomFields, TicketObj => $Ticket &>
39 <& /Elements/TitleBoxEnd &>
43 <& /Elements/TitleBoxStart, title => loc('Dates'), width => "100%", color => "#663366" &>
44 <& Elements/EditDates, TicketObj => $Ticket &>
45 <& /Elements/TitleBoxEnd &>
50 <& /Elements/TitleBoxStart, title => loc('People'),width => "100%", color=> "#333399" &>
51 <& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
52 <& /Elements/TitleBoxEnd &>
56 <& /Elements/TitleBoxStart, title => loc('Relationships'), color => "#336633"&>
57 <& Elements/EditLinks, Ticket => $Ticket &>
58 <& /Elements/TitleBoxEnd &>
62 <& /Elements/TitleBoxStart, title => loc('Update ticket') &>
65 <td class="label"><&|/l&>Update Type</&>:</td>
67 <select name="UpdateType">
69 <option value="private" ><&|/l&>Comments (Not sent to requestors)</&></option>
72 <option value="response"><&|/l&>Response to requestors</&></option>
78 <td class="label"><&|/l&>Subject</&>:</td>
79 <td class="entry"><input name="UpdateSubject" size=60 value=""></td>
82 <td class="label"><&|/l&>Attach</&>:</td>
83 <td class="entry"><input name="UpdateAttachment" type=file></td>
86 <td class="labeltop"><&|/l&>Content</&>:</td>
87 <td class="entry"><& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &></td>
90 <& /Elements/TitleBoxEnd &>
93 <& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &>
100 my $Ticket = LoadTicket($id);
106 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
107 $Ticket->CurrentUserHasRight('ModifyTicket') );
109 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
110 $Ticket->CurrentUserHasRight('ModifyTicket') );
113 my (@wresults, @results, @dresults, @lresults, @cf_results);
115 unless ($OnlySearchForPeople) {
116 @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
117 @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
118 @cf_results = ProcessTicketCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS);
119 @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
120 @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
122 $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
124 if ($ARGS{'UpdateContent'} &&
125 $ARGS{'UpdateContent'} ne '' &&
126 $ARGS{'UpdateContent'} ne "-- \n" .
127 $session{'CurrentUser'}->UserObj->Signature
129 ProcessUpdateMessage(TicketObj => $Ticket,
134 push @results, @wresults;
135 push @results, @dresults;
136 push @results, @lresults;
137 push @results, @cf_results;
139 # If they've gone and moved the ticket to somewhere they can't see, etc...
140 # TODO: display the results, even if we can't display the ticket.
142 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
143 Abort("No permission to view ticket");
152 $OnlySearchForPeople => undef