diff --git a/module/bug/model.php b/module/bug/model.php index b2a39605d2..585cd03478 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2182,47 +2182,6 @@ class bugModel extends model return $bugQuery; } - /** - * Form customed bugs. - * - * @param array $bugs - * @access public - * @return array - */ - public function formCustomedBugs($bugs) - { - /* Get related objects id lists. */ - $relatedModuleIdList = array(); - $relatedStoryIdList = array(); - $relatedTaskIdList = array(); - $relatedCaseIdList = array(); - $relatedExecutionIdList = array(); - - foreach($bugs as $bug) - { - $relatedModuleIdList[$bug->module] = $bug->module; - $relatedStoryIdList[$bug->story] = $bug->story; - $relatedTaskIdList[$bug->task] = $bug->task; - $relatedCaseIdList[$bug->case] = $bug->case; - $relatedExecutionIdList[$bug->execution] = $bug->execution; - - /* Get related objects title or names. */ - $relatedModules = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in($relatedModuleIdList)->fetchPairs(); - $relatedStories = $this->dao->select('id, title')->from(TABLE_STORY) ->where('id')->in($relatedStoryIdList)->fetchPairs(); - $relatedTasks = $this->dao->select('id, name')->from(TABLE_TASK)->where('id')->in($relatedTaskIdList)->fetchPairs(); - $relatedCases = $this->dao->select('id, title')->from(TABLE_CASE)->where('id')->in($relatedCaseIdList)->fetchPairs(); - $relatedExecutions = $this->dao->select('id, name')->from(TABLE_EXECUTION)->where('id')->in($relatedExecutionIdList)->fetchPairs(); - - /* fill some field with useful value. */ - if(isset($relatedModules[$bug->module])) $bug->module = $relatedModules[$bug->module]; - if(isset($relatedStories[$bug->story])) $bug->story = $relatedStories[$bug->story]; - if(isset($relatedTasks[$bug->task])) $bug->task = $relatedTasks[$bug->task]; - if(isset($relatedCases[$bug->case])) $bug->case = $relatedCases[$bug->case]; - if(isset($relatedExecutions[$bug->execution])) $bug->execution = $relatedExecutions[$bug->execution]; - } - return $bugs; - } - /** * Adjust the action is clickable. * diff --git a/module/bug/test/bug.class.php b/module/bug/test/bug.class.php index 2a7eb4035a..e0f4d15ea1 100644 --- a/module/bug/test/bug.class.php +++ b/module/bug/test/bug.class.php @@ -1839,28 +1839,6 @@ class bugTest return $datas; } - /** - * Test form customed bugs. - * - * @param array $bugIDList - * @access public - * @return array - */ - public function formCustomedBugsTest($bugIDList) - { - $bugs = $this->objectModel->getByIdList($bugIDList); - $array = $this->objectModel->formCustomedBugs($bugs); - - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $array; - } - } - /** * Test adjust the action is clickable. * diff --git a/module/bug/test/model/formcustomedbugs.php b/module/bug/test/model/formcustomedbugs.php deleted file mode 100755 index 9d7dfc20dd..0000000000 --- a/module/bug/test/model/formcustomedbugs.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env php -formCustomedBugs(); -cid=1 -pid=1 - -获取bug 1 2的module story task case execution名称 >> 产品模块1,软件需求2,0,0,迭代1;产品模块2,软件需求6,0,0,迭代1 -获取bug 3 4的module story task case execution名称 >> 产品模块3,软件需求10,0,0,迭代1;产品模块5,软件需求14,0,0,迭代2 -获取bug 5 6的module story task case execution名称 >> 产品模块6,软件需求18,0,0,迭代2;产品模块7,软件需求22,0,0,迭代2 -获取bug 7 8的module story task case execution名称 >> 产品模块11,软件需求26,0,0,迭代3;产品模块12,软件需求30,0,0,迭代3 -获取bug 9 10的module story task case execution名称 >> 产品模块13,软件需求34,0,0,迭代3;0,软件需求38,0,0,迭代 - -*/ - -$bugIDList1 = array('1', '2'); -$bugIDList2 = array('3', '4'); -$bugIDList3 = array('5', '6'); -$bugIDList4 = array('7', '8'); -$bugIDList5 = array('9', '10'); - -$bug = new bugTest(); -r($bug->formCustomedBugsTest($bugIDList1)) && p('1:module,story,task,case,execution;2:module,story,task,case,execution') && e('产品模块1,软件需求2,0,0,迭代1;产品模块2,软件需求6,0,0,迭代1'); // 获取bug 1 2的module story task case execution名称 -r($bug->formCustomedBugsTest($bugIDList2)) && p('3:module,story,task,case,execution;4:module,story,task,case,execution') && e('产品模块3,软件需求10,0,0,迭代1;产品模块5,软件需求14,0,0,迭代2'); // 获取bug 3 4的module story task case execution名称 -r($bug->formCustomedBugsTest($bugIDList3)) && p('5:module,story,task,case,execution;6:module,story,task,case,execution') && e('产品模块6,软件需求18,0,0,迭代2;产品模块7,软件需求22,0,0,迭代2'); // 获取bug 5 6的module story task case execution名称 -r($bug->formCustomedBugsTest($bugIDList4)) && p('7:module,story,task,case,execution;8:module,story,task,case,execution') && e('产品模块11,软件需求26,0,0,迭代3;产品模块12,软件需求30,0,0,迭代3'); // 获取bug 7 8的module story task case execution名称 -r($bug->formCustomedBugsTest($bugIDList5)) && p('9:module,story,task,case,execution;10:module,story,task,case,execution') && e('产品模块13,软件需求34,0,0,迭代3;0,软件需求38,0,0,迭代'); // 获取bug 9 10的module story task case execution名称 \ No newline at end of file