Hello,
I'm writing a moduel and would like Activities to be a subpanel for this module. I got the subpanel to show up, but I ran into another issue. When I create items in that subpanel, it doesn't appear in the subpanel. It is created, and has all the information it requires, but it doesn't show up.
heres some information:
Manifest relationship information:
array(
'module'=> 'Policies',
'meta_data'=>'<basepath>/relationships/PoliciesMetaData.php',
'module_vardefs'=>'<basepath>/vardefs/PoliciesVardefs.php',
'module_layoutdefs'=>'<basepath>/layoutdefs/Policieslayout_defs.php'
)
PoliciesMetaData.php:
<?
$dictionary['policies_meetings'] = array (
'table' => 'policies_meetings',
'fields' => array (
array(
'name' =>'id',
'type' =>'char',
'len'=>'36',
'required'=>true,
'default'=>''
),
array(
'name' =>'policies_id',
'type' =>'char',
'len'=>'36'
),
array(
'name' =>'meetings_id',
'type' =>'char',
'len'=>'36'
),
array (
'name' => 'date_modified',
'type' => 'datetime'
),
array(
'name' =>'deleted',
'type' =>'bool',
'len'=>'1',
'required'=>true,
'default'=>'0'
)
),
'relationships' => array(
'policies_meetings' => array(
'lhs_module' => 'Policies',
'lhs_table' => 'policies',
'lhs_key' => 'id',
'rhs_module' => 'Meetings',
'rhs_table' => 'meetings',
'rhs_key' => 'id',
'relationship-type'=>'one-to-many',
'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Policies'
),
)
);
$dictionary['policies_tasks'] = array (
'table' => 'policies_tasks',
'fields' => array (
array(
'name' =>'id',
'type' =>'char',
'len'=>'36',
'required'=>true,
'default'=>''
),
array(
'name' =>'policies_id',
'type' =>'char',
'len'=>'36'
),
array(
'name' =>'tasks_id',
'type' =>'char',
'len'=>'36'
),
array (
'name' => 'date_modified',
'type' => 'datetime'
),
array(
'name' =>'deleted',
'type' =>'bool',
'len'=>'1',
'required'=>true,
'default'=>'0'
)
),
'relationships' => array(
'policies_tasks' => array(
'lhs_module' => 'Policies',
'lhs_table' => 'policies',
'lhs_key' => 'id',
'rhs_module' => 'Tasks',
'rhs_table' => 'tasks',
'rhs_key' => 'id',
'relationship-type'=>'one-to-many',
'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Policies'
),
)
);
$dictionary['policies_notes'] = array (
'table' => 'policies_notes',
'fields' => array (
array(
'name' =>'id',
'type' =>'char',
'len'=>'36',
'required'=>true,
'default'=>''
),
array(
'name' =>'policies_id',
'type' =>'char',
'len'=>'36'
),
array(
'name' =>'notes_id',
'type' =>'char',
'len'=>'36'
),
array (
'name' => 'date_modified',
'type' => 'datetime'
),
array(
'name' =>'deleted',
'type' =>'bool',
'len'=>'1',
'required'=>true,
'default'=>'0'
)
),
'relationships' => array(
'policies_tasks' => array(
'lhs_module' => 'Policies',
'lhs_table' => 'policies',
'lhs_key' => 'id',
'rhs_module' => 'Notes',
'rhs_table' => 'notes',
'rhs_key' => 'id',
'relationship-type'=>'one-to-many',
'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Policies'
),
)
);
$dictionary['policies_calls'] = array (
'table' => 'policies_calls',
'fields' => array (
array(
'name' =>'id',
'type' =>'char',
'len'=>'36',
'required'=>true,
'default'=>''
),
array(
'name' =>'policies_id',
'type' =>'char',
'len'=>'36'
),
array(
'name' =>'calls_id',
'type' =>'char',
'len'=>'36'
),
array (
'name' => 'date_modified',
'type' => 'datetime'
),
array(
'name' =>'deleted',
'type' =>'bool',
'len'=>'1',
'required'=>true,
'default'=>'0'
)
),
'relationships' => array(
'policies_tasks' => array(
'lhs_module' => 'Policies',
'lhs_table' => 'policies',
'lhs_key' => 'id',
'rhs_module' => 'Calls',
'rhs_table' => 'calls',
'rhs_key' => 'id',
'relationship-type'=>'one-to-many',
'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Policies'
),
)
);
?>
PoliciesVardefs.php:
<?
$dictionary['Policies']['fields']['meetings'] = array (
// Table name of module being attached
'name' => 'meetings',
// Type of attachment; Always link
'type' => 'link',
// // Name of the module being attached
// 'module' => 'ModuleA',
// Table that relationship data should be put
'relationship' => 'policies_meetings',
// Source should always be non-db
'source'=>'non-db',
);
$dictionary['Policies']['fields']['tasks'] = array (
// Table name of module being attached
'name' => 'tasks',
// Type of attachment; Always link
'type' => 'link',
// // Name of the module being attached
// 'module' => 'ModuleA',
// Table that relationship data should be put
'relationship' => 'policies_tasks',
// Source should always be non-db
'source'=>'non-db',
);
$dictionary['Policies']['fields']['notes'] = array (
// Table name of module being attached
'name' => 'notes',
// Type of attachment; Always link
'type' => 'link',
// // Name of the module being attached
// 'module' => 'ModuleA',
// Table that relationship data should be put
'relationship' => 'policies_notes',
// Source should always be non-db
'source'=>'non-db',
);
$dictionary['Policies']['fields']['calls'] = array (
// Table name of module being attached
'name' => 'calls',
// Type of attachment; Always link
'type' => 'link',
// // Name of the module being attached
// 'module' => 'ModuleA',
// Table that relationship data should be put
'relationship' => 'policies_calls',
// Source should always be non-db
'source'=>'non-db',
);
?>
Layout defs is empty, but the layout_defs.php file in the Policies module directoy is used:
<?
$layout_defs['Policies'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'activities' => array(
'order' => 10,
'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'activities', //this values is not associated with a physical file.
'module'=>'Activities',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateTaskButton'),
array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
array('widget_class' => 'SubPanelTopScheduleCallButton'),
array('widget_class' => 'SubPanelTopComposeEmailButton'),
),
'collection_list' => array(
'meetings' => array(
'module' => 'Meetings',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'meetings',
),
'tasks' => array(
'module' => 'Tasks',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'tasks',
),
'calls' => array(
'module' => 'Calls',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'calls',
),
)
)
)
);
?>
And lastly, here are the related tables in the vardefs.php file
'notes' =>
array (
'name' => 'notes',
'type' => 'link',
'relationship' => 'policies_notes',
'module'=>'Notes',
'bean_name'=>'Note',
'source'=>'non-db',
'vname'=>'LBL_NOTES',
),
'meetings' =>
array (
'name' => 'meetings',
'type' => 'link',
'relationship' => 'policies_meetings',
'module'=>'Meetings',
'bean_name'=>'Meeting',
'source'=>'non-db',
'vname'=>'LBL_MEETINGS',
),
'calls' =>
array (
'name' => 'calls',
'type' => 'link',
'relationship' => 'policies_calls',
'module'=>'Calls',
'bean_name'=>'Call',
'source'=>'non-db',
'vname'=>'LBL_CALLS',
),
'tasks' =>
array (
'name' => 'tasks',
'type' => 'link',
'relationship' => 'policies_tasks',
'module'=>'Tasks',
'bean_name'=>'Task',
'source'=>'non-db',
'vname'=>'LBL_TASKS',
),
Thanks for the help in advance =)


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks