Results 1 to 2 of 2

Thread: Add Create Button in Subpanel

  1. #1
    lenz1979 is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    68

    Default Add Create Button in Subpanel

    Hello!

    I got a working sugarcrm which i should extend some functionality.

    a project module has a relationship with contscts.
    The subpanel shows in the detailview of the project but the "create"-button is not visible. Only the select button.


    custom/Extensions/modules/Project/Ext/Layoutdefs/_overrideProjectContactsdefault.php:
    PHP Code:
    $layout_defs['Project']['subpanel_setup']['contacts']['override_subpanel_name'] = 'Projectdefault'

    custom/modules/Contacts/metadata/Projectdefault.php:
    PHP Code:
    <?php
    // created: 2009-09-25 10:58:23
    $subpanel_layout['list_fields'] = array (
      
    'name' =>
      array (
        
    'name' => 'name',
        
    'vname' => 'LBL_LIST_NAME',
        
    'sort_by' => 'last_name',
        
    'sort_order' => 'asc',
        
    'widget_class' => 'SubPanelDetailViewLink',
        
    'module' => 'Contacts',
        
    'width' => '23%',
        
    'default' => true,
      ),
      
    'testroberttechnik_c' =>
      array (
        
    'name' => 'testroberttechnik_c',
        
    'vname' => 'Funktion',
        
    'width' => '10%',
        
    'default' => true,
      ),
      
    'account_name' =>
      array (
        
    'name' => 'account_name',
        
    'module' => 'Accounts',
        
    'target_record_key' => 'account_id',
        
    'target_module' => 'Accounts',
        
    'widget_class' => 'SubPanelDetailViewLink',
        
    'vname' => 'LBL_LIST_ACCOUNT_NAME',
        
    'width' => '22%',
        
    'sortable' => false,
        
    'default' => true,
      ),
      
    'email1' =>
      array (
        
    'name' => 'email1',
        
    'vname' => 'LBL_LIST_EMAIL',
        
    'widget_class' => 'SubPanelEmailLink',
        
    'width' => '30%',
        
    'sortable' => false,
        
    'default' => true,
      ),
      
    'phone_work' =>
      array (
        
    'name' => 'phone_work',
        
    'vname' => 'LBL_LIST_PHONE',
        
    'width' => '15%',
        
    'default' => true,
      ),
      
    'edit_button' =>
      array (
        
    'vname' => 'LBL_EDIT_BUTTON',
        
    'widget_class' => 'SubPanelEditButton',
        
    'module' => 'Contacts',
        
    'width' => '5%',
        
    'default' => true,
      ),
      
    'remove_button' =>
      array (
        
    'vname' => 'LBL_REMOVE',
        
    'widget_class' => 'SubPanelRemoveButton',
        
    'module' => 'Contacts',
        
    'width' => '5%',
        
    'default' => true,
      ),
      
    'first_name' =>
      array (
        
    'name' => 'first_name',
        
    'usage' => 'query_only',
      ),
      
    'last_name' =>
      array (
        
    'name' => 'last_name',
        
    'usage' => 'query_only',
      ),
      
    'account_id' =>
      array (
        
    'usage' => 'query_only',
      ),
    );

    ?>

    i can not find any subpanel_setup for this relation....

    i use 5.2.0a

    The person who worked on this sugarcrm before is no longer available so i have to do the changes.



    Does anybody know how i can set this CreateButton visible in the Contacts Subpanel?

    many thanks for any ideas!

    regards

  2. #2
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Add Create Button in Subpanel

    Hi,

    Look here

    PHP Code:
    $subpanel_layout = array(
        
    'top_buttons' => array(
           array(
    'widget_class' => 'SubPanelTopCreateButton'),
           array(
    'widget_class' => 'SubPanelTopSelectButton''popup_module' => 'Campaigns'),
        ),

        
    'where' => '',

    'list_fields' => array(
            
    'name'=>array(
            
    'name' => 'name',
             
    'vname' => 'LBL_LIST_CAMPAIGN_NAME',
            
    'widget_class' => 'SubPanelDetailViewLink',
            
    'width' => '85%',
           ),
            
    'status'=>array(
                 
    'name' => 'status',
                 
    'vname' => 'LBL_LIST_STATUS',
                
    'width' => '15%',
            ),
            
    'edit_button'=>array(
                
    'vname' => 'LBL_EDIT_BUTTON',
                
    'widget_class' => 'SubPanelEditButton',
                 
    'module' => 'Campaigns',
                
    'width' => '5%',
            ),
            
    'remove_button'=>array(
                
    'vname' => 'LBL_REMOVE',
                
    'widget_class' => 'SubPanelRemoveButton',
                 
    'module' => 'Campgains',
                
    'width' => '5%',
            ),
        ),
    ); 

    Just add this section


    PHP Code:
    'top_buttons' => array( 
           array(
    'widget_class' => 'SubPanelTopCreateButton'), 
           array(
    'widget_class' => 'SubPanelTopSelectButton''popup_module' => 'Campaigns'), 
        ), 
    Last edited by AlexAv; 2011-03-09 at 06:38 AM.
    Letrium ltd. - Only high quality service
    http://letrium.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Remove Create button in Subpanel
    By Tryphan in forum Developer Help
    Replies: 15
    Last Post: 2011-07-28, 04:53 AM
  2. How to create Button in Subpanel?
    By shyam007 in forum Developer Help
    Replies: 1
    Last Post: 2009-04-09, 11:53 AM
  3. Button Create in subpanel
    By h2sqr in forum Developer Help
    Replies: 3
    Last Post: 2008-11-05, 09:42 AM
  4. how to disable the 'create' top button in subpanel?
    By yanyan in forum Developer Help
    Replies: 4
    Last Post: 2008-10-09, 07:39 AM
  5. Subpanel, button create
    By cleartic in forum Developer Help
    Replies: 5
    Last Post: 2008-06-25, 04:25 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
  •