Skip to content

Commit c200487

Browse files
svenweyKagemaru
authored andcommitted
add internal desciptions to worktimes
these internal descriptions are displayed in puzzletime, and in the csv export, but not in the time rapport
1 parent 3f52ac2 commit c200487

File tree

10 files changed

+91
-84
lines changed

10 files changed

+91
-84
lines changed

app/controllers/concerns/worktimes_csv.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def send_worktimes_csv(worktimes, filename)
2020
def worktimes_csv(worktimes)
2121
CSV.generate do |csv|
2222
csv << ['Datum', 'Stunden', 'Von Zeit', 'Bis Zeit', 'Stundenansatz CHF', 'Reporttyp',
23-
'Verrechenbar', 'Member', 'Position', 'Ticket', 'Bemerkungen']
23+
'Verrechenbar', 'Member', 'Position', 'Ticket', 'Bemerkungen', 'Interne Bemerkungen']
2424
worktimes.each do |time|
2525
csv << [I18n.l(time.work_date),
2626
time.hours,
@@ -32,7 +32,8 @@ def worktimes_csv(worktimes)
3232
time.employee.label,
3333
time.account.label_verbose,
3434
time.ticket,
35-
time.description]
35+
time.description,
36+
time.internal_description]
3637
end
3738
end
3839
end

app/controllers/ordertimes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class OrdertimesController < WorktimesController
99
self.permitted_attrs = %i[account_id report_type work_date hours meal_compensation
10-
from_start_time to_end_time description billable ticket]
10+
from_start_time to_end_time description internal_description billable ticket]
1111

1212
after_destroy :send_email_notification
1313

app/controllers/worktimes_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def new
4040
@worktime.account_id = template.account_id
4141
@worktime.ticket = template.ticket
4242
@worktime.description = template.description
43+
@worktime.internal_description = template.internal_description
4344
@worktime.billable = template.billable
4445
@worktime.meal_compensation = template.meal_compensation
4546
end

app/helpers/order_services_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def checkable_worktimes_table(entries, options)
3030
t.attr(:description, nil, class: 'truncated', style: 'max-width: 250px;') do |w|
3131
content_tag(:span, w.description.to_s, title: w.description)
3232
end
33+
t.attr(:internal_description, nil, class: 'truncated', style: 'max-width: 150px;') do |w|
34+
content_tag(:span, w.internal_description.to_s, title: w.internal_description)
35+
end
3336
t.attrs(:billable, :meal_compensation, :invoice_id)
3437
t.foot { options[:footer] } if options[:footer]
3538
end

app/views/ordertimes/_form.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
3333
= f.labeled_input_field(:ticket, span: 2)
3434
= f.labeled_text_area(:description)
35+
= f.labeled_text_area(:internal_description, html_options = {title: "Wird innerhalb von PuzzleTime und im CSV-Export angezeigt, ist im Zeitrapport jedoch nicht enthalten", data: {toggle: :tooltip}})
3536
= f.labeled_date_field(:work_date,
3637
data: { remote: true,
3738
url: url_for(action: 'existing'),

config/locales/models.de-CH.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ de-CH:
426426
from_start_time: Von
427427
to_end_time: Bis
428428
description: Bemerkungen
429+
internal_description: Interne Bemerkungen
429430
billable: Verrechenbar
430431
meal_compensation: Verpflegungsentschädigung
431432
ticket: Ticket

config/locales/models.de-DE.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ de-DE:
389389
from_start_time: Von
390390
to_end_time: Bis
391391
description: Bemerkungen
392+
internal_description: Interne Bemerkungen
392393
billable: Verrechenbar
393394
meal_compensation: Verpflegungsentschädigung
394395
ticket: Ticket
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddInternalDescriptionToWorktimes < ActiveRecord::Migration[7.1]
2+
def change
3+
add_column :worktimes, :internal_description, :text
4+
end
5+
end

0 commit comments

Comments
 (0)