diff -urbBN redmine_schedules/app/controllers/schedules_controller.rb redmine_schedules-0.8.2/app/controllers/schedules_controller.rb --- redmine_schedules/app/controllers/schedules_controller.rb 2009-03-25 20:02:47.000000000 +0300 +++ redmine_schedules-0.8.2/app/controllers/schedules_controller.rb 2009-04-10 11:06:12.000000000 +0400 @@ -124,7 +124,7 @@ @date = Date.parse(params[:date]) if params[:date] @date ||= Date.civil(params[:year].to_i, params[:month].to_i, params[:day].to_i) if params[:year] && params[:month] && params[:day] @date ||= Date.today - @date = Date.civil(@date.year, @date.month, @date.day - @date.wday) if @user || @project + @date = Date.civil(@date.year, @date.month, @date.day) if @user || @project # Initialize the necessary helpers @calendar = Redmine::Helpers::Calendar.new(@date, current_language, :week) if @user.nil? || @project.nil? @@ -472,7 +472,7 @@ available_hours -= new_entry.hours restrictions = "date = '#{date}' AND user_id = #{user.id}" - available_hours -= ScheduleEntry.sum(:hours, :conditions => restrictions + " AND id <> #{old_entry.id}") if available_hours >= 0 + available_hours -= ScheduleEntry.sum(:hours, :conditions => old_entry.nil? ? restrictions : restrictions + " AND id <> #{old_entry.id}") if available_hours >= 0 closed_entry = ScheduleClosedEntry.find(:first, :conditions => restrictions) if available_hours >= 0 closed_hours = closed_entry.nil? ? 0 : closed_entry.hours @@ -670,7 +670,7 @@ while !@entries[issue.assigned_to.id].nil? && @entries[issue.assigned_to.id][considered_date].nil? && !@entries[issue.assigned_to.id].empty? && (considered_date < Date.today + 365) considered_date += 1 end - raise l(:error_schedules_estimate_insufficient_scheduling, :user => issue.assigned_to, :issue => issue) if @entries[issue.assigned_to.id][considered_date].nil? + raise l(:error_schedules_estimate_insufficient_scheduling, issue.assigned_to, issue) if @entries[issue.assigned_to.id][considered_date].nil? if hours_remaining > @entries[issue.assigned_to.id][considered_date].hours hours_remaining -= @entries[issue.assigned_to.id][considered_date].hours @entries[issue.assigned_to.id][considered_date].hours = 0 diff -urbBN redmine_schedules/app/views/schedules/_availability.html.erb redmine_schedules-0.8.2/app/views/schedules/_availability.html.erb --- redmine_schedules/app/views/schedules/_availability.html.erb 2009-03-25 20:02:47.000000000 +0300 +++ redmine_schedules-0.8.2/app/views/schedules/_availability.html.erb 2009-04-10 11:06:12.000000000 +0400 @@ -1,7 +1,7 @@ <% if hours > 0 && day %> <% entry = ScheduleEntry.new # TODO: Refactor method style method so this model faking isn't necessary %>
<%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %>
+<%= l(:label_total) %>: <%= @total_hours %>
<%= pagination_links_full @entry_pages, @entry_count %>
-<% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %> - <%= f.link_to 'CSV', :url => params %> -<% end %> <% end %> <% html_title l(:label_schedules_index), l(:label_details) %> diff -urbBN redmine_schedules/app/views/schedules/edit.html.erb redmine_schedules-0.8.2/app/views/schedules/edit.html.erb --- redmine_schedules/app/views/schedules/edit.html.erb 2009-03-25 20:02:47.000000000 +0300 +++ redmine_schedules-0.8.2/app/views/schedules/edit.html.erb 2009-04-10 11:06:12.000000000 +0400 @@ -3,9 +3,9 @@ <%= breadcrumb link_to(l(:label_schedules_index), {:controller => 'schedules', :action => 'index', :date => @date }) unless !@project.nil? || !@user.nil? %><%= "#{l(:label_date_from)} #{format_date(@calendar.startdt)} #{l(:label_date_to).downcase} #{format_date(@calendar.enddt)}" %>
diff -urbBN redmine_schedules/app/views/schedules/estimate.html.erb redmine_schedules-0.8.2/app/views/schedules/estimate.html.erb --- redmine_schedules/app/views/schedules/estimate.html.erb 2009-03-25 20:02:47.000000000 +0300 +++ redmine_schedules-0.8.2/app/views/schedules/estimate.html.erb 2009-04-10 11:06:12.000000000 +0400 @@ -19,11 +19,11 @@<%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %>
+<%= l(:label_total) %>: <%= @total_hours %>
| <%= l(:field_estimated_hours) %> | -<%= html_hours(l_hours(@version.estimated_hours)) %> | +<%= @version.estimated_hours %> |
| <%= l(:label_spent_time) %> | -<%= html_hours(l_hours(@version.spent_hours)) %> | +<%= @version.spent_hours %> |