diff --git a/module/transfer/control.php b/module/transfer/control.php index 5381b2e003..fb0c45ec0f 100755 --- a/module/transfer/control.php +++ b/module/transfer/control.php @@ -124,6 +124,30 @@ class transfer extends control return $this->send(array('result' => 'success', 'load' => $locate, 'closeModal' => true)); } + /* 项目和执行中的需求导入时应选择需求类型. */ + if($module == 'story') + { + $this->app->loadLang('story'); + + $storyType = ''; + if($this->app->tab == 'project') + { + $project = $this->loadModel('project')->fetchByID($this->session->project); + $storyType = $project->storyType; + } + + if($storyType) + { + foreach($this->lang->story->typeList as $key => $value) + { + if(strpos(",$storyType,", ",$key,") === false) unset($this->lang->story->typeList[$key]); + } + } + + $this->view->isProjectStory = $this->app->tab == 'project'; + $this->view->typeList = $this->lang->story->typeList; + } + $this->view->title = $this->lang->transfer->importCase; $this->display(); } diff --git a/module/transfer/ui/exporttemplate.html.php b/module/transfer/ui/exporttemplate.html.php index 46101fb88a..6c511f1fa6 100644 --- a/module/transfer/ui/exporttemplate.html.php +++ b/module/transfer/ui/exporttemplate.html.php @@ -24,6 +24,15 @@ form set::type('number'), set::value(10) ), + !empty($isProjectStory) ? formGroup + ( + set::label($lang->story->type), + set::name('storyType'), + set::required(true), + set::control('picker'), + set::value('story'), + set::items($typeList) + ) : null, formGroup ( set::label($lang->file->extension), diff --git a/module/transfer/ui/import.html.php b/module/transfer/ui/import.html.php index bd3f1b5c56..cbf556678e 100644 --- a/module/transfer/ui/import.html.php +++ b/module/transfer/ui/import.html.php @@ -13,6 +13,14 @@ namespace zin; formPanel ( set::title($title), + !empty($isProjectStory) ? formGroup + ( + set::name('storyType'), + set::required(true), + set::control('picker'), + set::value('story'), + set::items($typeList) + ) : null, input(set::type('file'), set::name('file')), span(setClass('label secondary'), $lang->transfer->importNotice) );