Skip to content

Commit

Permalink
Implemented settings for enabling/disabling each of the five 'columns…
Browse files Browse the repository at this point in the history
…' on the issuelist bottom summary line. All 'columns' are enabled by default. Again, when a 'column' is disabled also its calculations are disabled, thus saving on requests/load. Provided english i18n-stubs for introduced i18n-symbols, for all other languages.
  • Loading branch information
MischaTheEvil committed Oct 26, 2011
1 parent b113c08 commit df9cded
Show file tree
Hide file tree
Showing 47 changed files with 323 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@
if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_on_issuelists'] == '1'
@issues.each do |issue|
if User.current.allowed_to?(:view_time_entries, issue.project)
estimated_hours += issue.estimated_hours ||0.0
spent_hours += issue.spent_hours ||0.0
calculated_spent_hours += issue.calculated_spent_hours ||0.0
divergent_hours += issue.divergent_hours ||0.0
remaining_hours += issue.remaining_hours ||0.0
if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_estimated_hours'] == '1'
estimated_hours += issue.estimated_hours ||0.0
end
if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_spent_hours'] == '1'
spent_hours += issue.spent_hours ||0.0
end
if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_calculated_spent_hours'] == '1'
calculated_spent_hours += issue.calculated_spent_hours ||0.0
end
if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_divergent_hours'] == '1'
divergent_hours += issue.divergent_hours ||0.0
end
if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_remaining_hours'] == '1'
remaining_hours += issue.remaining_hours ||0.0
end
else
allowed_to_view_time_entries = false if not User.current.admin?
break
Expand All @@ -18,11 +28,21 @@
%>
<% if allowed_to_view_time_entries && Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_on_issuelists'] == '1' -%>
<p class="other-formats">
<strong><%= t :field_estimated_hours %>:</strong> <%= estimated_hours.round(2) %>,
<strong><%= t :label_spent_time %>:</strong> <%= spent_hours.round(2) %>,
<strong><%= t :label_calculated_spent_hours %>:</strong> <%= calculated_spent_hours.round(2) %>,
<strong><%= t :label_divergent_hours %>:</strong> <%= divergent_hours.round(2) %>,
<strong><%= t :label_remaining_hours %>:</strong> <%= remaining_hours.round(2) %>
<% if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_estimated_hours'] == '1' -%>
<strong><%= t :field_estimated_hours %>:</strong> <%= estimated_hours.round(2) %>,
<% end -%>
<% if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_spent_hours'] == '1' -%>
<strong><%= t :label_spent_time %>:</strong> <%= spent_hours.round(2) %>,
<% end -%>
<% if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_calculated_spent_hours'] == '1' -%>
<strong><%= t :label_calculated_spent_hours %>:</strong> <%= calculated_spent_hours.round(2) %>,
<% end -%>
<% if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_divergent_hours'] == '1' -%>
<strong><%= t :label_divergent_hours %>:</strong> <%= divergent_hours.round(2) %>,
<% end -%>
<% if Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_remaining_hours'] == '1' -%>
<strong><%= t :label_remaining_hours %>:</strong> <%= remaining_hours.round(2) %>
<% end -%>
</p>
<% end -%>

Expand Down
26 changes: 24 additions & 2 deletions app/views/settings/_spent_time_column_settings.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
<fieldset>
<legend><%= l(:legend_general_settings) %></legend>
<legend><%= l(:legend_bottom_summary_line_settings) %></legend>
<p>
<label><%= l(:setting_show_bottom_summary_line_on_issuelists) %></label>
<%= check_box_tag 'settings[show_bottom_summary_line_on_issuelists]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_on_issuelists'] == '1' %>
<%= check_box_tag 'settings[show_bottom_summary_line_on_issuelists]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_on_issuelists'] == '1', :onclick=>"Element.toggle('bottom_summary_line_settings'); return true;" %>
</p>
<div id="bottom_summary_line_settings" <%= Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_on_issuelists'] == '1' ? '' : 'style="display:none"' %>>
<p>
<label><%= l(:setting_show_bottom_summary_line_estimated_hours) %></label>
<%= check_box_tag 'settings[show_bottom_summary_line_estimated_hours]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_estimated_hours'] == '1' %>
</p>
<p>
<label><%= l(:setting_show_bottom_summary_line_spent_hours) %></label>
<%= check_box_tag 'settings[show_bottom_summary_line_spent_hours]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_spent_hours'] == '1' %>
</p>
<p>
<label><%= l(:setting_show_bottom_summary_line_calculated_spent_hours) %></label>
<%= check_box_tag 'settings[show_bottom_summary_line_calculated_spent_hours]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_calculated_spent_hours'] == '1' %>
</p>
<p>
<label><%= l(:setting_show_bottom_summary_line_divergent_hours) %></label>
<%= check_box_tag 'settings[show_bottom_summary_line_divergent_hours]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_divergent_hours'] == '1' %>
</p>
<p>
<label><%= l(:setting_show_bottom_summary_line_remaining_hours) %></label>
<%= check_box_tag 'settings[show_bottom_summary_line_remaining_hours]', 1, Setting.plugin_redmine_spent_time_column['show_bottom_summary_line_remaining_hours'] == '1' %>
</p>
</div>
</fieldset>

<fieldset>
Expand Down
7 changes: 6 additions & 1 deletion config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/bs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Zeitabweichung
label_remaining_hours: Verbleibende Zeit
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ en:
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/eu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
7 changes: 6 additions & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
label_divergent_hours: Divergent time
label_remaining_hours: Remaining time
setting_show_bottom_summary_line_on_issuelists: Display bottom summary line on issuelists
setting_show_bottom_summary_line_estimated_hours: Show Estimated time
setting_show_bottom_summary_line_spent_hours: Show Spent time
setting_show_bottom_summary_line_calculated_spent_hours: Show Calculated spent time
setting_show_bottom_summary_line_divergent_hours: Show Divergent time
setting_show_bottom_summary_line_remaining_hours: Show Remaining time
setting_enable_spent_hours_column: Enable Spent time column
setting_enable_calculated_spent_hours_column: Enable Calculated spent time column
setting_enable_divergent_hours_column: Enable Divergent time column
setting_enable_remaining_hours_column: Enable Remaining time column
legend_general_settings: General settings
legend_bottom_summary_line_settings: Bottom summary line settings
legend_column_settings: Column settings
Loading

0 comments on commit df9cded

Please sign in to comment.