Class: RedmineRate::Hooks::PluginTimesheetViewsTimesheetsTimeEntryRowClassHook

Inherits:
Redmine::Hook::ViewListener
  • Object
show all
Includes:
TimesheetHookHelper
Defined in:
lib/redmine_rate/hooks/plugin_timesheet_views_timesheets_time_entry_row_class_hook.rb

Instance Method Summary collapse

Methods included from TimesheetHookHelper

#cost_item, #td_cell

Instance Method Details

#plugin_timesheet_views_timesheets_time_entry_row_class(context = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/redmine_rate/hooks/plugin_timesheet_views_timesheets_time_entry_row_class_hook.rb', line 6

def plugin_timesheet_views_timesheets_time_entry_row_class(context={})
  time_entry = context[:time_entry]
  return "" unless time_entry

  cost = cost_item(time_entry)
  return "" unless cost # Permissions
  
  if cost && cost <= 0
    return "missing-rate"
  else
    return ""
  end
end