2017-01-12 28 views
1

我想顯示某個WHERE子句彈出列表視圖,但我的代碼似乎並沒有得到執行?如何覆蓋SuiteCRM中的彈出列表視圖查詢(listViewProcess)?

這是我在我的自定義/ MODULE_NAME /視圖/ view.popup.php:

<?php 

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

class CustomRegistrationMetaViewPopup extends ViewPopup{ 

    public function listViewProcess(){ 

     parent::listViewProcess(); 

     $this->params['custom_select'] = "select * "; 
     $this->params['custom_from'] = "from table "; 
     $this->where .= "where condition = 'Verified'"; 
    } 

    function CustomRegistrationMetaViewPopup(){ 
     parent::ViewPopup(); 
    } 

    function preDisplay(){ 
     parent::preDisplay(); 
    } 
} 

我的功能不會被調用。任何想法?

+0

哪裏是你的文件放在哪裏?你正在運行什麼版本? – Reisclef

+1

版本7.7.8 Sugar Version 6.5.24(Build 509)。該文件被放置在自定義/ MODULE_NAME/views/view.popup.php – kratos

+0

該模塊的名稱是什麼? – Reisclef

回答

1

您試圖覆蓋listViewProcess功能,它是在列表視圖中可用。文件正確的地方是:定製\模塊\ MODULE_NAME \意見\ view.list.php

和以下是幫助代碼:

require_once('include/MVC/View/views/view.list.php'); 
class MODULE_NAMEViewList extends ViewList { 

    function listViewProcess() { 
     global $current_user; 
     $this->params['custom_where'] = ' AND module_name.name = "test" '; 

     parent::listViewProcess(); 
} 

}