function create_new_list_query($order_by, $where, $filter = array(), $params = array(), $show_deleted = 0, $join_type = '', $return_array = false, $parentbean = null, $singleSelect = false) { //Ensure that amount is always on list view queries if amount_usdollar is as well. if (!empty($filter) && isset($filter['amount_usdollar']) && !isset($filter['amount'])) { $filter['amount'] = true; } return parent::create_new_list_query($order_by, $where, $filter, $params, $show_deleted, $join_type, $return_array, $parentbean, $singleSelect); }
function create_new_list_query($order_by, $where, $filter = array(), $params = array(), $show_deleted = 0, $join_type = '', $return_array = false, $parentbean = null, $singleSelect = false) { global $current_user; if (!is_admin($GLOBALS['current_user'])) { // Restrict this so only admins can see other people's records $owner_where = $this->getOwnerWhere($current_user->id); if (empty($where)) { $where = $owner_where; } else { $where .= ' AND ' . $owner_where; } } return parent::create_new_list_query($order_by, $where, $filter, $params, $show_deleted, $join_type, $return_array, $parentbean, $singleSelect); }