@Salonick
If I understand correctly you want to make relationship project one-to-many accounts.
Without Studio you should make a few files. There is working example here.
After files maked do ‘Quick Repair and Rebuild’ and when it will finishe to scroll window down and push button “Execute”
- custom/Extension/application/Ext/TableDictionary/project_accounts.php
<?php
include('custom/metadata/project_accountsMetaData.php');
?>
- custom/metadata/project_accountsMetaData.php
<?php
$dictionary["project_accountsMetaData"] = array (
'true_relationship_type' => 'one-to-many',
'relationships' =>
array (
'project_accounts' =>
array (
'lhs_module' => 'Project',
'lhs_table' => 'project',
'lhs_key' => 'project_accounts_id',
'rhs_module' => 'Accounts',
'rhs_table' => 'accounts',
'rhs_key' => 'id',
'relationship_type' => 'one-to-many',
),
),
);
- custom/Extension/modules/Accounts/Ext/Layoutdefs/project_accounts.php
<?php
$layout_defs["Accounts"]["subpanel_setup"]['project_accounts'] = array (
'order' => 110,
'module' => 'Project',
'subpanel_name' => 'default',
'sort_order' => 'asc',
'sort_by' => 'id',
'title_key' => 'LBL_ACCOUNT_PROJECTS_TITLE',
'get_subpanel_data' => 'project_accounts',
'top_buttons' =>
array (
0 =>
array (
'widget_class' => 'SubPanelTopButtonQuickCreate',
),
1 =>
array (
'widget_class' => 'SubPanelTopSelectButton',
'mode' => 'MultiSelect',
),
),
);
- custom/Extension/modules/Accounts/Ext/Language/en_us.accounts_project.php
<?php
$mod_strings['LBL_ACCOUNT_PROJECTS_TITLE'] = 'Projects (one --- many)';
- custom/Extension/modules/Accounts/Ext/Vardefs/accounts_project.php
<?php
$dictionary["Account"]["fields"]["project_accounts"] = array (
'name' => 'project_accounts_s',
'type' => 'link',
'relationship' => 'project_accounts',
'source' => 'non-db',
'module' => 'Project',
'bean_name' => 'Project',
'side' => 'right',
'vname' => 'LBL_ACCOUNTS_PROJECT_TITLE',
);
- custom/Extension/modules/Project/Ext/Language/en_us.project_accounts.php
<?php
$mod_strings['LBL_PROJECT_ACCOUNTS_TITLE'] = 'Account';
- custom/Extension/modules/Project/Ext/Vardefs/project_accounts.php
<?php
$dictionary["Project"]["fields"]["project_accounts"] = array (
'name' => 'project_accounts',
'type' => 'link',
'relationship' => 'project_accounts',
'source' => 'non-db',
'module' => 'Accounts',
'bean_name' => 'Account',
'vname' => 'LBL_PROJECT_ACCOUNTS_TITLE',
'id_name' => 'project_accounts_id',
);
$dictionary["Project"]["fields"]["project_accounts_name"] = array (
'name' => 'project_accounts_name',
'type' => 'relate',
'source' => 'non-db',
'vname' => 'LBL_PROJECT_ACCOUNTS_TITLE',
'save' => true,
'id_name' => 'project_accounts_id',
'link' => 'project_accounts',
'table' => 'accounts',
'module' => 'Accounts',
'rname' => 'name',
'dbType' => 'varchar',
);
$dictionary["Project"]["fields"]["project_accounts_id"] = array (
'name' => 'project_accounts_id',
'type' => 'id',
'rname' => 'id',
'dbType' => 'id',
'relationship' => 'project_accounts',
'reportable' => false,
'side' => 'right',
'module' => 'Accounts',
'vname' => 'LBL_PROJECT_ACCOUNTS_TITLE',
);