Results 1 to 8 of 8

Thread: Help with Subpanels Tab?

  1. #1
    ebizusers is offline Member
    Join Date
    Jan 2010
    Posts
    6

    Default Help with Subpanels Tab?

    Hi,

    This is the first time i am using SugarCRM. My customer want to custoize the Contacts page. Instead of showing subpanel inside the tabs, i want to show each subpanel in a seperate tab. For example, i want to show "History" in a separate tab instead of showing it under the "Activities" tab. Can someone please give me a suggestion? I searched the site and could not find the answer to it. I am using SugarCRM 5.2.0h, Apache, Windows and SQL Server 2005.

    Thanks
    Ebizuser.

  2. #2
    mapm's Avatar
    mapm is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    Portugal
    Posts
    239

    Default Re: Help with Subpanels Tab?

    Try to read this first: http://developers.sugarcrm.com/
    --
    Mário Pereira Martins

    Javali - Administração e Desenvolvimento de Sistemas Informáticos, Lda.
    Madan Parque Edifício VI Campus da FCT/UNL
    Quinta da Torre 2829-516 Caparica Portugal
    Phone: +351 212949666 Fax: +351 212948313
    http://www.javali.pt

  3. #3
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Help with Subpanels Tab?

    Hi ebizusers,

    The file <sugarcrm>/include/tabConfig.php contains the original tab definitions. The file <sugarcrm>/custom/include/tabConfig.php (if it exists) is loaded later so overrides definitions in both and since it's in the custom folder it is upgrade-safe.

    Look at these files and you should be able to figure it out, but you'll need to add labels and other similar steps for what you want to do. Also, I believe Studio writes this file, so keep a backup of your changes and be careful with studio changes like new modules as they may get automatically added to all your new single function tabs so they're not single function anymore.

    Phil

  4. #4
    ebizusers is offline Member
    Join Date
    Jan 2010
    Posts
    6

    Default Re: Help with Subpanels Tab?

    Hi,

    Thanks for the reply.. I did the necessary changes to show history in a new Tab. Now i am having a problem. When i click on the "History" tab for the first time, it's not getting loaded. When i checked the query, there was no problem to it and also the code to display the listview, it is displaying correctly. Why wasn't it shown the first time it was clicked? I have the same problem when i click on the other tab too.. I tried debugging but i am not able to find the problem and the solution. Can someone help me out?

    Thanks,
    Ebizuser.

  5. #5
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Help with Subpanels Tab?

    Quote Originally Posted by ebizusers View Post
    Hi,

    Thanks for the reply.. I did the necessary changes to show history in a new Tab. Now i am having a problem. When i click on the "History" tab for the first time, it's not getting loaded. When i checked the query, there was no problem to it and also the code to display the listview, it is displaying correctly. Why wasn't it shown the first time it was clicked? I have the same problem when i click on the other tab too.. I tried debugging but i am not able to find the problem and the solution. Can someone help me out?

    Thanks,
    Ebizuser.
    I haven't seen this, but looking at the tabConfig.php file, it lists more modules than sub-panels that get shown. I suspect it loads data from the other modules even when they don't have their own sub-panel. For example, the HIstory subpanel shows data from Notes, Tasks, Calls, Emails, etc.

    So if you created a new tabConfig.php and put only "History" in it, it would have no data to populate the sub-panel.

    For example, here is the original definition of the Activities tab:

    PHP Code:
        "LBL_TABGROUP_ACTIVITIES" => array(
            
    'label' => 'LBL_TABGROUP_ACTIVITIES',
            
    'modules' => array(
                
    "Activities",
                
    "Calendar",
                
    "Emails",
                
    "Calls",
                
    "Meetings",
                
    "Tasks",
                
    "Notes",
            )
        ), 
    Note that it includes modules "Calendar", "Emails", "Calls", "Meetings", "Tasks", "Notes", but they are only shown in the Activities subpanel or the History subpanel (depending on whether they are completed or not).

    So try including the child modules (that have no subpanel definitions of their own).

    But I don't know what you put in your new tabConfig.php file, so I may be way off base. If that doesn't fix it, feel free to post your new definition.

    Phil

  6. #6
    ebizusers is offline Member
    Join Date
    Jan 2010
    Posts
    6

    Default Re: Help with Subpanels Tab?

    Hi,
    The following is the code that is generated by the Studio when i create a new "History" Tab.

    TabConfig.php

    Code:
    <?php
    // created: 2010-02-02 04:11:22
    $GLOBALS['tabStructure'] = array (
      'LBL_TABGROUP_HOME' => 
      array (
        'label' => 'LBL_TABGROUP_HOME',
        'modules' => 
        array (
          0 => 'Home',
          1 => 'Dashboard',
        ),
      ),
      'LBL_TABGROUP_TOOLS' => 
      array (
        'label' => 'LBL_TABGROUP_TOOLS',
        'modules' => 
        array (
          0 => 'Feeds',
          1 => 'iFrames',
        ),
      ),
      'LBL_TABGROUP_REPORTS' => 
      array (
        'label' => 'LBL_TABGROUP_REPORTS',
        'modules' => 
        array (
          0 => 'undefined',
          1 => 'Dashboard',
        ),
      ),
      'LBL_GROUPTAB3_1265004998' => 
      array (
        'label' => 'LBL_GROUPTAB3_1265004998',
        'modules' => 
        array (
          0 => 'Calendar',
          1 => 'Emails',
          2 => 'Meetings',
          3 => 'Tasks',
          4 => 'Notes',
          5 => 'Calls',
        ),
      ),
      'LBL_GROUPTAB5_1265004998' => 
      array (
        'label' => 'LBL_GROUPTAB5_1265004998',
        'modules' => 
        array (
          0 => 'Activities',
          1 => 'Calendar',
          2 => 'Emails',
          3 => 'Meetings',
          4 => 'Tasks',
          5 => 'Notes',
          6 => 'Calls',
        ),
      ),
      
    );
    ?>
    I then changed the following code in SubPanelTilesTab.php

    Previous code

    Code:
    /* Move history to same tab as activities */
            if(in_array('history', $tabs) && in_array('activities', $tabs))
            {
                foreach($groups as $mainTab => $group)
                {
                	if(in_array('activities', array_map('strtolower', $group['modules'])))
                    {
                    	if(!in_array('history', array_map('strtolower', $group['modules'])))
                        {
                        	/* Move hist from there to here */
                            $groups[$mainTab]['modules'] []= 'history';
                        }
                    }
                    else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules']))))
                    {
                        unset($groups[$mainTab]['modules'][$i]);
                        if(empty($groups[$mainTab]['modules']))
                        {
                        	unset($groups[$mainTab]);
                        }
                    }                
                }
            }
    Changed Code

    Code:
    /* Move history to same tab as activities */
            if(in_array('history', $tabs) && in_array('activities', $tabs))
            {
                foreach($groups as $mainTab => $group)
                {
         /*
         * Commented the following code for not adding the history to where activities is present.
         */
    
    //                if(in_array('activities', array_map('strtolower', $group['modules'])))
    //                {
    //                	if(!in_array('history', array_map('strtolower', $group['modules'])))
    //                    {
    //                    	/* Move hist from there to here */
    //                        $groups[$mainTab]['modules'] []= 'history';
    //                    }
    //                }
    //                else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules']))))
    //                {
    //                    unset($groups[$mainTab]['modules'][$i]);
    //                    if(empty($groups[$mainTab]['modules']))
    //                    {
    //                    	unset($groups[$mainTab]);
    //                    }
    //                }
                    // Code added  to assign history to "History" Tab
                    if ($mainTab == "History")
                    {
                        $groups[$mainTab]['modules'] []= 'history';
                    }
                }
            }
    These are the only changes that i did. Even when i rollbacked the issue still persists.. Please help me out..

    Thanks

  7. #7
    datasponge is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    San Jose, CA, USA
    Posts
    553

    Default Re: Help with Subpanels Tab?

    I've never edited SubPanelTilesTab.php, so don't have experience with this. But if you rolled back your changes, then it should have restored the prior behavior.

    I can only point out the obvious to make sure you do a Quick Repair and Rebuild after editing any custom files.

    Phil

  8. #8
    LegalPlans is offline Member
    Join Date
    Oct 2007
    Posts
    11

    Default Re: Help with Subpanels Tab?

    I had the same issue. You need to comment all that code out.


    Code:
    /* Move history to same tab as activities */
    //        if(in_array('history', $tabs) && in_array('activities', $tabs))
    //        {
    //            foreach($groups as $mainTab => $group)
    //            {
         /*
         * Commented the following code for not adding the history to where activities is present.
         */
    
    //                if(in_array('activities', array_map('strtolower', $group['modules'])))
    //                {
    //                	if(!in_array('history', array_map('strtolower', $group['modules'])))
    //                    {
    //                    	/* Move hist from there to here */
    //                        $groups[$mainTab]['modules'] []= 'history';
    //                    }
    //                }
    //                else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules']))))
    //                {
    //                    unset($groups[$mainTab]['modules'][$i]);
    //                    if(empty($groups[$mainTab]['modules']))
    //                    {
    //                    	unset($groups[$mainTab]);
    //                    }
    //                }
                    // Code added  to assign history to "History" Tab
    //                if ($mainTab == "History")
    //                {
    //                    $groups[$mainTab]['modules'] []= 'history';
    //                }
    //            }
    //        }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. subpanels
    By monicaDC in forum Help
    Replies: 0
    Last Post: 2009-07-11, 06:46 PM
  2. Replies: 0
    Last Post: 2008-04-24, 10:50 AM
  3. Replies: 0
    Last Post: 2008-04-24, 10:40 AM
  4. Replies: 20
    Last Post: 2008-04-24, 10:35 AM
  5. Replies: 2
    Last Post: 2008-04-19, 12:16 AM

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
  •