<%if @add_issue then%>
<tr style="background:#ddf;" id="time_entry_pos<%=@add_issue_id%>_<%=@add_count%>">
  <td>
  <div style="position:relative;width:300px;">
    <%=@add_issue.project.name%>
    <br/>
    <%= link_to(@issueHtml.html_safe, {:controller=>"issues", :action=>"show", :id=>@add_issue.id},
                :popup=>true, :class=>'wt_iss_link', :'data-issue'=>@add_issue.id) %>
    <%= print_issue_cost(@add_issue) %>
    <%if User.current.allowed_to?(:edit_issues, @add_issue.project)%>
        <a name="<%='done_ratio'+@add_issue.id.to_s%>"
           class="wt_done_ratio"
           data-issue="<%= @add_issue.id %>"
           href="#"
           onclick="JavaScript:
                   input_done_ratio(
                           '<%=url_for(@link_params.merge(:action=>"ajax_done_ratio_input"))%>',
                           <%=@add_issue.id%>);
                   return false;">
          [<%=@add_issue.done_ratio%>&#37;]
        </a>
    <%else%>
        [<%=@add_issue.done_ratio%>&#37;]
    <%end%>

    <a style="position:absolute;bottom:1px;right:10px;"
       href="#"
       onclick="JavaScript:
         dup_ticket(
           '<%=url_for(@link_params.merge(:action=>"ajax_add_tickets_insert"))%>',
           'time_entry_pos<%=@add_issue_id%>_<%=@add_count%>',
           <%=@add_issue.id%>);
         return false;">
      +
    </a>
  </div>
  </td>
  <td>
    <%= text_field_tag("new_time_entry["+@add_issue_id+"]["+@add_count+"][hours]", "", :size=>5, :oninput => "sumDayTimes()") %>
  </td>
  <% if @is_registerd_backlog then %>
  <td>
    <% if @add_issue_children_cnt != 0 || @add_issue.closed? then %>
      <%= @add_issue.remaining_hours %>
    <% else %>
        <%= text_field_tag("new_time_entry["+@add_issue_id+"]["+@add_count+"][remaining_hours]", @add_issue.remaining_hours, :size=>5, :oninput => "sumDayTimes()") %>
    <% end %>
  </td>
  <% end %>
  <td>
    <%= select_tag "new_time_entry["+@add_issue_id+"]["+@add_count+"][activity_id]", options_for_select(@activities,@activity_default), :required => true %>
  </td>
  <td>
  <%
    if @add_issue.new_statuses_allowed_to(User.current).length == 0
  %>
     <%= @add_issue.status %>
  <% else %>
    <%= select_tag "new_time_entry["+@add_issue_id.to_s+"][0][status_id]", options_for_select(@add_issue.new_statuses_allowed_to(User.current), @add_issue.status), :required => true %>
  <% end %>
  </td>
  <td>
    <%= text_field_tag("new_time_entry["+@add_issue_id+"]["+@add_count+"][comments]", "", :size=>80)%>
  </td>
  <%if @custom_fields.length != 0
      dummy_hour = TimeEntry.new(:project => @add_issue.project, :issue => @add_issue, :user => @this_user, :spent_on => @this_date)
      dummy_hour.custom_field_values.each do |cfv|
  %>
     <td><%= custom_field_tag "new_time_entry_"+@add_issue_id+"_"+@add_count, cfv %></td>
      <%end end%>
</tr>
<%end%>
