Results 1 to 8 of 8

Thread: How do I remove delete button in listview

  1. #1
    stripathy is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default How do I remove delete button in listview

    Hi,

    I want to know how we can remove the Delete button from the custom module in listview.

    Thanks,
    Sunil

  2. #2
    salesagility's Avatar
    salesagility is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    UK
    Posts
    2,379

    Default Re: How do I remove delete button in listview

    You'd have to cut some code ... you cannot do this using Studio.

    If you're worried about users deleting records, two things:

    1. you can limit their ability to do this by applying roles (Admin>Roles)
    2. sugar does not delete records from the database ... just sets a flag to 1=deleted ... so you can always undelete

  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: How do I remove delete button in listview

    Hi Sunil

    You need to do the following:
    Create a view.list.php containing this function:

    PHP Code:
         function preDisplay() {
             
    $this->lv = new ListViewSmarty();
            
    $this->lv->delete false;
         } 
    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.

  4. #4
    stripathy is offline Member
    Join Date
    Jul 2009
    Posts
    8

    Default Re: How do I remove delete button in listview

    Thank you very much....

  5. #5
    peppolax is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    56

    Default Re: How do I remove delete button in listview

    you can change in include/listview/listviewsmarty.php

    var $delete = true; in false

  6. #6
    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: How do I remove delete button in listview

    Quote Originally Posted by peppolax View Post
    you can change in include/listview/listviewsmarty.php

    var $delete = true; in false
    This is not an upgrade safe approach, this is a core script. Furthermore, this feature may be requested for a couple of modules instead of all of them.

    Regards
    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.

  7. #7
    rishavraj's Avatar
    rishavraj is offline Sugar Community Member
    Join Date
    Sep 2010
    Posts
    135

    Default Re: How do I remove delete button in listview

    I want to disable the the delete button in opportunity module.
    only owner and admin are allowed to delete.if some opportunity is assigned to other then other user will not able to delete the opportunity

    Please help me out

  8. #8
    raym2x is offline Member
    Join Date
    Sep 2010
    Location
    Cebu, Philippines
    Posts
    16

    Default Re: How do I remove delete button in listview

    You can also hide delete button in list view by overriding the functions in ListViewSmarty class.
    This is a 100% upgrade safe approach.

    Create a file in custom/<MODULE_NAME>/<MODULE_NAME>ListViewSmarty.php

    <?php
    require_once('include/ListView/ListViewSmarty.php')

    class <MODULE_NAME>ListViewSmarty extends ListViewSmarty{

    function <MODULE_NAME>ListViewSmarty(){
    parent::ListViewSmarty();
    }

    function buidDeleteLink(){
    return ' ';
    }

    }

    ?>

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. remove edit button in listview
    By marketadvantage in forum Developer Help
    Replies: 1
    Last Post: 2011-06-24, 08:05 AM
  2. Replies: 8
    Last Post: 2010-08-19, 06:05 AM
  3. Is it possible to remove Leads ListView Pencil button?
    By ramji123 in forum Developer Help
    Replies: 3
    Last Post: 2010-02-15, 11:55 AM
  4. HOW to remove button from ListView ?
    By dekleinemedia in forum Help
    Replies: 4
    Last Post: 2009-07-23, 12:21 PM
  5. remove delete button from listview
    By mikesolomon in forum Developer Help
    Replies: 13
    Last Post: 2008-10-02, 10:14 AM

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
  •