From e91597d3e039949ec700937c9cc249fceafe7f9b Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 12 Aug 2022 17:27:58 +0800 Subject: [PATCH] * Code for port. --- module/story/config.php | 6 +++--- module/story/model.php | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/module/story/config.php b/module/story/config.php index df09db9db9..3fe51aa3e5 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -100,7 +100,7 @@ $config->story->datatable->fieldList['branch']['dataSource'] = array('module' => $config->story->datatable->fieldList['module']['title'] = 'module'; $config->story->datatable->fieldList['module']['control'] = 'select'; -$config->story->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getAllModulePairs', 'params' => 'story'); +$config->story->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getOptionMenu', 'params' => '$productID&story&0&all'); $config->story->datatable->fieldList['keywords']['title'] = 'keywords'; $config->story->datatable->fieldList['keywords']['fixed'] = 'no'; @@ -112,7 +112,7 @@ $config->story->datatable->fieldList['plan']['fixed'] = 'no'; $config->story->datatable->fieldList['plan']['width'] = '90'; $config->story->datatable->fieldList['plan']['required'] = 'no'; $config->story->datatable->fieldList['plan']['control'] = 'select'; -$config->story->datatable->fieldList['plan']['dataSource'] = array('module' => 'story', 'method' => 'getRelatedObjects', 'params' => 'plan&id,title'); +$config->story->datatable->fieldList['plan']['dataSource'] = array('module' => 'productplan', 'method' => 'getPairs', 'params' => '$productID'); $config->story->datatable->fieldList['source']['title'] = 'source'; $config->story->datatable->fieldList['source']['fixed'] = 'no'; @@ -169,7 +169,7 @@ $config->story->datatable->fieldList['reviewedBy']['fixed'] = 'no'; $config->story->datatable->fieldList['reviewedBy']['width'] = '80'; $config->story->datatable->fieldList['reviewedBy']['required'] = 'no'; $config->story->datatable->fieldList['reviewedBy']['control'] = 'multiple'; -$config->story->datatable->fieldList['reviewedBy']['dataSource'] = array('module' => 'user', 'method' => 'getPairs', 'params' => 'devfirst|noclosed|nodeleted'); +$config->story->datatable->fieldList['reviewedBy']['dataSource'] = array('module' => 'story', 'method' => 'getStoriesReviewer', 'params' => '$productID'); $config->story->datatable->fieldList['reviewedDate']['title'] = 'reviewedDate'; $config->story->datatable->fieldList['reviewedDate']['fixed'] = 'no'; diff --git a/module/story/model.php b/module/story/model.php index 0c260471b1..0c490c0dee 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -5730,4 +5730,18 @@ class storyModel extends model return $stories; } + + /** + * Get reviewer pairs for story . + * + * @param int $productID + * @access public + * @return void + */ + public function getStoriesReviewer($productID = 0) + { + $product = $this->loadModel('product')->getByID($productID); + $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '', ''); + return $this->user->getPairs('noclosed|nodeleted', '', 0, $reviewers); + } }