Results 1 to 4 of 4

Thread: need eliminate this menu shorcuts create new and edit button

  1. #1
    goodccs is offline Member
    Join Date
    Oct 2008
    Posts
    7

    Question need eliminate this menu shorcuts create new and edit button

    How can eliminate menu shorcuts "create new mymodule" and "edit button" display grid
    any can help me i try read all source of my module but no can when...

    i like module read view database any can help me?

    please thanks.
    Attached Images Attached Images  

  2. #2
    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: need eliminate this menu shorcuts create new and edit button

    To remove the "Create new mymodule" link you need to create an extended menus for your module:
    custom/Extension/modules/<MyModule>/Ext/Menus/menu.ext.php
    Containing something like that:

    PHP Code:
    <?php
     
    //WARNING: The contents of this file are auto-generated


    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');


    global 
    $mod_strings$app_strings$sugar_config;

    foreach(
    $module_menu as $key=>$menu_option){
            if(
    $menu_option[2] == 'CreateMyModule'){
                    unset(
    $module_menu[$key]);
            }
    }

    ?>
    To remove the edit link from Listview you need to:
    create a custom view.list.php
    implement the method preDisplay containing something like that:

    PHP Code:
         function preDisplay(){
                require_once(
    'custom/include/ListView/ListViewNoEdit.php');
             
    $this->lv = new ListViewNoEdit();
         } 
    create the script custom/include/ListView/ListViewNoEdit.php containing the class ListViewNoEdit, which extends the default ListViewSmarty;
    implement the method process containing something like that:

    PHP Code:
        function process($file$data$htmlVar) {
                    
    $data['pageData']['access']['edit'] = false;
            
    $this->rowCount count($data['data']);
            
    $this->moduleString $data['pageData']['bean']['moduleDir'] . '2_' strtoupper($htmlVar) . '_offset';
        } 
    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    goodccs is offline Member
    Join Date
    Oct 2008
    Posts
    7

    Cool Re: need eliminate this menu shorcuts create new and edit button

    I bro Thanks for you time and help, i can modificate shorcuts create perfect, but no can´t in edit button

    i create ListViewNoEdit.php in path custom\include\ListView\

    PHP Code:
    class ListViewNoEdit extends ListViewSmarty {

           function 
    process($file$data$htmlVar) {
            
    $data['pageData']['access']['edit'] = false;
            
    $this->rowCount count($data['data']);
            
    $this->moduleString $data['pageData']['bean']['moduleDir'] . '2_' strtoupper($htmlVar) . '_offset';
        }


    and call in MyModule_sugar.php and view.list.php this

    PHP Code:
      function preDisplay(){
           require_once(
    'custom/include/ListView/ListViewNoEdit.php');
             
    $this->lv = new ListViewNoEdit();
      } 
    but view.list.php no locate the path for put where?

    thanks!

  4. #4
    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: need eliminate this menu shorcuts create new and edit button

    You need to create the view.list.php inside custom/modules/<MyModule>/views.

    The content may looks like that:
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    require_once(
    'include/MVC/View/views/view.list.php');

    class 
    MyModuleViewList extends ViewList {
         function 
    preDisplay(){ 
                require_once(
    'custom/include/ListView/ListViewNoEdit.php'); 
             
    $this->lv = new ListViewNoEdit(); 
         }  
    }
    ?>
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ho can i create new menu item
    By shemeermali in forum Developer Help
    Replies: 2
    Last Post: 2008-03-24, 05:19 AM
  2. Menu item to replace subpanel create button
    By sugarcare in forum Developer Help
    Replies: 0
    Last Post: 2006-06-13, 05:12 PM
  3. Eliminate EDIT button
    By mysterj in forum Feature Requests
    Replies: 1
    Last Post: 2005-10-10, 11:36 AM
  4. Tabs & Shorcuts
    By randy998 in forum General Discussion
    Replies: 1
    Last Post: 2005-02-15, 03:04 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
  •