Results 1 to 5 of 5

Thread: Column Numbers

  1. #1
    cagatay is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Turkiye
    Posts
    72

    Default Column Numbers

    SugerCRM 5.0 supports defaultly 2 columns in a Panel (can be seen below)




    How can we increase the numbers of these columns (I need 4 columns)



    Note: 3. and 4. colums in this picture is just dummy (made in PS)

    Regards
    Last edited by cagatay; 2008-03-27 at 02:17 PM.

  2. #2
    cagatay is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Turkiye
    Posts
    72

    Default Re: Column Numbers

    Could someone help me? (also help most of Sugar users)

    Regards

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Column Numbers

    cagatay.

    Some time ago I read a post where the forums's member modified the editviewdefs inserting 4 rows at the layout, but when modifying the layout through Studio it shows only the default 2.

    So I believe you can do that, but without customize the layout using the Studio.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  4. #4
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Column Numbers

    Hi Cagatay -

    Similar to your other post, this is technically possible to do but you can't do it in Studio. You would have to modify the editviewdefs.php and detailviewdefs.php files by hand.

    Be sure to put customized fields in the proper place in the custom directory to preserve customizations during an upgrade. Also note that you would no longer be able to use Studio with the 4 column layout as it doesn't understand anything but two columns.

    To get you started down this path, here is a sample code snipped of two column layout vs a four column layout for ./custom/modules/Accounts/metadata/editviewdefs.php.

    The key is the number of fields defined in each array:

    Two column layout:
    PHP Code:
          'panels' => 
          array (
            
    'Account Information' => 
            array (
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'name',
                  
    'displayParams' => 
                  array (
                    
    'required' => true,
                  ),
                  
    'label' => 'LBL_NAME',
                ),
                
    => 
                array (
                  
    'name' => 'phone_office',
                  
    'label' => 'LBL_PHONE_OFFICE',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'website',
                  
    'type' => 'link',
                  
    'label' => 'LBL_WEBSITE',
                ),
                
    => 
                array (
                  
    'name' => 'phone_fax',
                  
    'label' => 'LBL_FAX',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'ticker_symbol',
                  
    'label' => 'LBL_TICKER_SYMBOL',
                ),
                
    => 
                array (
                  
    'name' => 'phone_alternate',
                  
    'label' => 'LBL_PHONE_ALT',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'parent_name',
                  
    'label' => 'LBL_MEMBER_OF',
                ),
                
    => 
                array (
                  
    'name' => 'employees',
                  
    'label' => 'LBL_EMPLOYEES',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'ownership',
                  
    'label' => 'LBL_OWNERSHIP',
                ),
                
    => 
                array (
                  
    'name' => 'rating',
                  
    'label' => 'LBL_RATING',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'industry',
                  
    'label' => 'LBL_INDUSTRY',
                ),
                
    => 
                array (
                  
    'name' => 'sic_code',
                  
    'label' => 'LBL_SIC_CODE',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'account_type',
                  
    'label' => 'LBL_TYPE',
                ),
                
    => 
                array (
                  
    'name' => 'annual_revenue',
                  
    'label' => 'LBL_ANNUAL_REVENUE',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'team_name',
                  
    'displayParams' => 
                  array (
                    
    'display' => true,
                  ),
                  
    'label' => 'LBL_TEAM',
                ),
                
    => NULL,
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'assigned_user_name',
                  
    'label' => 'LBL_ASSIGNED_TO_NAME',
                ),
                
    => 
                array (
                  
    'name' => 'testdate_c',
                  
    'label' => 'LBL_TESTDATE',
                ),
              ),
            ), 
    Four column layout:
    PHP Code:
          'panels' => 
          array (
            
    'Account Information' => 
            array (
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'name',
                  
    'displayParams' => 
                  array (
                    
    'required' => true,
                  ),
                  
    'label' => 'LBL_NAME',
                ),
                
    => 
                array (
                  
    'name' => 'phone_office',
                  
    'label' => 'LBL_PHONE_OFFICE',
                ),
                
    => 
                array (
                  
    'name' => 'website',
                  
    'type' => 'link',
                  
    'label' => 'LBL_WEBSITE',
                ),
                
    => 
                array (
                  
    'name' => 'phone_fax',
                  
    'label' => 'LBL_FAX',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'ticker_symbol',
                  
    'label' => 'LBL_TICKER_SYMBOL',
                ),
                
    => 
                array (
                  
    'name' => 'phone_alternate',
                  
    'label' => 'LBL_PHONE_ALT',
                ),
                
    => 
                array (
                  
    'name' => 'parent_name',
                  
    'label' => 'LBL_MEMBER_OF',
                ),
                
    => 
                array (
                  
    'name' => 'employees',
                  
    'label' => 'LBL_EMPLOYEES',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'ownership',
                  
    'label' => 'LBL_OWNERSHIP',
                ),
                
    => 
                array (
                  
    'name' => 'rating',
                  
    'label' => 'LBL_RATING',
                ),
                
    => 
                array (
                  
    'name' => 'industry',
                  
    'label' => 'LBL_INDUSTRY',
                ),
                
    => 
                array (
                  
    'name' => 'sic_code',
                  
    'label' => 'LBL_SIC_CODE',
                ),
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'account_type',
                  
    'label' => 'LBL_TYPE',
                ),
                
    => 
                array (
                  
    'name' => 'annual_revenue',
                  
    'label' => 'LBL_ANNUAL_REVENUE',
                ),
                
    => 
                array (
                  
    'name' => 'team_name',
                  
    'displayParams' => 
                  array (
                    
    'display' => true,
                  ),
                  
    'label' => 'LBL_TEAM',
                ),
                
    => NULL,
              ),
              
    => 
              array (
                
    => 
                array (
                  
    'name' => 'assigned_user_name',
                  
    'label' => 'LBL_ASSIGNED_TO_NAME',
                ),
                
    => 
                array (
                  
    'name' => 'testdate_c',
                  
    'label' => 'LBL_TESTDATE',
                ),
              ),
            ), 
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  5. #5
    tomnzyoung is offline Junior Member
    Join Date
    Jul 2007
    Location
    Christchurch, New Zealand
    Posts
    142

    Default Re: Column Numbers

    Just to add to Clint's reply, also be sure to change the 'maxColumns' entry in templateMeta section of the editviewdefs.php or detailviewdefs.php to 3 or 4 or whatever you need. You'll have to do that manually, so save it in custom/<module name>/metadata/ and then you can either go on as Clint detailed to add the extra fields by hand to each row, or you can in fact use Studio from now on.

    Studio currently doesn't have a way to make the change from 2 column, but it does read and understand that maxColumns entry. Your layouts in Studio will look a little ugly once you go beyond 2 columns (the third and fourth fields in a row will probably appear below the first and second fields for example), but the drag-and-drops all work, and the layouts are saved correctly. And if you make the maxColumns change first, load the layout in Studio, and then save it, Studio will add the extra fields in for you. It adds them in as emptys with the last added field in a row as a filler, so it will need work, but it may be quicker than adding them in manually.

    Of course, this isn't something Studio is intended to do, so your results may vary, but we built the backend to be able to handle it, and I'd like to see it tidied up and made official in a future release - it's not such a big job with the new MVC layouts.

    Cheers,
    Tom

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Manually drop scheme (5.0 upgrade) ?
    By niallhannon in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2008-01-07, 05:41 PM
  2. Replies: 5
    Last Post: 2007-11-13, 02:51 PM
  3. Server error: ALTER TABLE ALTER COLUMN failed
    By barrandray in forum Installation and Upgrade Help
    Replies: 4
    Last Post: 2007-07-24, 10:05 PM
  4. Replies: 1
    Last Post: 2006-09-11, 03:38 PM
  5. SugarCrm 4.0 Patch
    By mgamboa in forum General Discussion
    Replies: 0
    Last Post: 2005-12-21, 04:14 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
  •