I want to customize the list view based on condition so i followed this blog to add where condition in list view
Developer Blog From Sugar where clause for sugar list-view pages
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();
}
}
You are using function AccountsViewList instead of ContactsViewList.
Also you will have to copy function prepareSearchForm() from include/MVC/View/views/view.list.php to show your search form.
this code should be in listViewProcess()