diff --git a/module/datatable/config.php b/module/datatable/config.php index 0c2c0fdbb0..3909fefff3 100644 --- a/module/datatable/config.php +++ b/module/datatable/config.php @@ -6,3 +6,5 @@ $config->datatable->moduleAlias['testtask-cases'] = 'testcase'; $config->datatable->moduleAlias['program-project'] = 'project'; $config->datatable->moduleAlias['project-bug'] = 'bug'; $config->datatable->moduleAlias['execution-bug'] = 'bug'; + +$config->datatable->noProductModule = ',review,'; diff --git a/module/datatable/model.php b/module/datatable/model.php index e69834e266..49267b9bf6 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -23,6 +23,12 @@ class datatableModel extends model public function getFieldList($module) { if(!isset($this->config->$module)) $this->loadModel($module); + if($this->session->hasProduct == 0 and (strpos($this->config->datatable->noProductModule, ",$module,") !== false)) + { + $productIndex = array_search('product', $this->config->$module->datatable->defaultField); + if($productIndex) unset($this->config->$module->datatable->defaultField[$productIndex]); + if(isset($this->config->$module->datatable->fieldList['product'])) unset($this->config->$module->datatable->fieldList['product']); + } if($this->session->currentProductType === 'normal') unset($this->config->$module->datatable->fieldList['branch']); foreach($this->config->$module->datatable->fieldList as $field => $items) {