Hiding Panels

Hi,

hope you’re well.

I want to hide the projects sub panel on the contacts module.

I’ve been trying to follow the instructions on a thread but not getting any results.

Can you please advise whether the instructions below still apply to the latest version.

cheers

Craig

btw.


think I’m just being stupid.

I’m creating a file. mycustom.php. with just one line in it : unset($layout_defs[‘Contacts’][‘subpanel_setup’][‘projects’]);

putting it in the directory indicated, but no joy.

=================

Previous instructions from an old thread are…

to hide or remove sub panel

You have to add a new custom php file in
/custom/Extension/modules//Ext/

if you want to remove campaign subpanel from Leads module, add a mycustom.php in
/custom/Extension/modules/Leads/Ext/

with unset () function

unset($layout_defs[‘Leads’][‘subpanel_setup’][‘campaigns’]);

Then repair extensions, tour code will be added to
custom/modules//Ext/Layoutdefs/layoutdefs.ext.php

Try replacing your code with:

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

(note the lowercase letters in ‘projects’)

or with:

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

(sorry I give you two options but I haven’t tried it so I am not 100% sure which should work).

Then run Quick repair and rebuild.

Before doing anything I strongly recommend that you take a full backup of your whole SuiteCRM instance, including the database, or that you try applying these changes on a test instance that may be completely discarded.

Hi,

Thanks for responding. Greatly appreciated. I’ve tried the suggestions and still no joy. There are 3 directories in Ext (language, layoutdefs, vardefs). Have put the file in various locations and no change. Checked the relationship names and they are right. Also tried on a different module and is the same.

Any ideas what I’m doing wrong???

The directory in which you should put your file is:

custom/Extension/modules/Contacts/Ext/Layoutdefs/HideProjects.php

(The name of the file “HideProjects.php” is a name I invented. In therory you can name it the way you want. I have seen it being called also “layoutdefs.ext.php”).

Once done Run Quick Repair and Rebuild

Hi,

Hope you’re well. Thanks again for responding. Still not working, something else must be happening… I have put the file in the extensions area. with the code to remove documents

"unset($layout_defs[‘Contacts’][‘subpanel_setup’][‘documents_contacts’]); "

I run repair and check the module folder. in the ext layouts folder of contacts I can see a file “layoutdefs.ext.php”

The line above is in this file. The php is being found and the repair is updating the correct area yet the line above is not having any impact

Confused. Any ideas?

if you look inside the following file:

modules/Contacts/metadata/subpaneldefs.php

You will find towards the end the definition of the Projects subpanel:

$layout_defs['Contacts'] = array(
	// list of what Subpanels to show in the DetailView
		'subpanel_setup' => array(

...
...
...
		'project' => array(
			'order' => 110,
			'module' => 'Project',
			'sort_order' => 'asc',
			'sort_by' => 'name',
			'get_subpanel_data' => 'project',
			'subpanel_name' => 'default',
			'title_key' => 'LBL_PROJECTS_SUBPANEL_TITLE',
			'top_buttons' => array(
				array('widget_class' => 'SubPanelTopButtonQuickCreate'),
				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
			),
		),
...
...

therefore you have to unset:

$layout_defs['Contacts'] ['subpanel_setup' ]['project']

(sorry, before I put the extra letter ‘s’)

You can also try to comment the lines related to ‘project’ inside this file (not upgrade safe though) just to see what happens (take a back up before).

1 Like

Lift off!!!

That did it.

Thank you very much.

Cheers

Craig