Module: TimesheetHookHelper

Instance Method Summary collapse

Instance Method Details

#cost_item(time_entry) ⇒ Object

Returns the cost of a time entry, checking user permissions



3
4
5
6
7
8
9
# File 'lib/redmine_rate/hooks/timesheet_hook_helper.rb', line 3

def cost_item(time_entry)
  if User.current.logged? && (User.current.allowed_to?(:view_rate, time_entry.project) || User.current.admin?)
    return time_entry.cost
  else
    return nil
  end
end

#td_cell(html) ⇒ Object



11
12
13
# File 'lib/redmine_rate/hooks/timesheet_hook_helper.rb', line 11

def td_cell(html)
  return (:td, html, :align => 'right', :class => 'cost')
end