This commit was generated by cvs2svn to compensate for changes in r2526,
[freeside.git] / rt / webrt / Ticket / ModifyAll.html
1 <& /Elements/Header, Title => "Ticket #".$Ticket->Id ." Jumbo update: ".$Ticket->Subject &>
2 <& /Ticket/Elements/Tabs, Ticket => $Ticket , current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id &>
3
4 <& /Elements/ListActions, actions => \@results &>
5
6 <FORM METHOD=POST ACTION="ModifyAll.html" ENCTYPE="multipart/form-data">
7 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>">
8
9
10 <& /Elements/TitleBoxStart, title => 'Modify ticket #'.$Ticket->Id,   color=> "#993333", width => "100%" &>
11 <& Elements/EditBasics, TicketObj => $Ticket &>
12 <& /Elements/TitleBoxEnd &>
13
14 <BR>
15
16 <& /Elements/TitleBoxStart, title => 'Dates',  width => "100%", color => "#663366"  &>
17 <& Elements/EditDates, TicketObj => $Ticket &>
18 <& /Elements/TitleBoxEnd &>
19
20 <BR>
21
22 <& /Elements/TitleBoxStart, title => 'Keywords', color =>"#993333"&>
23 <& Elements/EditKeywordSelects, TicketObj=>$Ticket &>
24 <& /Elements/TitleBoxEnd &>
25
26 <BR>
27
28 <& /Elements/TitleBoxStart, title => 'People',width => "100%", color=> "#333399" &>
29 <& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
30 <& /Elements/TitleBoxEnd &>
31
32 <BR>
33
34 <& /Elements/TitleBoxStart, title => 'Relationships', color => "#336633"&>
35 <& Elements/EditLinks, Ticket => $Ticket &>
36 <& /Elements/TitleBoxEnd &>
37
38 <BR>
39
40 <& /Elements/TitleBoxStart, title => 'Update ticket' &>
41 <hr>
42 Update Type: <select name="UpdateType">
43 % if ($CanComment) {
44   <option value="private" >Comments (Not sent to requestors)</option>
45 % }
46 % if ($CanRespond) {
47    <option value="response">Response to requestors</option>
48 % }
49 </select> 
50 <br>
51
52 Subject: <input name="UpdateSubject" size=60 value=""> <br>
53 Attach: <input name="UpdateAttachment" type=file> <br>
54 <& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
55 <& /Elements/TitleBoxEnd &>
56
57
58 <& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#333399" &>
59 </form>
60
61 <%INIT>
62
63
64
65 my $Ticket = LoadTicket($id);
66
67 my $CanRespond = 0;
68 my $CanComment = 0;
69
70
71 $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
72                      $Ticket->CurrentUserHasRight('ModifyTicket') ); 
73
74 $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
75                      $Ticket->CurrentUserHasRight('ModifyTicket') );
76
77
78 my (@wresults, @results, @okresults, @dresults, @lresults);
79
80 unless ($OnlySearchForPeople) {
81     @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
82     @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
83     @okresults = ProcessTicketObjectKeywords(TicketObj => $Ticket, ARGSRef => \%ARGS);
84
85     @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
86     @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
87
88     $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
89
90     if ($ARGS{'UpdateContent'} && 
91         $ARGS{'UpdateContent'} ne '' && 
92         $ARGS{'UpdateContent'} ne  "-- \n" . 
93                                 $session{'CurrentUser'}->UserObj->Signature
94        ) {
95          ProcessUpdateMessage(TicketObj => $Ticket, 
96                               ARGSRef=>\%ARGS, 
97                               Actions=>\@results);
98         }
99 }
100 push @results, @wresults;
101 push @results, @dresults;
102 push @results, @lresults;
103 push @results, @okresults;
104
105 # If they've gone and moved the ticket to somewhere they can't see, etc...
106 # TODO: display the results, even if we can't display the ticket.
107
108 unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
109    Abort("No permission to view ticket");
110 }
111
112
113 </%INIT>
114
115
116
117 <%ARGS>
118 $OnlySearchForPeople => undef
119 $UserField => undef
120 $UserOp => undef
121 $UserString => undef
122 $id => undef
123 </%ARGS>
124