Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Remove Subpanels in 5.0 - There's gotta be a way

  1. #1
    AnalyticalAviation is offline Sugar Community Member
    Join Date
    May 2006
    Posts
    33

    Default Remove Subpanels in 5.0 - There's gotta be a way

    I have deployed older versions of sugar and was able to remove the subpanels by commenting out code. I have read that this is not possible in 5.0....Is that true? Surley we can find a way to display only the subpanel we are interested in. Any help is appriciated.

    Thanks!

  2. #2
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    852

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    handling subpanels is in /{module}/metadata/subpaneldefs.php
    if you remove this file, no subpanels will be shown
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  3. #3
    AnalyticalAviation is offline Sugar Community Member
    Join Date
    May 2006
    Posts
    33

    Thumbs up Re: Remove Subpanels in 5.0 - There's gotta be a way

    I guess I should qualify my question a little better. I would like to use some of the subpanels but not all. Can we edit this file to deselect (Comment out) or add code to select the subpanels to display?

    -----------------------------------------------

    Okay - got it. The file was pretty spread out and I didn't scroll down far enough. I found everything I needed and I'm on track now. Thanks!
    Last edited by AnalyticalAviation; 2007-12-22 at 06:15 PM. Reason: Solved

  4. #4
    cchufook is offline Member
    Join Date
    Jul 2007
    Posts
    7

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    Can you share with us what exactly you did?

  5. #5
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    Quote Originally Posted by cchufook
    Can you share with us what exactly you did?
    If you want to remove a subpanel from a module, open the subpaneldefs.php for that module.
    For example, if you want to remove the bugs subpanel from accounts module, open this file:
    sugar-root\modules\Accounts\metadata\subpaneldefs.php
    scroll it until you find this:
    'bugs' => array(
    then remove or comment all this chunk of code:

    'bugs' => array(
    'order' => 100,
    'sort_order' => 'desc',
    'sort_by' => 'bug_number',
    'module' => 'Bugs',
    'subpanel_name' => 'default',
    'get_subpanel_data' => 'bugs',
    'add_subpanel_data' => 'bug_id',
    'title_key' => 'LBL_BUGS_SUBPANEL_TITLE',
    'top_buttons' => array(
    array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    ),
    ),
    What do you think the cookie monster eats ?

  6. #6
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    I tried that but when I comment out the code or even remove it I can no longer move the subpanels.

  7. #7
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    Quote Originally Posted by bstonehill
    I tried that but when I comment out the code or even remove it I can no longer move the subpanels.
    Ok, let's try an upgrade-safer way.
    Create a file, call it layoutdefs.ext.php and put this code in it:
    PHP Code:
    <?php
     
    unset($layout_defs['Accounts']['subpanel_setup']['activities']);
    ?>
    Substitute Accounts with the module you are in and activities with the subpanel you want to remove.
    Place this file in custom/modules/Accounts/Ext/Layoutdefs
    if it doesn't work, place it in custom/Extension/modules/Accounts/Ext/Layoutdefs.
    What do you think the cookie monster eats ?

  8. #8
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    Well, that did get rid of the subpanel, but I still encounter the same problem of not being able to move the subpanels. I still get the move pointer when I mouseover but it only highlights, won't move.

    The layoutdefs.ext.php file already existed in the first location so I just added that line at the bottom, which caused the same problem. I tried creating the file in the second location but that had no effect whatsoever.

    I can't see any reason that this should interfere with anything.

    Unmodified Code:
    Code:
    $layout_defs['Accounts'] = array(
    	// list of what Subpanels to show in the DetailView 
    	'subpanel_setup' => array(
    
    		'activities' => array(
    			'order' => 10,
    			'sort_order' => 'desc',
    			'sort_by' => 'date_start',
    			'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
    			'type' => 'collection',
    			'subpanel_name' => 'activities',   //this values is not associated with a physical file.
    			'header_definition_from_subpanel'=> 'meetings',
    			'module'=>'Activities',
    			
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopCreateTaskButton'),
    				array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
    				array('widget_class' => 'SubPanelTopScheduleCallButton'),
    				array('widget_class' => 'SubPanelTopComposeEmailButton'),
    			),	
    					
    			'collection_list' => array(	
    				'meetings' => array(
    					'module' => 'Meetings',
    					'subpanel_name' => 'ForActivities',
    					'get_subpanel_data' => 'meetings',
    				),
    				'tasks' => array(
    					'module' => 'Tasks',
    					'subpanel_name' => 'ForActivities',
    					'get_subpanel_data' => 'tasks',
    				),
    				'calls' => array(
    					'module' => 'Calls',
    					'subpanel_name' => 'ForActivities',
    					'get_subpanel_data' => 'calls',
    				),	
    			)			
    		),
    		'history' => array(
    			'order' => 20,
    			'sort_order' => 'desc',
    			'sort_by' => 'date_modified',
    			'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
    			'type' => 'collection',
    			'subpanel_name' => 'history',   //this values is not associated with a physical file.
    			'header_definition_from_subpanel'=> 'meetings',
    			'module'=>'History',
    			
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopCreateNoteButton'),
    				array('widget_class' => 'SubPanelTopArchiveEmailButton'),
                	array('widget_class' => 'SubPanelTopSummaryButton'),
    			),	
    					
    			'collection_list' => array(	
    				'meetings' => array(
    					'module' => 'Meetings',
    					'subpanel_name' => 'ForHistory',
    					'get_subpanel_data' => 'meetings',
    				),
    				'tasks' => array(
    					'module' => 'Tasks',
    					'subpanel_name' => 'ForHistory',
    					'get_subpanel_data' => 'tasks',
    				),
    				'calls' => array(
    					'module' => 'Calls',
    					'subpanel_name' => 'ForHistory',
    					'get_subpanel_data' => 'calls',
    				),	
    				'notes' => array(
    					'module' => 'Notes',
    					'subpanel_name' => 'ForHistory',
    					'get_subpanel_data' => 'notes',
    				),	
    				'emails' => array(
    					'module' => 'Emails',
    					'subpanel_name' => 'ForHistory',
    					'get_subpanel_data' => 'emails',
    				),	
    				'linkedemails' => array(
    	                'module' => 'Emails',
    	                'subpanel_name' => 'ForUnlinkedEmailHistory',
    	                'get_subpanel_data' => 'function:get_unlinked_email_query',
    	                'generate_select'=>true,
    	                'function_parameters' => array('return_as_array'=>'true'),
    	    		),          
    			)			
    		),
    		'contacts' => array(
    			'order' => 30,
    			'module' => 'Contacts',
    			'sort_order' => 'asc',
    			'sort_by' => 'last_name, first_name',
    			'subpanel_name' => 'ForAccounts',
    			'get_subpanel_data' => 'contacts',
    			'add_subpanel_data' => 'contact_id',
    			'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopCreateAccountNameButton'),
    				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    			),
    		),		
    		'opportunities' => array(
    			'order' => 40,
    			'module' => 'Opportunities',
    			'subpanel_name' => 'ForAccounts',
    			'sort_order' => 'desc',
    			'sort_by' => 'date_closed',
    			'get_subpanel_data' => 'opportunities',
    			'add_subpanel_data' => 'opportunity_id',
    			'title_key' => 'LBL_OPPORTUNITIES_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    			),
    		),
    		'leads' => array(
    			'order' => 50,
    			'module' => 'Leads',
    			'sort_order' => 'asc',
    			'sort_by' => 'last_name, first_name',
    			'subpanel_name' => 'default',
    			'get_subpanel_data' => 'leads',
    			'add_subpanel_data' => 'lead_id',
    			'title_key' => 'LBL_LEADS_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopCreateLeadNameButton'),
    				array('widget_class' => 'SubPanelTopSelectButton',
    					'popup_module' => 'Opportunities',
    					'mode' => 'MultiSelect', 
    				),
    			),
    		),
    		'cases' => array(
    			'order' => 60,
    			'sort_order' => 'desc',
    			'sort_by' => 'case_number',
    			'module' => 'Cases',
    			'subpanel_name' => 'ForAccounts',
    			'get_subpanel_data' => 'cases',
    			'add_subpanel_data' => 'case_id',
    			'title_key' => 'LBL_CASES_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopButtonQuickCreate', 'view'=>'AccountsQuickCreate'),
    				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    			),
    		),
    
    		'accounts' => array(
    			'order' => 90,
    			'sort_order' => 'asc',
    			'sort_by' => 'name',
    			'module' => 'Accounts',
    			'subpanel_name' => 'default',
    			'get_subpanel_data' => 'members',
    			'add_subpanel_data' => 'member_id',
    			'title_key' => 'LBL_MEMBER_ORG_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    			),
    		),
    		'bugs' => array(
    			'order' => 100,
    			'sort_order' => 'desc',
    			'sort_by' => 'bug_number',
    			'module' => 'Bugs',
    			'subpanel_name' => 'default',
    			'get_subpanel_data' => 'bugs',
    			'add_subpanel_data' => 'bug_id',
    			'title_key' => 'LBL_BUGS_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    			),
    		),
    		'project' => array(
    			'order' => 110,
    			'sort_order' => 'asc',
    			'sort_by' => 'name',
    			'module' => 'Project',
    			'subpanel_name' => 'default',
    			'get_subpanel_data' => 'project',
    			'add_subpanel_data' => 'project_id',
    			'title_key' => 'LBL_PROJECTS_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    			),		
    		),
        		
    	),	
    	
    );
    This is exactly what I removed:
    Code:
    		'bugs' => array(
    			'order' => 100,
    			'sort_order' => 'desc',
    			'sort_by' => 'bug_number',
    			'module' => 'Bugs',
    			'subpanel_name' => 'default',
    			'get_subpanel_data' => 'bugs',
    			'add_subpanel_data' => 'bug_id',
    			'title_key' => 'LBL_BUGS_SUBPANEL_TITLE',
    			'top_buttons' => array(
    				array('widget_class' => 'SubPanelTopButtonQuickCreate'),
    				array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect')
    			),
    		),

  9. #9
    DragonflyMaster is offline Sugar Community Member
    Join Date
    Dec 2007
    Location
    Rimini, Italy
    Posts
    1,421

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    Quote Originally Posted by bstonehill
    Well, that did get rid of the subpanel, but I still encounter the same problem of not being able to move the subpanels. I still get the move pointer when I mouseover but it only highlights, won't move.
    I haven't noticed this strange behaviour before, you are right.
    I don't know why it is so, all I can suggest is to define the layout first, moving subpanels as you want them to be, then place the code to remove those subpanels you don't want.
    The layoutdefs.ext.php file already existed in the first location so I just added that line at the bottom, which caused the same problem. I tried creating the file in the second location but that had no effect whatsoever.
    The first file is created from Sugar. If you put code there and then Repair Extensions, it will be overwritten.
    If you place code in the second file and Repair Extensions, your code will be copied to the first file.
    Last edited by DragonflyMaster; 2008-06-05 at 07:06 AM.
    What do you think the cookie monster eats ?

  10. #10
    bstonehill is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    Atlanta, GA
    Posts
    98

    Default Re: Remove Subpanels in 5.0 - There's gotta be a way

    Ok, thanks for all your help. I really appreciate it. Hopefully this will be addressed soon.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. remove redundant information from the subpanels
    By krokogras in forum Feature Requests
    Replies: 2
    Last Post: 2009-03-04, 12:51 PM
  2. How to remove subpanels from ex. Accounts ?
    By kyamktk4 in forum Developer Help
    Replies: 0
    Last Post: 2007-02-07, 01:00 PM
  3. Replies: 0
    Last Post: 2007-01-12, 10:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •