Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By SagarCRM

Thread: remove top buttons in subpanel

  1. #1
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default remove top buttons in subpanel

    Hi,

    Using sugar 6.3
    I want to remove the select button in the subpanel top-buttons.

    I removed
    array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => $module_name),

    from the default.php fine in modules\[module name]\metadata\subpanels
    but this had no effect?

    Can't think of any else to try?

    Help please.

    Regards
    Alan.

  2. #2
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: remove top buttons in subpanel

    Hi Linnane,

    just include the following code in you detail view of module having that subpanel


    PHP Code:
    unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['SUBPANEL_NAME']['top_buttons'][1]);//hiding select 
    replace SUBPANEL_NAME with your respective subpanel name

    keep rocking !!!!
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  3. #3
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Re: remove top buttons in subpanel

    Hi thanks for your reply.

    I still couldn't get it to work.

    The name of the module is somp1_visits.
    The sub panel is labelled Episodes.
    The sub-panel is off the main Panel Accounts.

    I could only find the file view.detail.php in directory www\custom\modules\Accounts\views ? Can you help me some more please?

    and I added the line:
    unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['somp1_Visits']['top_buttons'][1]);//hiding select


    Regards
    Alan

  4. #4
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: remove top buttons in subpanel

    You should customize subpanels buttons layout on file:
    /custom/Extension/modules/<module_name>/Layouts/<filename>.php
    Then just run a repair rebuild after.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  5. #5
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Re: remove top buttons in subpanel

    Hi,
    Do you have any sample or even better can you point me to a tutorial re this.

    Regards
    Alan

  6. #6
    rocoyotte is offline Sugar Community Member
    Join Date
    Jul 2009
    Posts
    30

    Default Re: remove top buttons in subpanel

    for Exampe you have in the file /custom/Extension/modules/Meetings/Layouts/rel_meetings_users_Meetings.php ( it's an exemple file )
    Code:
    $layout_defs["Meetings"]["subpanel_setup"]["rel_meetings_users"] = array (
      'order' => 100,
      'module' => 'Users',
      'subpanel_name' => 'default',
      'sort_order' => 'asc',
      'sort_by' => 'id',
      'title_key' => 'LBL_MEETINGS_USERS_FROM_USERS_TITLE',
      'get_subpanel_data' => 'rel_meetings_users',
      'top_buttons' => 
      array (
    
        0 => 
        array (
          'widget_class' => 'SubPanelTopSelectButton',
          'mode' => 'MultiSelect',
        ),
       1 => 
        array (
          'widget_class' => 'SubPanelTopMeetingsSendReport',
        ),
      ),
    );
    If you want to delete the "Select Button" change to this :

    Code:
    $layout_defs["Meetings"]["subpanel_setup"]["rel_meetings_users"] = array (
      'order' => 100,
      'module' => 'Users',
      'subpanel_name' => 'default',
      'sort_order' => 'asc',
      'sort_by' => 'id',
      'title_key' => 'LBL_MEETINGS_USERS_FROM_USERS_TITLE',
      'get_subpanel_data' => 'rel_meetings_users',
      'top_buttons' => 
      array (
    
    //    0 => 
    //    array (
    //      'widget_class' => 'SubPanelTopSelectButton',
    //      'mode' => 'MultiSelect',
    //   ),
        0 => 
        array (
          'widget_class' => 'SubPanelTopMeetingsSendReport',
        ),
      ),
    );

    Launch a "Repair" in the admin menu and it's done

  7. #7
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: remove top buttons in subpanel

    HI Linnane,

    just add view.detail.php in your [custom]/modules/<module_name>/views/

    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once(
    'include/json_config.php');
    require_once(
    'include/MVC/View/views/view.detail.php');

    class <
    module_name>ViewDetail extends ViewDetail{
        var 
    $type ='detail';
        var 
    $dv;
        
         function 
    ViewDetail(){
                    
    parent::ViewDetail();
                }
                
         function 
    _displaySubPanels(){
                    require_once (
    'include/SubPanel/SubPanelTiles.php');
                    
    $subpanel = new SubPanelTiles($this->bean$this->module);
                    
                    
    /*Starts : Replacing buttons on the subpanels as required*/
                    /*Sub-Panel buttons hiding code*/
                    
    unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['<subpanel_name>']['top_buttons'][0]);//hiding create
                    
    unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['<subpanel_name>']['top_buttons'][1]);//hiding select
                    
    echo $subpanel->display();
                    }
         function 
    display(){
            if(empty(
    $this->bean->id)){
                global 
    $app_strings;
                
    sugar_die($app_strings['ERROR_NO_RECORD']);
            }
            
    $this->dv->process();
            echo 
    $this->dv->display();
         }
    }
    i hope this will work..
    hermioni likes this.
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  8. #8
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Re: remove top buttons in subpanel

    Hi SagarCRM,

    Thanks for that got it to work.

    Regards
    Linnane

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 "Edit" and "remove" buttons from subpanel
    By marko.kocic in forum Developer Help
    Replies: 9
    Last Post: 2011-12-19, 08:50 PM
  2. remove edit and rem buttons from subpanel
    By alex.cropper in forum Developer Help
    Replies: 2
    Last Post: 2011-11-19, 09:32 PM
  3. remove buttons from subpanel
    By kstro21 in forum Developer Help
    Replies: 1
    Last Post: 2010-06-08, 01:25 PM
  4. Replies: 2
    Last Post: 2010-02-26, 04:09 PM
  5. Replies: 3
    Last Post: 2008-07-27, 06:30 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
  •