Hey
please tell me how to change this code so that the viewing of records with the status “Closed Lost” is available for users with a role with id “xxxxxx”
that is, you need to make sure that records with this status are seen by the admin and users with a predetermined role
<?php
require_once('include/MVC/View/views/view.list.php');
class OpportunitiesViewList extends ViewList {
function listViewProcess() {
global $current_user;
$this->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();
}
}
}