AnsweredAssumed Answered

I did added custom Where listview.php At list view its Working But Search not working ....?

Question asked by MK Gupta on Dec 19, 2016

I did added custom Where listview.php At list view its Working But Search not working ....?

 

 

my code-->

 

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

require_once('include/MVC/View/views/view.list.php');

class empViewList extends ViewList{

function empViewList()
{

parent::ViewList();
}

/*
* Override listViewProcess with addition to where clause to exclude project templates
*/
function listViewProcess()
{
global $current_user;
$user_name = $current_user->user_name;
$id = $current_user->id;

$this->reportingUser($id);
$this->report_to_id[$id] = $current_user->name;
$reportingUserIds = $this->report_to_id;
$user_ids = implode("', '", array_keys($reportingUserIds));

$this->processSearchForm();

// $this->params['overrideOrder']='1';
// $this->params['orderBy']='1';
$status_options = $this->searchForm->searchFields['status']['value'];
if (!in_array($user_ids, $status_options)) {

$this->params['custom_where'] =" AND users.reports_to_id IN ('".$user_ids."')";
}

$this->lv->searchColumns = $this->searchForm->searchColumns;
if(!$this->headers)
return;
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();

$tplFile = 'include/ListView/ListViewGeneric.tpl';
$this->lv->setup($this->seed, $tplFile, $this->where, $this->params);
echo $this->lv->display();

}
}

more code hide---

Outcomes