Add predefined date ranges to the time report in the same way as the details view (closes #972). It nows defaults to 'All time'.
This patch also fixes time report periods (columns) computation. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1318 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<fieldset><legend><%= l(:label_date_range) %></legend>
|
||||
<p>
|
||||
<%= radio_button_tag 'period_type', '1', !@free_period %>
|
||||
<%= select_tag 'period', options_for_period_select(params[:period]),
|
||||
:onchange => 'this.form.onsubmit();',
|
||||
:onfocus => '$("period_type_1").checked = true;' %>
|
||||
</p>
|
||||
<p>
|
||||
<%= radio_button_tag 'period_type', '2', @free_period %>
|
||||
<%= l(:label_date_from) %>
|
||||
<%= text_field_tag 'from', @from, :size => 10, :onfocus => '$("period_type_2").checked = true;' %> <%= calendar_for('from') %>
|
||||
<%= l(:label_date_to) %>
|
||||
<%= text_field_tag 'to', @to, :size => 10, :onfocus => '$("period_type_2").checked = true;' %> <%= calendar_for('to') %>
|
||||
<%= submit_tag l(:button_apply), :name => nil, :onclick => '$("period_type_2").checked = true;' %>
|
||||
</p>
|
||||
</fieldset>
|
||||
@@ -12,23 +12,7 @@
|
||||
<% form_remote_tag( :url => {}, :method => :get, :update => 'content' ) do %>
|
||||
<%= hidden_field_tag 'project_id', params[:project_id] %>
|
||||
<%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
|
||||
|
||||
<fieldset><legend><%= l(:label_date_range) %></legend>
|
||||
<p>
|
||||
<%= radio_button_tag 'period_type', '1', !@free_period %>
|
||||
<%= select_tag 'period', options_for_period_select(params[:period]),
|
||||
:onchange => 'this.form.onsubmit();',
|
||||
:onfocus => '$("period_type_1").checked = true;' %>
|
||||
</p>
|
||||
<p>
|
||||
<%= radio_button_tag 'period_type', '2', @free_period %>
|
||||
<%= l(:label_date_from) %>
|
||||
<%= text_field_tag 'from', @from, :size => 10, :onfocus => '$("period_type_2").checked = true;' %> <%= calendar_for('from') %>
|
||||
<%= l(:label_date_to) %>
|
||||
<%= text_field_tag 'to', @to, :size => 10, :onfocus => '$("period_type_2").checked = true;' %> <%= calendar_for('to') %>
|
||||
<%= submit_tag l(:button_apply), :name => nil, :onclick => '$("period_type_2").checked = true;' %>
|
||||
</p>
|
||||
</fieldset>
|
||||
<%= render :partial => 'date_range' %>
|
||||
<% end %>
|
||||
|
||||
<div class="total-hours">
|
||||
|
||||
@@ -5,32 +5,27 @@
|
||||
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<% form_remote_tag(:url => {:project_id => @project}, :update => 'content') do %>
|
||||
<% form_remote_tag(:url => {}, :update => 'content') do %>
|
||||
<% @criterias.each do |criteria| %>
|
||||
<%= hidden_field_tag 'criterias[]', criteria %>
|
||||
<% end %>
|
||||
<fieldset><legend><%= l(:label_date_range) %></legend>
|
||||
<p>
|
||||
<%= l(:label_date_from) %>
|
||||
<%= text_field_tag 'date_from', @date_from, :size => 10 %><%= calendar_for('date_from') %>
|
||||
<%= l(:label_date_to) %>
|
||||
<%= text_field_tag 'date_to', @date_to, :size => 10 %><%= calendar_for('date_to') %>
|
||||
<%= l(:label_details) %>
|
||||
<%= select_tag 'period', options_for_select([[l(:label_year), 'year'],
|
||||
[l(:label_month), 'month'],
|
||||
[l(:label_week), 'week']], @columns) %>
|
||||
|
||||
<%= submit_tag l(:button_apply) %>
|
||||
<%= hidden_field_tag 'project_id', params[:project_id] %>
|
||||
<%= render :partial => 'date_range' %>
|
||||
</p>
|
||||
</fieldset>
|
||||
<p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
|
||||
[l(:label_month), 'month'],
|
||||
[l(:label_week), 'week']], @columns),
|
||||
:onchange => "this.form.onsubmit();" %>
|
||||
|
||||
<p><%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l(@available_criterias[k][:label]), k]}),
|
||||
<%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l(@available_criterias[k][:label]), k]}),
|
||||
:onchange => "this.form.onsubmit();",
|
||||
:style => 'width: 200px',
|
||||
:disabled => (@criterias.length >= 3)) %>
|
||||
<%= link_to_remote l(:button_clear), {:url => {:project_id => @project, :date_from => @date_from, :date_to => @date_to, :period => @columns}, :update => 'content'},
|
||||
:class => 'icon icon-reload' %></p>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% unless @criterias.empty? %>
|
||||
<div class="total-hours">
|
||||
<p><%= l(:label_total) %>: <%= html_hours(lwr(:label_f_hour, @total_hours)) %></p>
|
||||
@@ -62,4 +57,3 @@
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user