Ti faccio un esempio.
Io avevo la necessità di aggiungere il subpanel Accounts sotto al modulo Contacts, quindi ho fatto le seguenti modifiche:
ho copiato il file <sugar-root>/modules/Contacts/metadata/subpanels/ForAccounts.php nella cartella <sugar-root>/custom/modules/Accounts/metadata/subpanels/
poi ho copiato il file <sugar-root>/modules/Contacts/metadata/subpaneldefs.php nella cartella <sugar-root>/custom/modules/Contacts/metadata/ e l'ho modificato aggiungendo questo codice:
PHP Code:
),
'accounts' => array(
'order' => 90,
'sort_order' => 'asc',
'sort_by' => 'name',
'module' => 'Accounts',
'subpanel_name' => 'ForAccounts',
'get_subpanel_data' => 'accounts',
'add_subpanel_data' => 'account_id',
'title_key' => 'LBL_MODULE_ID',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopButtonQuickCreate'),
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
),
),
Ho poi eseguito clear template data cache e rebuild relationships e ho ottenuto il mio subpanel.
Allego il file subpaneldefs.php modificato per chiarezza.
Bookmarks