3

I need to hide edit button from lists in SugarCRM - the small pencil icon in the left part of each item on the list.

The reason I need to hide it, because it opens the popup edit form, which has some bugs, and doesn't run some dependencies. Replacing this popup edit view with the normal edit view through JavaScript could be an option too.

It should be done in upgrade safe way.

Using SugarCRM Pro 6.5.11

Kostanos
  • 9,615
  • 4
  • 51
  • 65

2 Answers2

8

You can also do that by code and create a custom list view via a new file in custom/modules/Accounts/views/view.list.php with code near like that:

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

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

class CustomAccountsViewList extends ViewList
{
    public function preDisplay()
    {
        parent::preDisplay();

        # Hide Quick Edit Pencil
        $this->lv->quickViewLinks = false;
    }
}

By this way you have also some additional "option" which you can hide like export button, massupdate form, etc.

  • +1 for such providing a good answer and to elaborate it by giving the path of file. – Code Lღver Apr 26 '13 at 14:00
  • My module's name dm_cat_pack (with prefix "dm" included), how should I call the class? Already tried Customdm_cat_packViewList, dm_cat_packViewList. Also to you know, the folder custom/modules/dm_cat_pack/views/ was not there, I created it. – Kostanos Apr 26 '13 at 14:58
  • Please edit the name of Class it is not correct, it should be exactly the same as a Module name – Kostanos Apr 26 '13 at 18:07
  • @cédricmourizard Its is possible to customize the query in popupView? – ErasmoOliveira Mar 26 '15 at 18:51
2

An alternative to this is to disable the AjaxUI for the module that is having problems with the popup edit view. You can configure which modules should not use the AjaxUI under System Settings (more info under "Configure Ajax User Interface" here: http://support.sugarcrm.com/02_Documentation/01_Sugar_Editions/05_Sugar_Community_Edition/Sugar_Community_Edition_6.5/Sugar_Community_Edition_Administration_Guide_6.5.0/05_System)

Code-wise, to remove the edit icon will require something more than just editing the listviewdefs.php file.

egg
  • 1,736
  • 10
  • 12