Patch #221 ยป timelog_comments.patch
| app/models/time_entry.rb (working copy) | ||
|---|---|---|
|
|
||
|
attr_protected :project_id, :user_id, :tyear, :tmonth, :tweek
|
||
|
|
||
|
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on
|
||
|
validates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_on, :comments
|
||
|
validates_numericality_of :hours, :allow_nil => true
|
||
|
validates_length_of :comments, :maximum => 255
|
||
|
def before_validation
|
||
|
self.project = issue.project if issue && project.nil?
|
||
| app/views/timelog/details.rhtml (working copy) | ||
|---|---|---|
|
</div>
|
||
|
<% end %>
|
||
|
</td>
|
||
|
<td><%=h entry.comments %></td>
|
||
|
<td><%= textilizable entry.comments %></td>
|
||
|
<td align="center"><strong><%= entry.hours %></strong></td>
|
||
|
<td align="center"><%= link_to_if_authorized(l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => entry}, :class => "icon icon-edit") if entry.user_id == @owner_id %></td>
|
||
|
</tr>
|
||
| app/views/timelog/edit.rhtml (working copy) | ||
|---|---|---|
|
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
|
||
|
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
|
||
|
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
|
||
|
<p><%= f.text_field :comments, :size => 100 %></p>
|
||
|
<p><%= f.text_area :comments, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit' %></p>
|
||
|
<p><%= f.select :activity_id, (@activities.collect {|p| [p.name, p.id]}), :required => true %></p>
|
||
|
</div>
|
||
|
|
||
| ... | ... | |
|
<%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %>
|
||
|
<%= javascript_include_tag 'calendar/calendar-setup' %>
|
||
|
<%= stylesheet_link_tag 'calendar' %>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= wikitoolbar_for 'time_entry_comments' %>
|
||
| db/migrate/058_change_time_entries_comments.rb (revision 0) | ||
|---|---|---|
|
class ChangeTimeEntriesComments < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
change_column :time_entries, :comments, :text, :default => nil
|
||
|
end
|
||
|
def self.down
|
||
|
raise IrreversibleMigration
|
||
|
end
|
||
|
end
|
||