SuiteCRM 为popview自定义where条件查询 [英] SuiteCRM Make custom where condition query for popview

查看:26
本文介绍了SuiteCRM 为popview自定义where条件查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何对弹出视图进行自定义查询,我如上所述在 ViewList 中进行了更改,但它不会影响弹出视图列表中的列表.

How to make the custom query for popup view, I made changes in ViewList as mentioned above but it doesn't affect on the list which came in popup view list.

我的要求是当我从发票模块打开它时传递产品类型.

My requirement is to pass product type when I open this from invoice module.

在发票中,我们有产品线和服务线,从产品模块来看,我在添加新产品作为商品"或服务"的同时,按类型区分产品.

In invoice, we have a product line and service line, and from product module, i have differentiated product by type while adding new product as a "Goods" or "Service".

现在我已经创建了 2 个自定义文件,view.list.php 和 view.popup.php.

Now i have created 2 custom files, view.list.php, and view.popup.php.

但是不明白如何将类型标志从 view.popup.php 传递到 view.list.php

But do not understand how to pass type flag from view.popup.php to view.list.php

如果有人建议我在关联从服务线调用的弹出窗口和从产品线调用的弹出窗口时如何过滤产品数据,那就太好了.

Will be great if someone suggests me how to filter product data when relating popup called from the service line and popup called from the product line.

谢谢

推荐答案

您将需要更改列表查询并相应地添加条件.

You will need to change the listing query and add condition accordingly.

为了扩展 LlistView 查询,您需要遵循以下步骤:

Following are the steps you need to follow in order to extend the LlistView query:

步骤 1: 创建或编辑 custom/modules/Opportunities/views/view.list.php 并添加以下代码,

Step 1: Create or edit custom/modules/Opportunities/views/view.list.php and add following code,

processSearchForm();
if(!$current_user->is_admin) // remove this condition if you dont want admin user to view the "Closed Lost" Opportunities.
$this->params[‘custom_where’] = ‘ AND opportunities.sales_stage <> "Closed Lost" ‘;

if (empty($_REQUEST[‘search_form_only’]) || $_REQUEST[‘search_form_only’] == false) {
$this->lv->setup($this->seed, ‘include/ListView/ListViewGeneric.tpl’, $this->where, $this->params);
$savedSearchName = empty($_REQUEST[‘saved_search_select_name’]) ? " : (‘ – ‘ . $_REQUEST[‘saved_search_select_name’]);
echo $this->lv->display();
}
}

}

第 2 步:刷新列表视图!

您将在查询中看到的可能自定义是:

The probable customizations you will see in the query are:

  1. Custom_form
  2. 自定义位置
  3. 自定义选择
  4. Custom_order_by

这篇关于SuiteCRM 为popview自定义where条件查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆