Hide Contacts subpanel in Accounts module

Hi,

I want to hide Contacts Subpanel in Account module. i tried to add the following code under:

@custom\Extension\modules\Accounts\Ext\Layoutdefs\layoutdefs.ext.php

and also tried,

@custom\Extension\modules\Accounts\Ext\Layoutdefs\_overrideAccount_subpanel_accounts_contacts.php

The code:

unset($layout_defs['Accounts']['subpanel_setup']['accounts_contacts']);

But both location are not working to hide the contact subpanel.

Parents
  • Hi Jason,,

    this is upgradesafe coding..

    Subpanel layouts are defined originally within metadata, e.g. /modules/Accounts/metadata/subpaneldefs.php.

    These files hold the original, default layout of subpanels and the fields within them. They are overridden in custom Extension data, e.g. custom/Extension/modules/Accounts/Ext/Layoutdefs/accounts_cont.php.

    After a repair & rebuild, you’ll find the data from the arbitrarily named files are merged and placed in /custom/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php.

    <?php

    unset($layout_defs["Accounts"]["subpanel_setup"]['contacts']);

  • Hi Sohan & Mehul,

    The solutions are not working for me, but I found the solution: $layout_defs['Accounts']['subpanel_setup'][contacts] = array ();

    Thanks anyway!!

  • Hi Mehul,

    thanks for this upgradesafe coding tips. But I still can't hide my sub-panels.

    1) I have created a new file in <custom/Extension/modules/Accounts/Ext/Layoutdefs/accounts_cont.php>

    with following lines of code: unset($layout_defs["Accounts"]["subpanel_setup"]['contacts']);

    2) clicked repair & rebuild and I can find the changes in </custom/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php>.

    --> But there are NO changes in the Accounts mask for end users.
    Thx for any help.

Reply
  • Hi Mehul,

    thanks for this upgradesafe coding tips. But I still can't hide my sub-panels.

    1) I have created a new file in <custom/Extension/modules/Accounts/Ext/Layoutdefs/accounts_cont.php>

    with following lines of code: unset($layout_defs["Accounts"]["subpanel_setup"]['contacts']);

    2) clicked repair & rebuild and I can find the changes in </custom/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php>.

    --> But there are NO changes in the Accounts mask for end users.
    Thx for any help.

Children
  • This solution works for me! Sugar (version 7.6.0.0)

     

    1) Copy file modules/accounts/clients/base/layouts/subpanels/subpanels.php to --> custom/modules/accounts/clients/base/layouts/subpanels/subpanels.php

    2) Open file custom/modules/accounts/clients/base/layouts/subpanels/subpanels.php in Editor.

    3) Hiding e.g. contacts: find 'link' => 'contacts' and comment the whole section

    /****

        array (

          'layout' => 'subpanel',

          'label' => 'LBL_CONTACTS_SUBPANEL_TITLE',

    'override_subpanel_list_view' => 'subpanel-for-accounts',

          'context' => array (

            'link' => 'contacts',

          ),

        ),

    ****/

    4) Save >> Quick repair and rebuild >> DONE