Multiple Custom Fields

Discussion forum about Anuko Time Tracker
Post Reply
5circles
Posts: 8
Joined: Fri Jan 25, 2013 10:54 pm

Multiple Custom Fields

Post by 5circles » Tue Jan 08, 2019 5:00 am

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.

Thanks
Mike

Post Reply