从ListView SugarCRM / SuiteCRM中删除Checkbox

时间:2015-10-28 14:45:48

标签: php sugarcrm suitecrm

如果Contract的状态等于“已签名”,我想知道如何从Contracts模块的ListView中删除一个复选框。

我通过添加条件来尝试通过此link建议: Details of Manipulation

然而,什么也没发生。

2 个答案:

答案 0 :(得分:0)

1)创建文件 custom / modules / AOS_Contracts / views / view.list.php:

<?php

class AOS_ContractsViewList extends ViewList
{
    function AOS_ContractsViewList()
    {
        parent::ViewList();
    }

    function listViewProcess()
    {
        $this->processSearchForm();
        $this->lv->searchColumns = $this->searchForm->searchColumns;

        if (!$this->headers)
            return;
        if (empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false) {
            $this->lv->ss->assign("SEARCH", true);
            $this->lv->setup($this->seed, 'custom/modules/AOS_Contracts/tpls/ListViewAOS_Contracts.tpl', $this->where, $this->params);
            echo $this->lv->display();
        }
    }
}

2)将 modules / include / ListView / ListViewGeneric.tpl 复制到 custom / modules / AOS_Contracts / tpls / ListViewAOS_Contracts.tpl

3)更改行:

{if !$is_admin && is_admin_for_user && $rowData.IS_ADMIN==1}
    <input type='checkbox' disabled="disabled" class='checkbox' value='{$rowData.ID}'>
{else}
    <input title="{sugar_translate label='LBL_SELECT_THIS_ROW_TITLE'}"
        onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox'
        class='checkbox' name='mass[]' value='{$rowData.ID}'>
{/if}

为:

{if !$is_admin && is_admin_for_user && $rowData.IS_ADMIN==1}
    <input type='checkbox' disabled="disabled" class='checkbox' value='{$rowData.ID}'>
{else}
    {if $pageData.bean.moduleDir == 'AOS_Contracts' && $rowData.STATUS == 'Signed'}
    {else}
        <input title="{sugar_translate label='LBL_SELECT_THIS_ROW_TITLE'}"
            onclick='sListView.check_item(this, document.MassUpdate)' type='checkbox'
            class='checkbox' name='mass[]' value='{$rowData.ID}'>
   {/if}
{/if}

4)进行修复/重建。

答案 1 :(得分:0)

SugarCRM版本9 创建PHP文件recordlist.php并添加:

$viewdefs['<MODULE>']['base']['view']['recordlist']['selection']['isSearchAndSelectAction'] = false;