Remove subpanel from a module

Hi All

How can we remove subpanel from a Module? I want to remove contacts subpanel from Accounts Module (In two ways :-One is simply hide and other is based on some condition,I want to hide contacts Subpanel from Accounts Module.I tried to hide subpanel using below modiification:

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

But it did not work in sugarcrm 7.6 version.Please let me know how can we do this.

Parents
  • Hello Harpeet,

    One possible way to fix this is to copy

    modules/MODULE/clients/base/layouts/subpanels/subpanels.php

     

    to

     

    custom/modules/MODULE/clients/base/layouts/subpanels/subpanels.php

     

    and removes or comment out the arrays from the custom file. For example, if you wanted to get rid of the Leads subpanel, you would comment out or remove

     

        array (

          'layout' => "subpanel",

          'label' => 'LBL_LEADS_SUBPANEL_TITLE',

          'context' => array (

            'link' => 'leads',

          ),

     

    Be sure to go to Admin > Repair > Quick Repair and Rebuild to have these changes stick.

     

    Kind Regards,

     

    Jason Smith

  • Hi

    Thanks for your reply.It worked..:)

    Could you please also help me to know what can we do in those cases where we need to hide a module based on conditions.Like for example in Accounts Module,If for some record there is no description available then we need to hide contacts module.

    How can we do this

  • Jason Smith

    Thanks so much for providing this answer back on November. Great help for me  One thing though. I tried it and found out that you seem to have accidentally left out one parenthesis, at least I got 500 error when commenting out just what you outline.

    However, commenting out or deleting this piece of code works:

    array (

          'layout' => "subpanel",

          'label' => 'LBL_LEADS_SUBPANEL_TITLE',

          'context' => array (

            'link' => 'leads',

          ),

    ),

    Thanks again,

    KGM

    Ent 

    7.7.1.0

Reply
  • Jason Smith

    Thanks so much for providing this answer back on November. Great help for me  One thing though. I tried it and found out that you seem to have accidentally left out one parenthesis, at least I got 500 error when commenting out just what you outline.

    However, commenting out or deleting this piece of code works:

    array (

          'layout' => "subpanel",

          'label' => 'LBL_LEADS_SUBPANEL_TITLE',

          'context' => array (

            'link' => 'leads',

          ),

    ),

    Thanks again,

    KGM

    Ent 

    7.7.1.0

Children