<%=javascript_include_tag 'work_time', :plugin=>'redmine_work_time' %> <%=stylesheet_link_tag 'work_time', :plugin => 'redmine_work_time' %> <%= @message.html_safe %>
<%= render :partial=>'select_project' %>
[<%= link_to(l(:wt_each_member_report), @link_params.merge(:action=>"show")) %>] [<%= link_to(l(:wt_raw_total), @link_params.merge(:action=>"total")) %>] [<%= link_to(l(:wt_relay_total), @link_params.merge(:action=>"relay_total")) %>]
<% ###################################################### チケット関係テーブルの表示 %>

<%=l(:wt_edit_relay)%> <%= link_to("<<", @link_params.merge(:day=>@last_month.day, :month=>@last_month.month, :year=>@last_month.year))%> <%= @first_date.strftime("%Y/%m/%d") %> - <%= @last_date.strftime("%Y/%m/%d") %> <%= link_to(">>", @link_params.merge(:day=>@next_month.day, :month=>@next_month.month, :year=>@next_month.year))%>

<% prjs = WtProjectOrders.where("uid=-1").order("dsp_pos").all tickets = WtTicketRelay.order("position").all tic_max = tickets.size prjs.each do |po| dsp_prj = po.dsp_prj dsp_pos = po.dsp_pos next if (!@prj_cost.has_key?(dsp_prj) || @prj_cost[dsp_prj][-1]==0.0) && (!@r_prj_cost.has_key?(dsp_prj) || @r_prj_cost[dsp_prj][-1]==0.0) prj =Project.find_by_id(dsp_prj) %> <% tic_num = 0 tickets.each do |tic| issue_id = tic.issue_id tic_num += 1 if tic.position != tic_num then # 番号が間違っていたらつけなおし tic.position = tic_num; tic.save end # 当該チケットに集計が無かったらスキップ next unless @issue_cost.has_key?(issue_id) || @r_issue_cost.has_key?(issue_id) issue = Issue.find_by_id(issue_id) parent_id = "" next if issue.nil? # チケットが削除されていたらパス next if issue.project_id != dsp_prj if tic.parent && tic.parent != 0 then parent = Issue.find_by_id(tic.parent) if parent.nil? then parentHtml = "Issue:"+tic.parent.to_s+"" else parent_id = parent.id parentHtml = parent.closed? ? ""+parent.to_s+"" : parent.to_s end else parentHtml = "" end if @issue_cost.key?(issue_id) && @issue_cost[issue_id].key?(-1) && @issue_cost[issue_id][-1]!=0 then cost=sprintf("%.2f",@issue_cost[issue_id][-1]) else cost=" " end if @r_issue_cost.key?(issue_id) && @r_issue_cost[issue_id].key?(-1) && @r_issue_cost[issue_id][-1]!=0 then r_cost=sprintf("%.2f",@r_issue_cost[issue_id][-1]) else r_cost=" " end %> <% end end %> <% if @prj_cost.has_key?(-1) || @r_prj_cost.has_key?(-1) then%> <% end %>
<%if User.current.allowed_to?(:edit_work_time_total, @project) then%> <%=dsp_pos%>: <%end%> <%=prj.name%> <%if @prj_cost.has_key?(dsp_prj) && @prj_cost[dsp_prj][-1]!=0%> <%=sprintf('%1.2f', @prj_cost[dsp_prj][-1])%> <%else%>   <%end%> <%if @r_prj_cost.has_key?(dsp_prj) && @r_prj_cost[dsp_prj][-1]!=0%> <%=sprintf('%1.2f', @r_prj_cost[dsp_prj][-1]) %> <%else%>   <%end%>  
<%if User.current.allowed_to?(:edit_work_time_total, @project) then%> <%=tic.position%> <%end%> <%= link_to(wk_pretty_issue_name(issue), {:controller=>"issues", :action=>"show", :id=>issue.id}, :popup=>true) %> <%= print_issue_cost(issue) %> <%=cost.html_safe%> <%=r_cost.html_safe%>
private <%if @prj_cost.has_key?(-1) then%> <%=sprintf('%1.2f', @prj_cost[-1][-1])%> <%else%>   <%end%> <%if @r_prj_cost.has_key?(-1) then%> <%=sprintf('%1.2f', @r_prj_cost[-1][-1]) if @r_prj_cost[-1][-1]%> <%else%>   <%end%>  
<%= submit_tag(l('wt_bulkupdate_relations'), {:type => 'button', :onclick => "set_ticket_relay_by_issue_relation('#{url_for(:action=>'ajax_relay', :parent_id=>-1)}')".html_safe}) %>
<%= render :partial=>'select_project' %>
[<%= link_to(l(:wt_each_member_report), @link_params.merge(:action=>"show")) %>] [<%= link_to(l(:wt_raw_total), @link_params.merge(:action=>"total")) %>] [<%= link_to(l(:wt_relay_total), @link_params.merge(:action=>"relay_total")) %>]