***EDIT***
After looking thru Sugar, I need to copy the Contacts subpanel for Oppportunities
and make it a Users subpanel for Users. Contacts have a Role for an Opportunity they're related to.
Anyone know everythign involve in copied this subpanel's functinoality the way I need?
------------------------------------------------------------------------------------
I've done the following:
Added line:
include_once("metadata/users_accessMetaData.php");
to modules\TableDictionary.php
created file \metadata/users_accessMetaData.php with code:
added code to \modules\Users\vardefs.php file:PHP Code:$dictionary['users_access'] = array ( 'table' => 'users_access'
, 'fields' => array (
array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'', 'required'=>true)
, array('name' =>'grant_id', 'type' =>'char', 'len'=>'36', )
, array('name' =>'access_id', 'type' =>'char', 'len'=>'36', )
, array('name' =>'access_type', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true)
, array ('name' => 'date_modified','type' => 'datetime')
, array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true)
)
, 'indices' => array (
array('name' =>'idx_users_accesspk', 'type' =>'primary', 'fields'=>array('id'))
, array('name' =>'idx_users_access_grant', 'type' =>'index', 'fields'=>array('grant_id'))
, array('name' =>'idx_users_access_access', 'type' =>'index', 'fields'=>array('access_id'))
, array('name' =>'idx_users_access_grant_access_del', 'type' =>'index', 'fields'=>array('grant_id','access_id','deleted'))
, array('name' => 'idx_users_access_grant_access', 'type'=>'alternate_key', 'fields'=>array('grant_id','access_id'))
)
,'relationships' => array ('users_access' => array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'Users', 'rhs_table'=> 'users', 'rhs_key' => 'id',
'relationship_type'=>'many-to-many',
'join_table'=> 'users_access', 'join_key_lhs'=>'grant_id', 'join_key_rhs'=>'access_id'))
)
fields array:
Addedd code to \modules\Users\layout_defs.php file:PHP Code:'users_access' =>
array (
'name' => 'users_access',
'type' => 'link',
'relationship' => 'users_access',
'module'=>'Users',
'bean_name'=>'Users',
'source'=>'non-db',
'vname'=>'LBL_USERS_ACCESS',
),
added label textPHP Code:'users_access' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),),
'order' => 20,
'module' => 'Users',
'subpanel_name' => 'default',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'grant_id',
'refresh_page'=>1,
'title_key' => 'LBL_USERS_ACCESS_SUBPANEL_TITLE',
),
repair tables created needed users_access table and fields
repaired relationships
But now no subpanels show unders User detailview until I delete code added to layout_defs.php
Help.
***edit***
log says: 10/23/06 11:09:30,646 [800] FATAL SugarCRM - Metadata for table users does not exist
Rey


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks