Login or Register

RSS IconRecent posts in this topic

avatar
ssanders on Feb 25. 2008. 9:22 pm
I need the ability to attach more complex objects to my projects. I am currently managing these objects using some software developed in-house for this purpose. Since I am moving towards using activeCollab for everything project related, I would like to roll these objects into activeCollab. I assume that the easiest way to do this would be to write a new module for each type of complex object I would like to be able to attach to a project. The models will extend ProjectObject and ProjectObjects and the controller will extend ProjectController. So far, I have had no problems setting this up, but adding more relational data to this complex object is a problem. I understand that the project_objects table offers a limited set of fields I can use for my object, but what if an instance of this complex project object has many other objects? For example, if a project has a Widget object and each Widget has many Sprockets, how do I model the sprockets? Is there a well-defined method for adding new tables to the activeCollab database and mapping models to them? Any info or suggestions about creating a new module that uses multiple models would be appreciated.

Thanks,
Scott
avatar
Ilija Studen on Feb 25. 2008. 11:03 pm
If Sprocket is also project object model it as ProjectObject and use parent_id field for relation with a Widget. We use same approach when connecting Categories and Tickets (or Discussion or Files). If Sprocket is really specific create a new table, create model classes and connect the with Widget through foreign key.

Analyze BaseUser and BaseUsers classes for example to see how base model classes are defined.
activeCollab team member

RSS IconRecent posts in this topic