Page 1 of 1

Multiple Custom Fields

Posted: Tue Jan 08, 2019 5:00 am
by 5circles
I would like to have more than one custom field available. I started using a custom field in order to add a different way to categorize beyond tasks/projects/clients. I like the idea of the additional dimension and I would like to add another.

I thought I might be able to make some modifications to the code to see how an additional field would work. I started by adding a constant - CUSTOM_FIELDS_MAX - to plugins/CustomFields.class.php (set to 2 as a test), then modified cf_custom_field_add.php and cf_custom_fields.php. With these changes I was able to add another field though the GUI.

But I got stuck trying to make modifications to the code driving the Task entry. My PHP skills, knowledge of Smarty, and ability to debug with PhpStorm are not up to the task.

Because I don't want to lose the records I created with the first custom field, I figured out a way to use the new custom field I wanted (just not allowing the old custom field to be included in tasks). After going back to the original PHP files, I edited the custom field tables using PhpMyAdmin changing the custom field ID for both the first and later custom fields to give the newer one a lower ID.

As a temporary step, this approach seems to work. I can enter using the newer custom fields, and reports generated have both custom fields.

Obliviously, this is only temporary. I'd like to either figure out how to make the changes needed myself, or for someone else to do it properly.


Re: Multiple Custom Fields

Posted: Mon Sep 23, 2019 11:04 pm
by wrc
Multiple custom fields are now a feature in Time Tracker since version They can be associated with time entries and projects and be seen on reports. There is no limit on the number of fields.