<& /Elements/Header, Title=> $title  &>
<& /Ticket/Elements/Tabs, Ticket => $Ticket &>
<& /Elements/TitleBoxStart, title => $title &>

<FORM ACTION="Display.html" NAME="TicketUpdate" 
	METHOD=POST enctype="multipart/form-data">

<TABLE>
<TR><TD>
<a href="ModifyPeople.html?id=<%$Ticket->Id%>">Ticket watchers</A></TD><TD align=right>
Requestor:
</TD><TD>
<b><% $Ticket->RequestorsAsString %></b>
</TD></TR>
<TR><TD>&nbsp;</TD><TD align=right>
Cc:
</TD><TD>
<b><% $Ticket->CcAsString %></b>
</TD></TR>
<TR><TD>&nbsp;</TD><TD align=right>
AdminCc:
</TD><TD>
<b><% $Ticket->AdminCcAsString %></b>
</TD></TR>
<TR><TD>Queue watchers</TD><TD align=right>
Cc:
</TD><TD>
<b><% $Ticket->QueueObj->CcAsString %></b>
</TD></TR>
<TR><TD>&nbsp;</TD><TD align=right>
AdminCc: 
</TD><TD>
<b><% $Ticket->QueueObj->AdminCcAsString %></b>
</TD>
</TR>
</TABLE>


<hr>

Update Type: <select name="UpdateType">
% if ($CanComment) {
  <option value="private" <%$CommentDefault%>>Comments (Not sent to requestors)</option>
% }
% if ($CanRespond) {
   <option value="response" <%$ResponseDefault%>>Response to requestors</option>
% }
	  </select> 
	  <br>

Status:
<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
Owner:  
<& /Elements/SelectOwner, Name=>"Owner", Default => $Ticket->OwnerObj->Id(), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &>
Worked: 
<input size=4 name="UpdateTimeWorked"> minutes<BR>
Subject: <input name="UpdateSubject" size=60 value="<%$Ticket->Subject()%>"> <br>
Attach: <input name="UpdateAttachment" type="file"> <br>
<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
		<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>




<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
  </FORM>



<%INIT>

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

my $Ticket = LoadTicket($id);


if ($DefaultStatus eq 'resolved') {
	$title = "Resolve";
} else {
	$title = "Update";
}

$title .= " ticket #" . $Ticket->id . " (" .$Ticket->Subject.")";

# Things needed in the template - we'll do the processing here, just
# for the convinience:
my $CommentDefault=$Action eq "Comment" ? "SELECTED" : "";
my $ResponseDefault=$Action eq "Respond" ? "SELECTED" : "";

$DefaultStatus = $Ticket->Status() unless ($DefaultStatus);

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

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

     
     

</%INIT>

<%ARGS>
$id => undef
$Action => undef
$DefaultStatus => undef
</%ARGS>
