Module: TimesheetHookHelper
- Included in:
- RedmineRate::Hooks::PluginTimesheetViewsTimesheetTimeEntryHook, RedmineRate::Hooks::PluginTimesheetViewsTimesheetTimeEntrySumHook, RedmineRate::Hooks::PluginTimesheetViewsTimesheetsTimeEntryRowClassHook
- Defined in:
- lib/redmine_rate/hooks/timesheet_hook_helper.rb
Instance Method Summary collapse
-
#cost_item(time_entry) ⇒ Object
Returns the cost of a time entry, checking user permissions.
- #td_cell(html) ⇒ Object
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 content_tag(:td, html, :align => 'right', :class => 'cost') end |