如何创建一个结合了2个细节视图的SugarCRM视图
我想扩展联系人详细信息视图,以便在同一视图上显示关联帐户的详细信息视图 我的直觉是覆盖Contacts Detail视图的显示功能,并从中创建Accounts Detail的实例并附加其显示输出如何创建一个结合了2个细节视图的SugarCRM视图,sugarcrm,Sugarcrm,我想扩展联系人详细信息视图,以便在同一视图上显示关联帐户的详细信息视图 我的直觉是覆盖Contacts Detail视图的显示功能,并从中创建Accounts Detail的实例并附加其显示输出 但是我不知道是否有一种标准的方法来获取它。另一个更简单的选择可能是添加一个iframe字段,它在其中的帐户上加载detailview。虽然没有那么漂亮,但黑客攻击也少了很多。我了解到,在即将推出的版本(6.3)中,将有一种生成计算字段的方法,可以访问相关模块的字段 如果是这种情况,那么一个选项将是创建引
但是我不知道是否有一种标准的方法来获取它。另一个更简单的选择可能是添加一个iframe字段,它在其中的帐户上加载detailview。虽然没有那么漂亮,但黑客攻击也少了很多。我了解到,在即将推出的版本(6.3)中,将有一种生成计算字段的方法,可以访问相关模块的字段 如果是这种情况,那么一个选项将是创建引用帐户字段的计算字段,然后添加一个面板以使用引用的帐户字段联系DetailView 不过,我最初的预感也被证明是可行的,并不像我最初想象的那样简单:
<?php
require_once('include/MVC/View/views/view.detail.php');
class ContactsViewDetail extends ViewDetail {
function ContactsViewDetail() {
parent::ViewDetail();
}
function preDisplay(){
parent::preDisplay();
// Configuration to display All account info
$this->dv2 = new DetailView2();
$this->dv2->ss =& $this->dv->ss;
$this->bean2 = new Account();
$this->bean2->retrieve($this->bean->account_id);
$accountMetadataFile = 'custom/modules/Accounts/metadata/detailviewdefs.php';
$accountTemplate = 'custom/modules/Accounts/tpls/AccountsDetailView.tpl';
$this->dv2->setup('Accounts', $this->bean2, $accountMetadataFile, $accountTemplate);
}
function display(){
parent::display();
// Display Accounts information.
$this->dv2->process();
echo $this->dv2->display();
}
}
?>
总之