Bonjour,
Décidément j'accumule les problèmes sur sugar,
Mon problème cette fois-ci est dut apparemment à ce que mon nouveau module dupliqué "écrase" ou non(ca dépends lol) le tableau contenant le subpanel Account de mon module d'origine.
J'aimerais savoir ou chercher pour modifier, car je n'ai repérer aucun doublon de variables dans les 2 modules des fichiers vardefs.php, métadata ainsi que layout_defs, chacun créant sa propre table de jointure account_module
![]()
Si vous avez la moindre idée n'hésitez pas, je suis à cours d'idée..
Merci à l'avance
Cordialement
Alexandre A.
Voici les définitions pour le subpanel account des deux modules:
Module InvPostes
accounts_invpostevardefs.php
accountlayout_invpostedefs.phpPHP Code:$dictionary['Account']['fields']['invpostes'] = array (
'name' => 'invpostes',
'type' => 'link',
'relationship' => 'account_invposte',
'module' => 'InvPostes',
'source'=>'non-db',
'vname'=>'LBL_INVPOSTE_SUBPANEL_TITLE',
);
accounts_invposteMetaData.phpPHP Code:$layout_defs['Accounts']['subpanel_setup']['invpostes'] = array(
'order' => 120,
'module' => 'InvPostes',
'subpanel_name' => 'ForAccount',
'get_subpanel_data' => 'invpostes',
//'add_subpanel_data' => 'account_id',
'title_key' => 'LBL_INVPOSTE_SUBPANEL_TITLE',
'refresh_page'=>1,
'sort_order' => 'desc',
'sort_by' => 'name',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopButtonQuickCreate'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'InvPostes'),
),
);
Module InvServeursPHP Code:$dictionary['accounts_invpostes'] = array (
'table' => 'accounts_invpostes',
'fields' => array (
array('name' =>'id', 'type' =>'char', 'len'=>'36', 'required'=>true, 'default'=>'')
, array('name' =>'account_id', 'type' =>'char', 'len'=>'36')
, array('name' =>'invposte_id', 'type' =>'char', 'len'=>'36')
, array ('name' => 'date_modified','type' => 'datetime')
, array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'required'=>true, 'default'=>'0')
),
'indices' => array (
array('name' =>'accounts_invpostespk', 'type' =>'primary', 'fields'=>array('id')),
array('name' =>'accounts_idx', 'type' =>'index', 'fields'=>array('account_id')),
array('name' =>'invposte_idx', 'type' =>'index', 'fields'=>array('invposte_id')),
array('name' =>'acc_invp', 'type' =>'alternate_key', 'fields'=>array('account_id','invposte_id'))
),
'relationships' => array (
'accounts_invpostes' =>
array(
'lhs_module'=> 'Accounts',
'lhs_table'=> 'accounts',
'lhs_key' => 'id',
'rhs_module'=> 'InvPostes',
'rhs_table'=> 'invpostes_table',
'rhs_key' => 'client_id',
'relationship_type'=>'many-to-many',
'join_table'=> 'accounts_invpostes',
'join_key_lhs'=>'account_id',
'join_key_rhs'=>'invposte_id'))
);
accounts_invserveurvardefs.php
accountlayout_invserveurdefs.phpPHP Code:$dictionary['Account']['fields']['invserveurs'] = array (
'name' => 'invserveurs',
'type' => 'link',
'relationship' => 'account_invserveur',
'module' => 'InvServeurs',
'source'=>'non-db',
'vname'=>'LBL_INVSERVEUR_SUBPANEL_TITLE',
);
accounts_invserveurMetaData.phpPHP Code:$layout_defs['Accounts']['subpanel_setup']['invserveurs'] = array(
'order' => 120,
'module' => 'InvServeurs',
'subpanel_name' => 'ForAccount',
'get_subpanel_data' => 'invserveurs',
//'add_subpanel_data' => 'account_id',
'title_key' => 'LBL_INVSERVEUR_SUBPANEL_TITLE',
'refresh_page'=>1,
'sort_order' => 'desc',
'sort_by' => 'name',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopButtonQuickCreate'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'InvServeurs'),
),
);
PHP Code:$dictionary['accounts_invserveurs'] = array (
'table' => 'accounts_invserveurs',
'fields' => array (
array('name' =>'id', 'type' =>'char', 'len'=>'36', 'required'=>true, 'default'=>'')
, array('name' =>'account_id', 'type' =>'char', 'len'=>'36')
, array('name' =>'invserveur_id', 'type' =>'char', 'len'=>'36')
, array ('name' => 'date_modified','type' => 'datetime')
, array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'required'=>true, 'default'=>'0')
),
'indices' => array (
array('name' =>'accounts_invserveurspk', 'type' =>'primary', 'fields'=>array('id')),
array('name' =>'accounts_idx', 'type' =>'index', 'fields'=>array('account_id')),
array('name' =>'invserveur_idx', 'type' =>'index', 'fields'=>array('invserveur_id')),
array('name' =>'acc_invp', 'type' =>'alternate_key', 'fields'=>array('account_id','invserveur_id'))
),
'relationships' => array (
'accounts_invserveurs' =>
array(
'lhs_module'=> 'Accounts',
'lhs_table'=> 'accounts',
'lhs_key' => 'id',
'rhs_module'=> 'InvServeurs',
'rhs_table'=> 'invserveurs_table',
'rhs_key' => 'client_id',
'relationship_type'=>'many-to-many',
'join_table'=> 'accounts_invserveurs',
'join_key_lhs'=>'account_id',
'join_key_rhs'=>'invserveur_id'))
);


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks