
Originally Posted by
simple Hi
did you create an enrtry for user_acces_type_id in the file modules/Users/vardefs.php similar to the entry opportunity_role_id in the file modules/Contacts/vardefs.php?
I don't know if this helps but the only (lowercase) reference to OPPORTUNITY_ROLE_ID is in the file vardefs.php...
In the Contacts/vardefs.php file is another entry which might be interesting ... opportunity_role_fields.
Hope it helps.
Thanks for the assistance. This is what I've added to the Users\vardefs.php (counterparts to Contacts\vardefs.ph Opp entries)
Code:
'users' =>
array (
'name' => 'accessusers',
'type' => 'link',
'relationship' => 'users_access',
'source' => 'non-db',
'module' => 'Users',
'bean_name' => 'User',
'vname' => 'LBL_OPPORTUNITIES',
),
'usersaccess_type_fields' =>
array (
'name' => 'usersaccess_type_fields',
'rname' => 'id',
'relationship_fields'=>array('id' => 'usersaccess_type_id', 'access_type' => 'usersaccess_type'),
'vname' => 'LBL_ACCOUNT_NAME',
'type' => 'relate',
'link' => 'users',
'link_type' => 'relationship_info',
'join_link_name' => 'users_access',
'source' => 'non-db',
'Importable' => false
),
'usersaccess_type_id' =>
array(
'name' => 'usersaccess_type_id',
'type' => 'varchar',
'source' => 'non-db',
'vname' => 'LBL_OPPORTUNITY_ROLE_ID',
),
'usersaccess_type' =>
array(
'name' => 'usersaccess_type',
'type' => 'varchar',
'source' => 'non-db',
'vname' => 'LBL_OPPORTUNITY_ROLE',
),
Add additions to Users\layout_defs.php:
Code:
'users' => array(
'order' => 40,
'module' => 'Users',
'subpanel_name' => 'ForUsers',
'get_subpanel_data' => 'users',
'add_subpanel_data' => 'access_id',
'title_key' => 'LBL_USERS_ACCESS_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
), And USers\subpanels\ForUsers.php:
Code:
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Users'),
),
'where' => '',
'default_order_by' => '',
'list_fields' => array(
'edit_button'=>array(
'widget_class' => 'SubPanelEditAccessTypeButton',
'type_id'=>'usersaccess_type_id',
'module' => 'Users',
'width' => '15%',
),
'first_name'=>array(
'name'=>'first_name',
'usage' => 'query_only',
),
'last_name'=>array(
'name'=>'last_name',
'usage' => 'query_only',
),
'name'=>array(
'name'=>'name',
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'module' => 'Users',
'width' => '33%',
),
'usersaccess_type_fields'=>array(
'usage' => 'query_only',
),
'usersaccess_type_id'=>array(
'usage' => 'query_only',
),
'usersaccess_type'=>array(
'name'=>'usersaccess_type',
'vname' => 'LBL_LIST_ACCESS_TYPE_ROLE',
'width' => '47%',
'sortable'=>true,
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '5%',
),
),
); copied and renamed widget include\generic\SugarWidgets\SubPanelEditRoleButto n.php ->SubPanelEditAccessTypeButton.php
with code:
Code:
require_once('include/generic/SugarWidgets/SugarWidgetField.php');
class SugarWidgetSubPanelEditAccessTypeButton extends SugarWidgetField
{
function displayHeaderCell(&$layout_def)
{
return ' ';
}
function displayList(&$layout_def)
{//pre_print($layout_def['fields']);
global $app_strings;
global $image_path;
$href = 'index.php?module=' . $layout_def['module']
. '&action=' . 'UserUserRelationshipEdit'
. '&record=' . $layout_def['fields']['USERSACCESS_TYPE_ID']
. '&return_module=' . $_REQUEST['module']
. '&return_action=' . 'DetailView'
. '&return_id=' . $_REQUEST['record'];
$edit_icon_html = get_image($image_path . 'edit_inline',
'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"');
//based on listview since that lets you select records
if($layout_def['ListView']){
return '<a href="' . $href . '"'
. 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_EDIT'] .'</a> ';
}else{
return '';
}
}
}
note: I haven't gotten around to setting different labels yet.
Bookmarks