Fixed handling of customers without a short name.
This commit is contained in:
parent
9703b27d6f
commit
edc86f8913
12
stoptime.rb
12
stoptime.rb
|
@ -773,7 +773,9 @@ module StopTime::Controllers
|
||||||
# the timeline using Views#time_entries
|
# the timeline using Views#time_entries
|
||||||
def get
|
def get
|
||||||
@time_entries = TimeEntry.all(:order => "start DESC")
|
@time_entries = TimeEntry.all(:order => "start DESC")
|
||||||
@customer_list = Customer.all.map { |c| [c.id, c.short_name] }
|
@customer_list = Customer.all.map do |c|
|
||||||
|
[c.id, c.short_name.present? ? c.short_name : c.name]
|
||||||
|
end
|
||||||
@task_list = Task.all.reject { |t| t.billed? }.map do |t|
|
@task_list = Task.all.reject { |t| t.billed? }.map do |t|
|
||||||
[t.id, t.name]
|
[t.id, t.name]
|
||||||
end
|
end
|
||||||
|
@ -812,7 +814,9 @@ module StopTime::Controllers
|
||||||
# and time for prefilling a form (Views#time_entry_form) for quickly
|
# and time for prefilling a form (Views#time_entry_form) for quickly
|
||||||
# registering time.
|
# registering time.
|
||||||
def get
|
def get
|
||||||
@customer_list = Customer.all.map { |c| [c.id, c.short_name] }
|
@customer_list = Customer.all.map do |c|
|
||||||
|
[c.id, c.short_name.present? ? c.short_name : c.name]
|
||||||
|
end
|
||||||
@task_list = Task.all.reject { |t| t.billed? }.map do |t|
|
@task_list = Task.all.reject { |t| t.billed? }.map do |t|
|
||||||
[t.id, t.name]
|
[t.id, t.name]
|
||||||
end
|
end
|
||||||
|
@ -840,7 +844,9 @@ module StopTime::Controllers
|
||||||
@input = @time_entry.attributes
|
@input = @time_entry.attributes
|
||||||
@input["customer"] = @time_entry.task.customer.id
|
@input["customer"] = @time_entry.task.customer.id
|
||||||
@input["task"] = @time_entry.task.id
|
@input["task"] = @time_entry.task.id
|
||||||
@customer_list = Customer.all.map { |c| [c.id, c.short_name] }
|
@customer_list = Customer.all.map do |c|
|
||||||
|
[c.id, c.short_name.present? ? c.short_name : c.name]
|
||||||
|
end
|
||||||
@task_list = Task.all.reject { |t| t.billed? }.map do |t|
|
@task_list = Task.all.reject { |t| t.billed? }.map do |t|
|
||||||
[t.id, t.name]
|
[t.id, t.name]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user