如何从prestashop 1.6.3中的fields_list中删除视图按钮和列表按钮

时间:2016-07-21 07:32:42

标签: prestashop prestashop-1.6 prestashop-1.5

我想从prestashop 1.6中的fields_list中删除视图按钮和列表按钮,例如导出,添加按钮enter image description here

下面是我的渲染列表视图代码,当从主列表视图页面单击视图按钮时,将填充此列表

        public function renderView()
{
if(Tools::getValue('id_query_dr')){
    $id_query_dr  =Tools::getValue('id_query_dr');
    $this->module = new QueryDrDetail();     
    $this->context = Context::getContext();
    $this->id_lang = $this->context->language->id;
    $this->lang = false;
    $this->ajax = 1;
    $this->path = _MODULE_DIR_.'querydrdetail';
    $this->default_form_language = $this->context->language->id;
    $this->table = 'kits_query_dr_detail';
    $this->className = 'querydrdetail';
    $this->identifier = 'id_query_dr_detail';
    $this->allow_export = true;
    $this->explicitSelect = false;
    $this->_select = '  id_query_dr_detail,
                        id_query_dr,
                        order_no,
                        ni_online_ref_id,
                        transaction_type,
                        response,
                        status,
                        error_code,
                        error_msg,
                        date_add,
                        date_upd';
    $this->_where.= 'AND id_query_dr='.$id_query_dr.' ';
    $this->_orderBy = 'id_query_dr_detail';
    $this->_orderWay = 'DESC';
    //Field list  -
    $this->fields_list = array(
    'id_query_dr_detail' => array(
    'title' =>$this->l('Detail Id'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),
    'id_query_dr' => array(
    'title' => $this->l('Query Dr Id'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),
    'order_no' => array(
    'title' => $this->l('Cart Id'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),
    'ni_online_ref_id' => array(
    'title' => $this->l('Online Reference ID '),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),        
    'transaction_type' => array(
    'title' => $this->l('Trx type'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ), 
    'status' => array(
    'title' => $this->l('Status'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),  
    'error_code' => array(
    'title' => $this->l('Error Code'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ), 
    'error_msg' => array(
    'title' => $this->l('Error Message'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ), 
    'response' => array(
    'title' => $this->l('Response'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ), 
    'date_add' => array(
    'title' => $this->l('Date Added'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ), 
    'date_upd' => array(
    'title' => $this->l('Date Updated'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),
    'query_dr_method' => array(
    'title' => $this->l('Query Dr Method'),
    'align' => 'text-center',
    'remove_onclick' => true,
    'search' => false,
    ),     
    );
}
$this->initTabModuleList();
$this->initToolbar();
$this->initPageHeaderToolbar();
parent::__construct();
return parent::renderForm();
}


public function initContent()
{
    if($this->action!='view'){
    $this->initTabModuleList();
    $this->initToolbar();
    $this->initPageHeaderToolbar();
    $this->content .= $this->initFormToCallQueryDR();
    $this->table    =  _DB_KITS_PREFIX_.'query_dr';
    $this->toolbar_title = $this->l('Query Dr Logs');
    $this->content .= $this->renderList();
    $this->context->smarty->assign(array(
    'content' => $this->content,
    'url_post' => self::$currentIndex.'&token='.$this->token,
    'show_page_header_toolbar' => $this->show_page_header_toolbar,
    'page_header_toolbar_title' => $this->page_header_toolbar_title,
    'page_header_toolbar_btn' => $this->page_header_toolbar_btn
    ));
    }
    //If its  view  the display another list  here
    if($this->action=='view'){
    $this->initTabModuleList();
    $this->initToolbar();
    $this->initPageHeaderToolbar();
    $this->content = $this->renderView();
    $this->table    =  _DB_KITS_PREFIX_.'query_dr_detail';
    $this->toolbar_title = sprintf($this->l('Query Dr Detail Logs of Query Dr ID: %d'),Tools::getValue('id_query_dr'));
    $this->content .= $this->renderList();  
    $this->context->smarty->assign(array(
    'content' => $this->content,
    'url_post' => self::$currentIndex.'&token='.$this->token,
    'show_page_header_toolbar' => $this->show_page_header_toolbar,
    'page_header_toolbar_title' => $this->page_header_toolbar_title,
    'page_header_toolbar_btn' => $this->page_header_toolbar_btn
    ));
    }
}

1 个答案:

答案 0 :(得分:0)

在quella classe dovresti cercare la funzione renderlist e commentare la riga

$this->addRowAction('view');