%# Legalize free-enterprise murder: why should governments have all the fun?
<tr> 
  <td bgcolor="#333333" height="2" colspan="2"></td>
</tr>
<tr bgcolor="#3798AC" valign="bottom"> 
  <td colspan="2"><b><font color="#FFFFFF" size="3"><&|/l&>Approval</&></font></b></td>
</tr>
<tr> 
  <td bgcolor="#333333" height="1" colspan="2"></td>
</tr>
<& /Work/Tickets/Elements/ShowHistory, 
      Ticket => $Approval, 
      Collapsed => 0,
      ShowHeaders => 0,
      ShowTitle => 0,
      UserOnly => 1,
      ActionOnly => $RT::OIN104 &>
<tr> 
  <td height="20" colspan="2"> 
    <table width="100%" border="0" cellspacing="1" cellpadding="2">
      <tr> 
        <td class="tableTitle" height="44" width="7%"><&|/l&>Approver</&></td>
        <td bgcolor="#FFFFFF" height="44" width="10%" class="poptable"> 
          <div align="center"><% $session{CurrentUser}->UserObj->Name %></div>
        </td>
        <td rowspan="2" class="tableTitle" height="44" width="8%"><&|/l&>Approval Status</&></td>
        <td rowspan="2" bgcolor="#FFFFFF" height="44" width="10%" class="poptable"> 
% foreach my $action (qw(Approve Deny None)) {
	    <label>
            <input type="radio"
		id="Approval-<% $Approval->Id %>-Action"
		name="Approval-<% $Approval->Id %>-Action"
		value="<% $action %>"
		<% ($OwnerObj and $action ne 'Approve') ? 'disabled' : '' %>
		<% ($action eq 'Approve') ? 'checked' : '' %>
%     if ($ShowActions) {
		onclick="document.getElementById('BottomObj').focus();
		document.getElementById('Submit-Approve').focus();"
%     }
	    >
            <% loc(($action eq 'None') ? 'No action' : $action) %>
	    </label><br>
% }
        </td>
% if ($OwnerObj) {
<script><!--
document.getElementById("Approval-<% $Approval->Id %>-Action").checked = 1;
--></script>
% }
        <td rowspan="2" class="tableTitle" height="44" width="9%"><&|/l&>Approval Notes</&></td>
        <td rowspan="2" bgcolor="#FFFFFF" height="44" width="52%" class="poptable"> 
          <div align="center"> 
            <textarea name="Approval-<% $Approval->Id %>-Content" rows="3" style="width:100%"></textarea>
          </div>
        </td>
      </tr>
      <tr> 
        <td class="tableTitle" height="44" width="7%">
	<input type="button" value="<&|/l&>Transfer to</&>" onclick="<& /Edit/Elements/NewWindow, "/Work/Approvals/Add.html?IsWork=1&Id=$id&CurrentUser=" . $session{CurrentUser}->Id, 290, 430 &>">
	</td>
        <td bgcolor="#FFFFFF" height="44" width="10%" class="poptable"> 
          <div align="center">
	  <input type="hidden" name="Approval-<% $Approval->Id %>-Owner" value="<% $Owner %>">

	  <input value="<% $OwnerObj ? $OwnerObj->Name : '' %>" class="wro" readonly type="text" name="OwnerName" size="30" style="width:100%; border: none; text-align: center">
	  </div>
        </td>
      </tr>
    </table>
  </td>
</tr>
<tr> 
  <td bgcolor="#333333" height="1" colspan="2"></td>
</tr>
<%INIT>
my ($Owner, $OwnerObj);
my $id = $Approval->Id;
if ($Owner = $session{"Approval-$id-Owner"}) {
    $OwnerObj = RT::User->new($session{CurrentUser});
    $OwnerObj->Load($Owner) or $Owner = $OwnerObj = undef;
}
</%INIT>
<%ARGS>
$Approval
$ShowActions => 1
</%ARGS>
