annotate .svn/pristine/b0/b0dd7f2e6e380d76ce0d76b315917633345e67d4.svn-base @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents 622f24f53b42
children
rev   line source
Chris@1295 1 <div class="contextual">
Chris@1295 2 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'new', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %>
Chris@1295 3 </div>
Chris@1295 4
Chris@1295 5 <%= render_timelog_breadcrumb %>
Chris@1295 6
Chris@1295 7 <h2><%= l(:label_spent_time) %></h2>
Chris@1295 8
Chris@1295 9 <%= form_tag({:controller => 'timelog', :action => 'report',
Chris@1295 10 :project_id => @project, :issue_id => @issue},
Chris@1295 11 :method => :get, :id => 'query_form') do %>
Chris@1295 12 <% @report.criteria.each do |criterion| %>
Chris@1295 13 <%= hidden_field_tag 'criteria[]', criterion, :id => nil %>
Chris@1295 14 <% end %>
Chris@1295 15 <%= render :partial => 'timelog/date_range' %>
Chris@1295 16
Chris@1295 17 <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
Chris@1295 18 [l(:label_month), 'month'],
Chris@1295 19 [l(:label_week), 'week'],
Chris@1295 20 [l(:label_day_plural).titleize, 'day']], @report.columns),
Chris@1295 21 :onchange => "this.form.submit();" %>
Chris@1295 22
Chris@1295 23 <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criteria[]', options_for_select([[]] + (@report.available_criteria.keys - @report.criteria).collect{|k| [l_or_humanize(@report.available_criteria[k][:label]), k]}),
Chris@1295 24 :onchange => "this.form.submit();",
Chris@1295 25 :style => 'width: 200px',
Chris@1295 26 :id => nil,
Chris@1295 27 :disabled => (@report.criteria.length >= 3), :id => "criterias") %>
Chris@1295 28 <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @report.columns}, :class => 'icon icon-reload' %></p>
Chris@1295 29 <% end %>
Chris@1295 30
Chris@1295 31 <% unless @report.criteria.empty? %>
Chris@1295 32 <div class="total-hours">
Chris@1295 33 <p><%= l(:label_total) %>: <%= html_hours(l_hours(@report.total_hours)) %></p>
Chris@1295 34 </div>
Chris@1295 35
Chris@1295 36 <% unless @report.hours.empty? %>
Chris@1295 37 <div class="autoscroll">
Chris@1295 38 <table class="list" id="time-report">
Chris@1295 39 <thead>
Chris@1295 40 <tr>
Chris@1295 41 <% @report.criteria.each do |criteria| %>
Chris@1295 42 <th><%= l_or_humanize(@report.available_criteria[criteria][:label]) %></th>
Chris@1295 43 <% end %>
Chris@1295 44 <% columns_width = (40 / (@report.periods.length+1)).to_i %>
Chris@1295 45 <% @report.periods.each do |period| %>
Chris@1295 46 <th class="period" width="<%= columns_width %>%"><%= period %></th>
Chris@1295 47 <% end %>
Chris@1295 48 <th class="total" width="<%= columns_width %>%"><%= l(:label_total) %></th>
Chris@1295 49 </tr>
Chris@1295 50 </thead>
Chris@1295 51 <tbody>
Chris@1295 52 <%= render :partial => 'report_criteria', :locals => {:criterias => @report.criteria, :hours => @report.hours, :level => 0} %>
Chris@1295 53 <tr class="total">
Chris@1295 54 <td><%= l(:label_total) %></td>
Chris@1295 55 <%= ('<td></td>' * (@report.criteria.size - 1)).html_safe %>
Chris@1295 56 <% total = 0 -%>
Chris@1295 57 <% @report.periods.each do |period| -%>
Chris@1295 58 <% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%>
Chris@1295 59 <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td>
Chris@1295 60 <% end -%>
Chris@1295 61 <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td>
Chris@1295 62 </tr>
Chris@1295 63 </tbody>
Chris@1295 64 </table>
Chris@1295 65 </div>
Chris@1295 66
Chris@1295 67 <% other_formats_links do |f| %>
Chris@1295 68 <%= f.link_to 'CSV', :url => params %>
Chris@1295 69 <% end %>
Chris@1295 70 <% end %>
Chris@1295 71 <% end %>
Chris@1295 72
Chris@1295 73 <% html_title l(:label_spent_time), l(:label_report) %>
Chris@1295 74