diff --git a/app/models/issue.rb b/app/models/issue.rb index 827c6f70e..23cc71f7c 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -42,6 +42,7 @@ class Issue < ActiveRecord::Base validates_presence_of :subject, :description, :priority, :tracker, :author, :status validates_length_of :subject, :maximum => 255 validates_inclusion_of :done_ratio, :in => 0..100 + validates_numericality_of :estimated_hours, :allow_nil => true validates_associated :custom_values, :on => :update # set default status for new issues diff --git a/app/views/issues/edit.rhtml b/app/views/issues/edit.rhtml index f131041ed..53ffd7f6c 100644 --- a/app/views/issues/edit.rhtml +++ b/app/views/issues/edit.rhtml @@ -18,6 +18,7 @@
<%= f.text_field :start_date, :size => 10 %><%= calendar_for('issue_start_date') %>
<%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %>
+<%= f.text_field :estimated_hours, :size => 3 %> <%= l(:field_hours) %>
<%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %>
<%=l(:field_status)%> : | <%= @issue.status.name %> | -<%=l(:field_priority)%> : | <%= @issue.priority.name %> | +<%=l(:field_start_date)%> : | <%= format_date(@issue.start_date) %> |
<%=l(:field_assigned_to)%> : | <%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %> | -<%=l(:field_category)%> : | <%=h @issue.category ? @issue.category.name : "-" %> | -||
<%=l(:field_author)%> : | <%= link_to_user @issue.author %> | -<%=l(:field_start_date)%> : | <%= format_date(@issue.start_date) %> | -||
<%=l(:field_created_on)%> : | <%= format_date(@issue.created_on) %> | +<%=l(:field_priority)%> : | <%= @issue.priority.name %> | <%=l(:field_due_date)%> : | <%= format_date(@issue.due_date) %> |
<%=l(:field_updated_on)%> : | <%= format_date(@issue.updated_on) %> | +<%=l(:field_assigned_to)%> : | <%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %> | <%=l(:field_done_ratio)%> : | <%= @issue.done_ratio %> % |
<%=l(:field_fixed_version)%> : | <%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %> | +<%=l(:field_category)%> : | <%=h @issue.category ? @issue.category.name : "-" %> | + <% if User.current.allowed_to?(:view_time_entries, @project) %><%=l(:label_spent_time)%> : | <%= @issue.spent_hours > 0 ? (link_to lwr(:label_f_hour, @issue.spent_hours), {:controller => 'timelog', :action => 'details', :issue_id => @issue}, :class => 'icon icon-time') : "-" %> | + <% end %> +
<%=l(:field_fixed_version)%> : | <%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %> | + <% if @issue.estimated_hours %> +<%=l(:field_estimated_hours)%> : | <%= lwr(:label_f_hour, @issue.estimated_hours) %> | + <% end %>||