添加 Where 条件以列出视图suitecrm/sugarcrm 后,搜索选项被删除? [英] Search option is removed after adding Where condition to list view suitecrm/sugarcrm?
本文介绍了添加 Where 条件以列出视图suitecrm/sugarcrm 后,搜索选项被删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想根据条件自定义列表视图,所以我关注这个博客在列表视图中添加 where 条件
I want to customize the list view based on condition so i followed this blog to add where condition in list view
开发者博客来自 Sugar 列表视图页面的 Sugar where 子句
但这样做后,我的自定义列表视图中没有搜索选项.任何人都可以指导我吗?
but after doing this i am not getting search options in my custom list view. Can any one guide me on this?
以下是修改后的列表视图(为此我关注了提到的博客)
Following is the modified list view(i followed mentioned blog for this)
<?php
require_once('include/MVC/View/views/view.list.php');
require_once('custom/modules/Contacts/ContactsListViewSmarty.php');
class ContactsViewList extends ViewList
{
/**
* @see ViewList::preDisplay()
*/
var $where = "";
function AccountsViewList()
{
parent::ViewList();
}
public function preDisplay(){
require_once('modules/AOS_PDF_Templates/formLetter.php');
formLetter::LVPopupHtml('Contacts');
parent::preDisplay();
if($_GET['parentTab']=='Sales'){
$this->where .= "contacts.title ='IT Developer'";
}elseif ($_GET['parentTab']=='Marketing') {
$this->where .= "contacts.title ='Director Sales'";
}
$this->lv = new ContactsListViewSmarty();
}
function listViewProcess()
{
$this->lv->setup($this->seed, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params);
echo $this->lv->display();
}
}
推荐答案
$this->processSearchForm(); // for search form
$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, 'include/ListView/ListViewGeneric.tpl', $this->where, $this->params); // call the listview's file
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']); // save the last search
echo $this->lv->display(); // display your search
这段代码应该在 listViewProcess()
this code should be in listViewProcess()
这篇关于添加 Where 条件以列出视图suitecrm/sugarcrm 后,搜索选项被删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文