Results 1 to 8 of 8

Thread: HOW to remove select button from subpanel ?

  1. #1
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Question HOW to remove select button from subpanel ?

    Hi, I want to remove the SELECT button from module Project with subpanel Calls. Where to do that?

    Thankss
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  2. #2
    matthew's Avatar
    matthew is offline Sugar Team Member
    Join Date
    Jul 2005
    Posts
    533

    Default Re: HOW to remove select button from subpanel ?

    Where do you want to remove the SELECT button? can you post a screen shot highlighting?

    If it's for calls - it may prove to be difficult, b/c that's a mixture of meetings, tasks, emails, calls.

    Sugar University for training
    Sugar Wiki for developer and user help
    SugarForge for modules, themes, lang packs
    SugarExchange for production-ready extensions
    Enter/view bugs via the Sugar bug tracker

  3. #3
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: HOW to remove select button from subpanel ?

    Quote Originally Posted by matthew View Post
    Where do you want to remove the SELECT button? can you post a screen shot highlighting?

    If it's for calls - it may prove to be difficult, b/c that's a mixture of meetings, tasks, emails, calls.
    Hi matthew,

    It is indeed for calls. Here you can see the screenshot. Hope you can help me.
    Thanks in advance!
    Attached Images Attached Images  
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  4. #4
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: HOW to remove select button from subpanel ?

    In a raw way you can just copy the code from the file in modules/Calls/metadata/subpanels/default.php in the same location and rename it as ForProjects.php for example. In the new file you comment the code refering the select button:
    PHP Code:
    array (
                  
    'widget_class'=>'SubPanelTopSelectButton''popup_module' => 'Calls'
                    
    ), 
    You will also have to tell Project to take the new subpanel file.

    But in an upgrade safe way you should do this:
    -create the new file ForProject.php in custom/modules/Calls/metadata/subpanels/ForProject.php (copied from default.php in modules/metadata/subpanels and commented the select button code)
    -in custom/Extension/modules/Project/Ext/Layoutdefs/ create a file {name_you_want}.php, here we are going to override the subpanelname so it takes the subpanel from custom, not from modules.

    code to write:
    PHP Code:
    $layout_defs['Accounts']['subpanel_setup']['contacts']['override_subpanel_name'] = "ForProject"
    After this you should repair (admin/repair/Quick Repair and Rebuild) you can check in custom/modules/Project/Ext/Layouts if it has been created a file called layoutdefs.ext.php if there is such a file it should work but this change is only for Project if you want to remove the select button everywhere that's other solution.
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  5. #5
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: HOW to remove select button from subpanel ?

    Quote Originally Posted by eescribano View Post
    In a raw way you can just copy the code from the file in modules/Calls/metadata/subpanels/default.php in the same location and rename it as ForProjects.php for example. In the new file you comment the code refering the select button:
    PHP Code:
    array (
                  
    'widget_class'=>'SubPanelTopSelectButton''popup_module' => 'Calls'
                    
    ), 
    You will also have to tell Project to take the new subpanel file.

    But in an upgrade safe way you should do this:
    -create the new file ForProject.php in custom/modules/Calls/metadata/subpanels/ForProject.php (copied from default.php in modules/metadata/subpanels and commented the select button code)
    -in custom/Extension/modules/Project/Ext/Layoutdefs/ create a file {name_you_want}.php, here we are going to override the subpanelname so it takes the subpanel from custom, not from modules.

    code to write:
    PHP Code:
    $layout_defs['Accounts']['subpanel_setup']['contacts']['override_subpanel_name'] = "ForProject"
    After this you should repair (admin/repair/Quick Repair and Rebuild) you can check in custom/modules/Project/Ext/Layouts if it has been created a file called layoutdefs.ext.php if there is such a file it should work but this change is only for Project if you want to remove the select button everywhere that's other solution.
    Hi Elisabeth,

    Thanks for your reply! I followed your instructions, but the select button still appears in the List.

    Here is my ForProject.php file which i copied from modules\Calls\metadata\subpanels\default.php
    and stored in custom\modules\Calls\metadata\subpanels\ForProject .php

    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    $subpanel_layout = array(
        
    //Removed button because this layout def is a component of
        //the activities sub-panel.
        
        
    'top_buttons' => array(
            array (
                  
    'widget_class'=>'SubPanelTopCreateButton',
                    ),
            
    /*    array (
                  'widget_class'=>'SubPanelTopSelectButton', 'popup_module' => 'Calls'
                    ),
            */
        
    ),
        
        
    'list_fields' => array(
            
    'object_image'=>array(
                
    'vname' => 'LBL_OBJECT_IMAGE',
                
    'widget_class' => 'SubPanelIcon',
                  
    'width' => '2%',
            ),
            
    'close_button'=>array(
                
    'widget_class' => 'SubPanelCloseButton',
                
    'vname' => 'LBL_LIST_CLOSE',
                
    'width' => '6%',
                
    'sortable'=>false,
            ),
            
    'name'=>array(
                 
    'vname' => 'LBL_LIST_SUBJECT',
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'width' => '30%',
            ),
            
    'status'=>array(
                 
    'widget_class' => 'SubPanelActivitiesStatusField',
                 
    'vname' => 'LBL_STATUS',
                 
    'width' => '15%',
                 
            ),
            
    'contact_name'=>array(
                 
    'widget_class' => 'SubPanelDetailViewLink',
                 
    'target_record_key' => 'contact_id',
                 
    'target_module' => 'Contacts',
                 
    'module' => 'Contacts',
                 
    'vname' => 'LBL_LIST_CONTACT',
                 
    'width' => '11%',
                 
    'sortable'=>false,
            ),
                
            
    'date_start'=>array(
                 
    'vname' => 'LBL_DATE_TIME',
                 
    'width' => '10%',
            ),
            
    'assigned_user_name' => array (
                
    'name' => 'assigned_user_name',
                
    'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
            ),
            
    'edit_button'=>array(
                
    'vname' => 'LBL_EDIT_BUTTON',
                 
    'widget_class' => 'SubPanelEditButton',
                 
    'width' => '2%',
            ),
            
    'remove_button'=>array(
                
    'vname' => 'LBL_REMOVE',
                 
    'widget_class' => 'SubPanelRemoveButton',
                 
    'width' => '2%',
            ),
            
    'time_start'=>array(
                
    'usage'=>'query_only',
        
            ),
                        
        ),
    );        
    ?>
    In custom\modules\Project\Ext\Layoutdefs the file layoutdefs.ext.php appears with this code;

    // In Project Module override subpanel Calls
    $layout_defs['Project']['subpanel_setup']['project_calls']['override_subpanel_name'] = 'ForProject';

    Everthing seems fine but still I see the 'Select' Button. Do you know what's the problem?

    Thanksss
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  6. #6
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: HOW to remove select button from subpanel ?

    Other solution I can think of is in custom/Extension/modules/Project/Ext/Layouts
    In stead to try to override the panel just override the buttons:
    $layout_defs['Project']['subpanel_setup']['project_calls']['top_buttons'] = array (
    'widget_class'=>'SubPanelTopCreateButton',
    );

    And after this repair
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  7. #7
    shamimwilson is offline Sugar Community Member
    Join Date
    Mar 2009
    Location
    Banglore India
    Posts
    235

    Default Re: HOW to remove select button from subpanel ?

    Hi,

    Go to custom/Extension/modules/Projects/Ext/Layoutdefs/layoutdefs.ext.php

    Then use the script in the following way .

    <?php

    $buttons_to_remove = array('SubPanelTopSelectButton');

    foreach($layout_defs['Project']['subpanel_setup']['bugs']['top_buttons'] as $id => $button_def) {
    if(in_array($button_def['widget_class'], $buttons_to_remove)) {
    unset($layout_defs['Project']['subpanel_setup']['bugs']['top_buttons'][$id]);
    }
    }

    ?>

    I have done for bug you can use it for Calls

  8. #8
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Thumbs up Re: HOW to remove select button from subpanel ?

    Hi there, thanks for all your help!

    I found the solution;

    In custom\Extension\modules\Project\Ext\Layoutdefs there was already the file customproject_calls.php
    In this file I have removed the code

    1 =>
    array (
    'widget_class' => 'SubPanelTopSelectButton',
    'popup_module' => 'Calls',
    'mode' => 'MultiSelect',
    ),

    and now its working fine. Again thanks for the help, I appreciate
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to remove Create and Select button from subpanel
    By sawan in forum Developer Help
    Replies: 7
    Last Post: 2011-11-17, 08:38 PM
  2. Remove select button
    By ratheeshid in forum Developer Help
    Replies: 6
    Last Post: 2008-06-27, 01:07 PM
  3. How to remove Create and Select button from subpanel
    By sawan in forum General Discussion
    Replies: 3
    Last Post: 2008-03-04, 03:59 PM
  4. How to remove Create and Select button from subpanel
    By sawan in forum Developer Help
    Replies: 3
    Last Post: 2008-03-03, 12:43 PM
  5. Replies: 0
    Last Post: 2006-04-19, 04:37 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
  •