Custom fields and overrides on Enumerations
|Assignee:||Eric Davis||% Done:|
I'm going to be adding a bunch of changes to Redmine this week in order to make Enumerations more flexible and customizable. My specific goal is to have the Time Entry Activities flexible and when combined with a soon to be released plugin, allow Redmine to track things like Billable and Non Billable time automatically (optional).
The short list of changes include:
- Allowing custom fields on Enumerations. - Example: Is this activity billable?
- Allow Time Entry Activities to be marked active or inactive. Inactive ones will only be listed in admin pages.
- Allow each project to override the Time Entry Activities' custom data - Example: ActivityA is billable except on ProjectB where it is non-billable
- Allow each project to override if each Time Entry Activity is active or inactive. This will let a project Manager turn off activities that aren't needed on a project.
- Allow the Time Report to use the Custom Data fields as filters
All of this code has been developed and tested already and has running in production for over 4 months now. I'm just going to extract it from a running system so everyone can use it. There might be some bugs from the merge and I'm sure we will need to iterate over it a few times to make it more robust but I'd rather get this out there and get feedback on it sooner than later.
Added an active field track if an Enumeration is active on the frontend view.
- Changed TimelogHelper#activity_collection_for_select_options to only use
- Changed TimelogHelper#activity_collection_for_select_options to return a blank
option if the time_entry's current activity is inactive.
Added project specific Enumeration overrides.
These will be used to track if Enumeration's custom data or active state
is overridden on a project. An overridden Enumeration is one that is associated
with a parent Enumeration.
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities
- Added Project#activities to return all the Systemwide and Project specific
activities, excluding Systemwide ones that are overridden.
- Added some tests for TimelogHelper.
Added a Activities tab to Project Settings
- Changed Project#activities to allow getting inactive Activities also:
* Changed the Enumeration#all named_scope to exclude project specific Activities
* Changed the Project has_many time_entry_activities to include all by default
and provided an #active method to filter them to active ones only * Split Project#activities to two methods and gave it a parameter that is used
to determine if inactive activities are included (default is no)
- Added a reset button to delete all project specific activities.
- Added ProjectsController#reset_activities to remove the project
- Added a HTTP DELETE route for reset_activities
- Changed the permissions for managing project activities to have access to the
- Added a way to bulk save Project specific Activities in ProjectsController
* #save_activities will save all the changed activities, including update the
existing records * Added helper methods to the controller which will be refactored later * Allow the same TimeEntryActivity names on different projects
When a specific TimeEntryActivity are change, associated TimeEntries will be
re-assigned to the correct record.
- Renamed build to create since the methods now create objects.
- Removed call to Project#save that isn't needed since objects are saved directly now.
- Wrapped the activity creation and updates in a SQL transaction so TimeEntries
will remain in a consistent state if there is an error.
- When a Project's TimeEntryActivities are destroyed, they are now
reassigned to the parent TimeEntryActivity.
#1 Updated by Eric Davis about 8 years ago
- Status changed from 7 to Closed
- % Done changed from 0 to 100
This went a lot faster than I thought. I was able to extract and merge all of the new features today (thanks git!). I've attached some screenshots with purple highlights to show what parts of Redmine's UI have changed. If there are any bugs or change requests, please open a new issue and assign it to me.
#2 Updated by Eric Davis about 8 years ago
- File editing-a-time-entry-activity.png added
- File entering-a-time-entry.png added
- File enumeration-custom-fields.png added
- File enumeration-list.png added
- File new-project-settings-tab.png added
I guess the screenshots would be easier to see if they were attached.