summaryrefslogtreecommitdiff
path: root/rt/webrt/Ticket/ModifyAll.html
blob: ad913739d66631d6d9d238732558ca6ce0a49e26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<& /Elements/Header, Title => "Ticket #".$Ticket->Id ." Jumbo update: ".$Ticket->Subject &>
<& /Ticket/Elements/Tabs, Ticket => $Ticket , current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id &>

<& /Elements/ListActions, actions => \@results &>

<FORM METHOD=POST ACTION="ModifyAll.html" ENCTYPE="multipart/form-data">
<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>">


<& /Elements/TitleBoxStart, title => 'Modify ticket #'.$Ticket->Id,   color=> "#993333", width => "100%" &>
<& Elements/EditBasics, TicketObj => $Ticket &>
<& /Elements/TitleBoxEnd &>

<BR>

<& /Elements/TitleBoxStart, title => 'Dates',  width => "100%", color => "#663366"  &>
<& Elements/EditDates, TicketObj => $Ticket &>
<& /Elements/TitleBoxEnd &>

<BR>

<& /Elements/TitleBoxStart, title => 'Keywords', color =>"#993333"&>
<& Elements/EditKeywordSelects, TicketObj=>$Ticket &>
<& /Elements/TitleBoxEnd &>

<BR>

<& /Elements/TitleBoxStart, title => 'People',width => "100%", color=> "#333399" &>
<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
<& /Elements/TitleBoxEnd &>

<BR>

<& /Elements/TitleBoxStart, title => 'Relationships', color => "#336633"&>
<& Elements/EditLinks, Ticket => $Ticket &>
<& /Elements/TitleBoxEnd &>

<BR>

<& /Elements/TitleBoxStart, title => 'Update ticket' &>
<hr>
Update Type: <select name="UpdateType">
% if ($CanComment) {
  <option value="private" >Comments (Not sent to requestors)</option>
% }
% if ($CanRespond) {
   <option value="response">Response to requestors</option>
% }
</select> 
<br>

Subject: <input name="UpdateSubject" size=60 value=""> <br>
Attach: <input name="UpdateAttachment" type=file> <br>
<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
<& /Elements/TitleBoxEnd &>


<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#333399" &>
</form>

<%INIT>



my $Ticket = LoadTicket($id);

my $CanRespond = 0;
my $CanComment = 0;


$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
                     $Ticket->CurrentUserHasRight('ModifyTicket') ); 

$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
                     $Ticket->CurrentUserHasRight('ModifyTicket') );


my (@wresults, @results, @okresults, @dresults, @lresults);

unless ($OnlySearchForPeople) {
    @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
    @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
    @okresults = ProcessTicketObjectKeywords(TicketObj => $Ticket, ARGSRef => \%ARGS);

    @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
    @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);

    $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;

    if ($ARGS{'UpdateContent'} && 
	$ARGS{'UpdateContent'} ne '' && 
	$ARGS{'UpdateContent'} ne  "-- \n" . 
				$session{'CurrentUser'}->UserObj->Signature
       ) {
   	 ProcessUpdateMessage(TicketObj => $Ticket, 
			      ARGSRef=>\%ARGS, 
                              Actions=>\@results);
	}
}
push @results, @wresults;
push @results, @dresults;
push @results, @lresults;
push @results, @okresults;

# If they've gone and moved the ticket to somewhere they can't see, etc...
# TODO: display the results, even if we can't display the ticket.

unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
   Abort("No permission to view ticket");
}


</%INIT>



<%ARGS>
$OnlySearchForPeople => undef
$UserField => undef
$UserOp => undef
$UserString => undef
$id => undef
</%ARGS>