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

4

2 回答 2

8

您也可以通过代码执行此操作,并通过 custom/modules/Accounts/views/view.list.php 中的新文件创建自定义列表视图,代码如下:

<?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;
    }
}

通过这种方式,您还可以隐藏一些额外的“选项”,例如导出按钮、批量更新表单等。

于 2013-04-25T18:27:30.833 回答
2

对此的替代方法是为弹出编辑视图有问题的模块禁用 AjaxUI。您可以在系统设置下配置哪些模块不应使用 AjaxUI(此处“配置 Ajax 用户界面”下的更多信息: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 )

代码方面,删除编辑图标需要的不仅仅是编辑 listviewdefs.php 文件。

于 2013-04-25T16:56:14.137 回答