I think you're just trying to add a Tasks subpanel to Project Tasks, right? If so, you need to define a relationship like this in ProjectTask/vardefs.php. The definition is based on the existing relationships which are defined there, for linking to other Activity types. This uses the existing parent_type and parent_id fields on the Task to create the link.
Code:
,'project_task_tasks' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'ProjectTask') You would then add a virtual field definition like this, which uses the relationship definition to define the list of related objects for the subpanel.
Code:
'tasks' => array (
'name' => 'tasks',
'type' => 'link',
'relationship' => 'project_task_tasks',
'source'=>'non-db',
'vname'=>'LBL_TASKS',
), Hope this helps.
Bookmarks