作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 SugarCRM 开发用于客户管理的软件。我从带有自定义字段的基本模板创建了一个自定义模块。是否可以摆脱 SugarCRM db 并通过外部 Web 服务执行 CRUD 操作?实际上,我可以通过设置自定义 Controller 的 bean 属性在 datailview 中显示 Web 服务数据。
class CustomerController extends SugarController{
public function action_detailview(){
$customer = new Customer();
$customer = getCustomerFromWebService();
$this->bean = $customer;
$this->view = "detail";
}
}
最佳答案
您可以通过使用以下代码在 custom/modules/modulename/views/view.list.php 中自定义 view.list.php 来更改 ListView :
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/MVC/View/views/view.list.php');
// name of class match module
class modulenameViewList extends ViewList{
// where clause that will be inserted in sql query
var $where = 'like 'htc'';
function modulenameViewList()
{
parent::ViewList();
}
/*
* Override listViewProcess with addition to where clause to exclude project templates
*/
function listViewProcess()
{
$this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params);
echo $this->lv->display();
}
}
?>
关于sugarcrm - 如何将 Web 服务与 SugarCRM 中的自定义模块集成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28932717/
我是一名优秀的程序员,十分优秀!