[#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:
Eric Davis
2009-04-22 15:10:29 -07:00
parent c122a291c7
commit 16d793bea6
4 changed files with 90 additions and 0 deletions
+7
View File
@@ -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