Login or Register

RSS IconRecent posts in this topic

avatar Pro
Sebastian Tänzer on Dec 24. 2007. 9:07 am
I'd like to add a "budget" field to the "Edit Project" page and show the field on the overview etc.
How do I do this with a new module?
avatar Staff
Ilija Studen on Dec 24. 2007. 9:30 am
Common routine to add a field to an existing object type (project in this case) is:

1. Create a new field in the object table (acx_projects)
2. Update BaseProject class to reflect database changes
3. Update edit() action of ProjectController so new field is set when populating a new form
4. Update form template to include a new field

Simple way: add budget information to project summary field. Simple "Budget: $5000" at the end of project summary would do the trick.
activeCollab Team Member
avatar Pro
Sebastian Tänzer on Dec 24. 2007. 9:36 am
Thanks for the routine description. I'll see how far I'll come with this.
As far as I understand you this includes hacking the "core" and we'd have to maintain this in future updates.
Is there no other way to "expand" the default fields without changing the default form templates etc.?

No, adding the budget to the summary field won't do the trick (at least for us) as we're querying the database with a php script directly to generate some print reports (that have a budget column, too). I could parse the summary field but that could lead to other problems if so. (if there are more than 2 people working on a project you can count on so. producing a typo ;) )
avatar Staff
Ilija Studen on Dec 24. 2007. 9:50 am
Sebastian Tänzer:
As far as I understand you this includes hacking the "core" and we'd have to maintain this in future updates.
Is there no other way to "expand" the default fields without changing the default form templates etc.?


Not at this point, at least not for Projects. Project objects (checklists, discussions, tickets etc) have a number of custom fields that you can use, but not the projects.

In case you need this information available in the database in a consistent way you should follow the steps above. Process is pretty much copy-paste, but still requires some programming experience.
activeCollab Team Member
avatar Pro
Sebastian Tänzer on Dec 24. 2007. 9:52 am
Thanks for the feedback. Programming experience is not an issue. I just want to reduce the effort for future updates of aC to a minimum.

And by the way: Merry Christmas :)
avatar Staff
Ilija Studen on Dec 24. 2007. 2:30 pm
Sebastian Tänzer:
And by the way: Merry Christmas :)


Thanks :) Enjoy the holidays and please let me know if you need any more information regarding the hack.
activeCollab Team Member
avatar Pro
gseto on Jun 18. 2008. 8:49 pm
Hi there,

I followed your steps and managed to add a bunch of custom fields to the Project class for ActiveCollab 1.0. But now that I've upgraded to AC 1.1.2, I tried doing the exact same thing and now when I change the field values, they don't get saved to the DB.

I added fields to the Project Status page and the only way I can change the values of the custom fields is if I change the value of the Project Status. If that remains unchanged when I submit, then none of the other changes in the custom fields are saved. I assume there is some trigger to tell whether or not the status has changed and if not, then don't bother writing anything but it wasn't like this for 1.0 and I can't seem to find it anywhere.

Any ideas?
avatar Staff
Ilija Studen on Jun 19. 2008. 8:29 am
If the values are not loaded / saved / considered as modified check $fields property of BaseProject class. That is the place where all table fields are listed. If you have fields that are not listed there activeCollab does not "see" them.
activeCollab Team Member
avatar Pro
gseto on Jun 19. 2008. 2:16 pm
Hi Ilija,

Thanks for the quick reply and I also have to say thanks for a great product!

Yeah, I actually have added it to the $fields array, created getters and setters and added case statements for each field in setFieldValue();

I'm not sure where else to look.

Thanks,
Garry

avatar Staff
Ilija Studen on Jun 20. 2008. 10:30 am
Hi Garry,

Just check - edit status form does not accept any additional parameters except status itself. Other fields are ignored by the code that is used to process that form (it is edit_status action of ProjectController located in /activecollab/application/modules/system/controllers folder).
activeCollab Team Member

RSS IconRecent posts in this topic