【问题标题】:Alter Field Value in View.detail.php ( detail view ) in SUGARCRM在 SUGARCRM 中的 View.detail.php(详细视图)中更改字段值
【发布时间】:2014-09-05 06:29:48
【问题描述】:

我在我的联系人模块中使用以下类添加了一个自定义字段。基本上,我在联系模块中有一个文本字段“项目详细信息”。如果用户在编辑视图的项目详细信息字段中输入一些数据,那么它将显示在详细视图中。我想更改详细视图中“项目详细信息”字段的值。我只想将 str_replace() 函数应用于该特定详细视图中的“project_details”字段(不在其他视图中)。所以我想我可以使用以下课程来做到这一点。如果还有其他选择,我也准备好了。

文件路径:custom/modules/Contacts/views/view.detail.php

  class CustomContactsViewDetail extends ContactsViewDetail {

    public function display()
    {
        $someVariable = 'something that generates out field output will go here';

        // Assign custom "Status" value to Smarty template
        $this->ss->assign('STATUS', $somaeVariable);

        parent::display();
    }
}

我想,我必须添加一些代码来改变或替换字段值中的一些字符串。就像下面的示例代码一样。但我知道这行不通。

 <?php
       require_once('modules/Contacts/views/view.detail.php');

      class CustomContactsViewDetail extends ContactsViewDetail {

        public function display()
        {

        $this->field['project_details']['value'] = str_replace("###EMAIL###", "admin@mywebsite.com", $this->field['project_details']['value']);

            parent::display();
        }
    }

任何帮助将不胜感激。

【问题讨论】:

    标签: php sugarcrm detailview


    【解决方案1】:

    试试

    $this->ev->fieldDefs['project_details']
    

    【讨论】:

    • 我的回答对您有帮助吗?如果是,请接受我的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-08
    • 1970-01-01
    • 2012-08-17
    • 1970-01-01
    • 2020-10-30
    相关资源
    最近更新 更多