Hide SubPanels

Hi,

I want to hide a bunch of subpanels on Accounts and Contacts.

I have found several posts on this, but they seem a little old and the directory structure seems a little different.

The advice seems to be “create a custom php file in custom/modules/Accounts/Ext/Layoutdefs/” with unsert lines to remove the elements from the subpanel_setup array.

I have created:
custom/modules/Accounts/Ext/Layoutdefs/disable-panels.php

<?php [code] unset($layout_defs['Accounts']['subpanel_setup']['bugs']); [/code] ?>

And hit repair / rebuild all. Nothing happens. Panels are not hidden.

If I add the unset lines to
custom/modules/Accounts/Ext/Layoutdefs/layoutdefs.ext.php

instead the panels are hidden instantly. However that file has an auto generation warning, so I want to avoid using it.

What am I missing?

Thanks,
Paul

you want to hide them just for those two modules or globally? because you know that there’s an option to hide globally right?

best regards

can’t you just hide them via the Admin UI?

Ah. Thanks. The title line on that page left me a little unsure, but, yes, it works… mostly.

Even though I disabled the Products module completely and hid it’s sub panel the “Products Purchased” appears on the Account detail view. So I hid that one with a custom unset. I expect there will be a few of these lurking around.

Anyway I solved my original problem.

… so it seems if I drop the custom file into:
custom/Extension/modules/Accounts/Ext/Layoutdefs/

instead it works on a Repair/Rebuild.

What is the best place for documentation, blogs, wiki’s for these kind of customisation? Is this forum the best place?

In version 7.10.5 what I did was just comment, //, in …/modules/Accounts/metadata/subpaneldefs.php:

//‘products_services_purchased’ => array(
// ‘order’ => 104,
//‘module’ => ‘AOS_Products_Quotes’,
//‘subpanel_name’ => ‘ForAccounts’,
//‘get_subpanel_data’ => ‘function//:getProductsServicesPurchasedQuery’,
//‘title_key’ => ‘LBL_PRODUCTS_SERVICES_PURCHASED_SUBPANEL_TITLE’,
//),

It worked, before and after Repair and Rebuild

I’m guessing it’s the equivalent of “unsetting” but I just commented out everything inside the subpanel definition file that was generated when the relatinoship was built.

So the contents of custom/Extension/modules/[MODULE]/Ext/Layoutdefs/[GENERATED_SUB_PANEL_FILE].php

For some reason the unset approach didn’t work for me

Guys, I have created a simple custom module for approval/rejection , I just want to hide the options in the “Action” button partially for the users untill the approval status becomes approved, by default the status will be pending at that time the user should not have any option in the Action button in detailview only when the status changes to approved ,all the options should be shown . Can anyone help me to do this by any ideas …