[#2279] Hooked up the Billable filter to adjust the Timesheet's Activities.
* Hooked into the TimesheetController to modify the Timesheet activities * Added TimeEntryActivity#find_with_billable_values to find all the TimeEntryActivities which have the value in the billable custom field.
This commit is contained in:
@@ -41,4 +41,11 @@ class OverheadTimesheetHook < Redmine::Hook::ViewListener
|
||||
:selected_values => selected_values
|
||||
})
|
||||
end
|
||||
|
||||
def plugin_timesheet_controller_report_pre_fetch_time_entries(context = {})
|
||||
if context[:params] && context[:params][:timesheet] && context[:params][:timesheet][:billable]
|
||||
activities = TimeEntryActivity.find_with_billable_values(context[:params][:timesheet][:billable])
|
||||
context[:timesheet].activities = activities.collect(&:id) unless activities.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user