Feature #4077

Custom fields and overrides on Enumerations

Added by Eric Davis almost 13 years ago. Updated almost 13 years ago.

Status:ClosedStart date:2009-10-21
Priority:HighDue date:
Assignee:Eric Davis% Done:


Target version:0.9.0


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.

editing-a-time-entry-activity.png (24.1 KB) Eric Davis, 2009-10-22 01:01

entering-a-time-entry.png (21.7 KB) Eric Davis, 2009-10-22 01:01

enumeration-custom-fields.png (27.7 KB) Eric Davis, 2009-10-22 01:01

enumeration-list.png (45 KB) Eric Davis, 2009-10-22 01:01

new-project-settings-tab.png (28 KB) Eric Davis, 2009-10-22 01:01

Related issues

Related to Redmine - Defect #4084: Cannot disable activity in project when activity is activ... Closed 2009-10-22
Related to Redmine - Defect #6564: Remove IssuePriorityCustomFields? Closed 2010-10-04

Associated revisions

Revision 2945
Added by Eric Davis almost 13 years ago

Enumerations can now have custom fields defined on them. #4077

Revision 2946
Added by Eric Davis almost 13 years ago

Added an active field track if an Enumeration is active on the frontend view.

  • Changed TimelogHelper#activity_collection_for_select_options to only use
    active TimeEntryActivities.
  • Changed TimelogHelper#activity_collection_for_select_options to return a blank
    option if the time_entry's current activity is inactive.


Revision 2947
Added by Eric Davis almost 13 years ago

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.


Revision 2948
Added by Eric Davis almost 13 years ago

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.


Revision 2949
Added by Eric Davis almost 13 years ago

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
    specific activities
  • Added a HTTP DELETE route for reset_activities
  • Changed the permissions for managing project activities to have access to the
    ProjectsController#reset_activities action
  • 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


Revision 2950
Added by Eric Davis almost 13 years ago

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.


Revision 2951
Added by Eric Davis almost 13 years ago

Added all list and boolean custom data fields to the Time Report. #4077

Revision 2952
Added by Eric Davis almost 13 years ago

Fixed some merge bugs. #4077


#1 Updated by Eric Davis almost 13 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.

I combined the changes into 9 separate commits so they are easier to review. Committed in: r2944, r2945, r2946, r2947, r2948, r2949, r2950, r2951, r2952

#2 Updated by Eric Davis almost 13 years ago

I guess the screenshots would be easier to see if they were attached.

Also available in: Atom PDF