diff --git a/module/project/css/story.css b/module/project/css/story.css index 23139c7980..c6bee2c15d 100644 --- a/module/project/css/story.css +++ b/module/project/css/story.css @@ -1,4 +1,4 @@ .icon-green-task-create {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -120px -200px;} .icon-green-task-batchCreate {padding:2px 10px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -199px -200px;} -.icon-green-testcase-create {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -80px -322px;} +.icon-green-testcase-batchCreate {padding:2px 7px 2px 10px; background:url(theme/default/images/main/zt-icons.png) -80px -322px;} diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 633bc63a15..20699f4cdc 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -83,7 +83,8 @@ $lang->task->batchCreate = $lang->project->batchWBS; common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list'); - if($productID) common::printIcon('story', 'createCase', "productID=$story->product&moduleID=0&from=¶m=0&storyID=$story->id", '', 'list', 'createCase'); + $lang->testcase->batchCreate = $lang->testcase->create; + if($productID) common::printIcon('testcase', 'batchCreate', "productID=$story->product&moduleID=0&storyID=$story->id", '', 'list'); $lang->project->unlinkStory = $lang->unlink; common::printIcon('project', 'unlinkStory', $param, '', 'list', '', 'hiddenwin'); diff --git a/module/testcase/control.php b/module/testcase/control.php index 905e399212..9c48fb1c86 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -277,16 +277,16 @@ class testcase extends control * * @param int $productID * @param int $moduleID - * @param int $testcaseID + * @param int $storyID * @access public * @return void */ - public function batchCreate($productID, $moduleID = 0) + public function batchCreate($productID, $moduleID = 0, $storyID = 0) { $this->loadModel('story'); if(!empty($_POST)) { - $caseID = $this->testcase->batchCreate($productID); + $caseID = $this->testcase->batchCreate($productID, $storyID); if(dao::isError()) die(js::error(dao::getError())); die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&browseType=byModule¶m=$moduleID"), 'parent')); } @@ -310,10 +310,10 @@ class testcase extends control $this->view->title = $title; $this->view->position = $position; $this->view->productID = $productID; + $this->view->story = $storyID ? $this->story->getByID($storyID) : ''; $this->view->productName = $this->products[$productID]; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0); $this->view->currentModuleID = $currentModuleID; - $this->view->stories = $this->story->getProductStoryPairs($productID); $this->view->type = $type; $this->view->title = $title; diff --git a/module/testcase/model.php b/module/testcase/model.php index f1c77ba09c..c0240b6836 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -73,12 +73,14 @@ class testcaseModel extends model } /** - * Create a batch case. + * Batch create cases. * + * @param int $productID + * @param int $storyID * @access public * @return void */ - function batchCreate($productID) + function batchCreate($productID, $storyID) { $now = helper::now(); $cases = fixer::input('post')->get(); @@ -90,7 +92,7 @@ class testcaseModel extends model $data[$i]->product = $productID; $data[$i]->module = $cases->module[$i] == 'same' ? ($i == 0 ? 0 : $data[$i-1]->module) : $cases->module[$i]; $data[$i]->type = $cases->type[$i] == 'same' ? ($i == 0 ? '' : $data[$i-1]->type) : $cases->type[$i]; - $data[$i]->story = $cases->story[$i] == 'same' ? ($i == 0 ? 0 : $data[$i-1]->story) : $cases->story[$i]; + $data[$i]->story = $storyID ? $storyID : ($cases->story[$i] == 'same' ? ($i == 0 ? 0 : $data[$i-1]->story) : $cases->story[$i]); $data[$i]->title = htmlspecialchars($cases->title[$i]); $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index 65aff6f447..c55cd13edb 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -16,28 +16,27 @@
- + - - + {$lang->testcase->story}";?> + testcase->batchCreate; $i++):?> testcase->same; if($i != 0) $currentModuleID = 'same';?> testcase->typeList['same'] = $lang->testcase->same; $type = ($i == 0 ? 'feature' : 'same');?> - testcase->same; $story = $i == 0 ? '' : 'same';?> - + - +
testcase->batchCreate;?>testcase->batchCreate; if($story) echo "{$lang->colon}STORY#{$story->id} $story->title";?>
idAB;?> testcase->module;?> testcase->type;?>testcase->story;?>testcase->title;?>testcase->title;?>
testcase->typeList, $type, "class=select-1");?>
' class='a-center'>