したがって、2 つのカスタム モジュールがあります。それらは一対多で関連しています。モジュール A vardef には:`'lm_contacts' =>
array(
'name' => 'lm_contacts',
'type' => 'link',
'relationship' => 'lm_contacts_relation',
'source' => 'non-db',
'vname' => 'LBL_LEADS',
),
'relationships' =>
array (
'lm_contacts_relation' =>
array (
'lhs_module' => 'LM_LM_Objektas',
'lhs_table' => 'lm_lm_objektas',
'lhs_key' => 'id',
'rhs_module' => 'LM_LM_contact_person',
'rhs_table' => 'lm_lm_contact_person',
'rhs_key' => 'lm_object ',
'relationship_type' => 'one-to-many',
),
),
モジュール a には subpaneldef があります。
$layout_defs['LM_LM_Objektas'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' =>
array(
'lm_contacts' =>
array(
'order' => 10,
'module' => 'LM_LM_contact_person',
'subpanel_name' => 'default',
'sort_order' => 'asc',
//'sort_by' => 'id',
'title_key' => 'LBL_CONTACT_SUBPANEL_TITLE',
'get_subpanel_data' => 'lm_contacts',
'add_subpanel_data' => 'lm_contacts_id',
'top_buttons' =>
array (
0 =>
array (
'widget_class' => 'SubPanelTopButtonQuickCreate',
),
1 =>
array (
'widget_class' => 'SubPanelTopSelectButton',
'mode' => 'MultiSelect',
'popup_module' => 'LM_LM_contact_person',
),
),
),
),
);
モジュール a: lm_objectas はサブパネルを正しく表示しますが、サブパネルのクイック作成ボタンを使用して lm_contacts モジュールに新しい要求を追加しようとすると、レコードは作成されますが、フィールド " 'rhs_key' => 'lm_object' " の実際のデータは作成されません。当然、サブパネルの新しいレコードは表示されません。私は何が欠けていますか?ありがとう!