Project

General

Profile

Defect #1507 » 1507-worktime-user-invalid.patch

Yuichi HARADA, 08/04/2020 09:42 AM

View differences:

app/controllers/work_time_controller.rb
781 781
              append_text += " add time entry of ##{issue.id.to_s}: #{tm_vals[:hours].to_f}h"
782 782
              update_daily_memo(append_text, true)
783 783
            end
784
            new_entry = TimeEntry.new(:project => issue.project, :issue => issue, :user => @this_user, :spent_on => @this_date)
784
            new_entry = TimeEntry.new(:project => issue.project, :issue => issue, :user => @this_user, :author => User.current, :spent_on => @this_date)
785 785
            new_entry.safe_attributes = tm_vals
786 786
            new_entry.save
787 787
            append_error_message_html(@message, hour_update_check_error(new_entry, issue_id))
app/views/work_time/_user_day_table.html.erb
147 147
    <%= text_field_tag("new_time_entry["+issue_id.to_s+"][0][comments]", "", :size=>80)%>
148 148
  </td>
149 149
  <%if @custom_fields.length != 0
150
      dummy_hour = TimeEntry.new(:project => issue.project, :issue => issue, :user => @this_user, :spent_on => @this_date)
150
      dummy_hour = TimeEntry.new(:project => issue.project, :issue => issue, :user => @this_user, :author => User.current, :spent_on => @this_date)
151 151
      dummy_hour.custom_field_values.each do |cfv|
152 152
  %>
153 153
     <td><%= custom_field_tag "new_time_entry_"+issue_id.to_s+"_0", cfv %></td>
app/views/work_time/ajax_add_tickets_insert.html.erb
63 63
    <%= text_field_tag("new_time_entry["+@add_issue_id+"]["+@add_count+"][comments]", "", :size=>80)%>
64 64
  </td>
65 65
  <%if @custom_fields.length != 0
66
      dummy_hour = TimeEntry.new(:project => @add_issue.project, :issue => @add_issue, :user => @this_user, :spent_on => @this_date)
66
      dummy_hour = TimeEntry.new(:project => @add_issue.project, :issue => @add_issue, :user => @this_user, :author => User.current, :spent_on => @this_date)
67 67
      dummy_hour.custom_field_values.each do |cfv|
68 68
  %>
69 69
     <td><%= custom_field_tag "new_time_entry_"+@add_issue_id+"_"+@add_count, cfv %></td>
(2-2/2)