Results 1 to 7 of 7

Thread: Moving sub-panels

  1. #1
    ndaniels is offline Sugar Community Member
    Join Date
    Nov 2006
    Posts
    24

    Default Moving sub-panels

    Sugar 4.2 OS
    In 'Cases', we want to move the History sub-panel from the bottom of the page to the top of the sub-panels, just under the actual case details. In theory this should be easy, using Field Editor and Edit Layout.

    From the docs: 'Edit Layout: drag and rearrange individual fields or their labels. Select the item handle Slot next to the field or label you want to move, and click on the item handle where you want the field or label located. This will move the item from its previous location to its new location. If there was already a field or label at the destination the two items will swap positions. Moving sub-panels is the same as moving fields; select on the source sub-panel handle and destination handle and the two will switch locations. To remove a field or form from the screen, drag the item to the Toolbox area in the left menu bar."

    All well and good, except that when I open modules/Cases/DetailView for editing I don't see any of the sub-panels, regardless of whether or not I select the History sub-panel when doing "Select A File". I'm quite willing to believe that I'm doing something wrong here, but I can't figure out how to do what the docs say should be easy.

    Any thoughts/hints from the experts?
    TIA....

  2. #2
    leenwebb is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    New Hampshire
    Posts
    77

    Default Re: Moving sub-panels

    When you say "when I open modules/Cases/DetailView for editing I don't see any of the sub-panels", does that mean you don't see them in code? Or in studio? Or you don't see them, period -- ever?

    I think the 'proper' answer to this lies in modules/Cases/layout_defs.php, but honestly I have had very little luck with that file. Here's what I did to accomplish something similar:

    Go to include/SubPanel/SubPanelDefinitions.php. Around line 325, you should see the line:
    Code:
    return $this->_visible_tabs_array;
    That's where your SubPanels get set (in the visible_tabs_array). I wrote a little snippet of code that overwrites the array with the subpanels I want, in the order I want:

    Code:
    $class_type = get_class($this->_focus);
    		
    // This stuff is useful for making your own list of subpanel tabs
    /*
    echo '<br /> This is the original array of tabs: <br />';
    print_r($this->_visible_tabs_array);
    echo '<br /> This is the class of the page:<br />';
    echo $class_type;
    echo '<br />';
    */
    
    if ($class_type == 'Call'){
    $this->_visible_tabs_array = array(10 => contacts);
    }
    if ($class_type == 'Meeting'){
    $this->_visible_tabs_array = array(10 => contacts);
    }
    if ($class_type == 'Contact'){
    $this->_visible_tabs_array = array(10 => activities, 20=> history);
    }
    if ($class_type == 'Account'){
    $this->_visible_tabs_array = array(10 => contacts);
    }
    
    return $this->_visible_tabs_array;
    The very first line grabs the class (Account for accounts, Call for call, etc). Then the if() statements just redefine the array how I see fit. If you make "History" the first thing in the array ('10'), it will display first. You can fill in the rest of the array in the order you like, or make most of the panels go away (like I did).

    If you uncomment that little bit of code at the top, it should print out the current array and class so that you have a place to start.

    Good luck!
    Eileen
    Last edited by leenwebb; 2006-12-20 at 10:25 PM. Reason: typo!

  3. #3
    ndaniels is offline Sugar Community Member
    Join Date
    Nov 2006
    Posts
    24

    Default Re: Moving sub-panels

    Thanks, Eileen.
    You ask: "does that mean you don't see them in code? Or in studio?"
    I don't see the sub-panels (which are normally below the Cases-DetailView pane) when I open that with Studio (Field Layout). My read of the documentation is that I "should" be seeing them there, but......

  4. #4
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: Moving sub-panels

    Actually, they can be moved in the DetailView now (not even in the Studio). When viewing a record, just mouseover the top of a subpanel and a directional cursor should take over. Drag the subpanel to the desired spot.
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  5. #5
    ndaniels is offline Sugar Community Member
    Join Date
    Nov 2006
    Posts
    24

    Default Re: Moving sub-panels

    Thanks, Julian - I really, really wished that worked. But when I mouseover the sub-panel (History, in this case) I don't get a directional cursor at all. If I mouseover the South East pointing arrow next to the word "History" (above the panel itself) I can get a cursor which is a circle with a slash through it, but it does not help me move that sub-panel. Mouseover on any other area does nothing.
    Is the 'directional cursor' functionality something which comes with 4.5 (or some version other than 4.2 OS) ? If so, that becomes yet another reason why we might want to upgrade.

  6. #6
    leenwebb is offline Sugar Community Member
    Join Date
    Nov 2006
    Location
    New Hampshire
    Posts
    77

    Default Re: Moving sub-panels

    I've never been able to see my subpanels in Studio, either. Hence my hacky-workaround (wacky-horkaround?!).

    I am, however, able to drag around my subpanels on the actual DetailView page (I'm using 4.5, so maybe that is a version difference? ), but that only changes it for the current user. I wanted to have everyone see the same subpanels in the same order, which is why I put my changes in the code.

    Good luck!

  7. #7
    ndaniels is offline Sugar Community Member
    Join Date
    Nov 2006
    Posts
    24

    Default Re: Moving sub-panels

    Thanks, again, Eileen.
    I'll implement the work-around. I think that you're correct that moving them on the screen is a 4.5 improvement, yet another reason to push for upgrading.
    I'm sure I'll have other dumb questions soon!

Thread Information

Users Browsing this Thread

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

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
  •