SugarCRM: remove buttons from the subpanels

Create a file on custom/modules/{ModuleName}/views/view.detail.php

Add the below codes:

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/json_config.php');
require_once('include/MVC/View/views/view.detail.php');

class {ModuleName}ViewDetail extends ViewDetail {

    function {ModuleName}ViewDetail()
    {
        parent::ViewDetail();
    }

    /**
     * Replaces all the buttons on the subpanels
     */
    function _displaySubPanels()
    {
	require_once ('include/SubPanel/SubPanelTiles.php');
	$subpanel = new SubPanelTiles($this->bean, $this->module);
	unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['']['top_buttons'][0]);
	unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['']['top_buttons'][1]);
	echo $subpanel->display();
    }
}
?>

Advertisements
SugarCRM: remove buttons from the subpanels

24 thoughts on “SugarCRM: remove buttons from the subpanels

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s