Added comments to time entries.

This commit is contained in:
Paul van Tilburg 2011-11-03 22:23:50 +01:00
parent 0489d7e3cd
commit 8f2eff9410
2 changed files with 17 additions and 5 deletions

1
TODO
View File

@ -1,7 +1,6 @@
ToDo ToDo
==== ====
* commentaar bij entries
* handmatige entries (gekocht item/opdrachtbasis) op factuur * handmatige entries (gekocht item/opdrachtbasis) op factuur
* factureervlag per entry * factureervlag per entry
* factuur vastleggen, met samenvatting commentaar * factuur vastleggen, met samenvatting commentaar

View File

@ -79,7 +79,6 @@ module StopTime::Models
class TimeEntry < Base class TimeEntry < Base
belongs_to :task belongs_to :task
end end
class StopTimeTables < V 1.0 class StopTimeTables < V 1.0
@ -109,7 +108,17 @@ module StopTime::Models
end end
end end
end # module StopTime::Models class CommentSupport < V 1.1
def self.up
add_column(TimeEntry.table_name, :comment, :string)
end
def self.down
remove_column(TimeEntry.table_name, :comment)
end
end
end # StopTime::Models
module StopTime::Controllers module StopTime::Controllers
@ -247,7 +256,8 @@ module StopTime::Controllers
@entry = TimeEntry.create( @entry = TimeEntry.create(
:task_id => @input.task, :task_id => @input.task,
:start => @input.start, :start => @input.start,
:end => @input.end) :end => @input.end,
:comment => @input.comment)
@entry.save @entry.save
if @entry.invalid? if @entry.invalid?
@errors = @entry.errors @errors = @entry.errors
@ -335,7 +345,8 @@ module StopTime::Views
th "Project/task" th "Project/task"
th "Start time" th "Start time"
th "End time" th "End time"
th "Total" th "Comment"
th "Total time"
end end
form :action => R(Timereg), :method => :post do form :action => R(Timereg), :method => :post do
tr do tr do
@ -345,6 +356,7 @@ module StopTime::Views
:value => DateTime.now.to_date.to_formatted_s + " " } :value => DateTime.now.to_date.to_formatted_s + " " }
td { input :type => :text, :name => "end", td { input :type => :text, :name => "end",
:value => DateTime.now.to_date.to_formatted_s + " " } :value => DateTime.now.to_date.to_formatted_s + " " }
td { input :type => :text, :name => "comment" }
td { "N/A" } td { "N/A" }
td do td do
input :type => :submit, :name => "enter", :value => "Enter" input :type => :submit, :name => "enter", :value => "Enter"
@ -358,6 +370,7 @@ module StopTime::Views
td { entry.task.name } td { entry.task.name }
td { entry.start } td { entry.start }
td { entry.end } td { entry.end }
td { entry.comment }
td { "%.2fh" % ((entry.end - entry.start)/3600.0) } td { "%.2fh" % ((entry.end - entry.start)/3600.0) }
td do td do
form :action => R(TimeregN, entry.id), :method => :post do form :action => R(TimeregN, entry.id), :method => :post do