diff --git a/module/project/control.php b/module/project/control.php index 3e93fd746c..8799a214d1 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -311,10 +311,12 @@ class project extends control * Import tasks undoned from other projects. * * @param int $projectID + * @param int $fromProject + * @param bool $containDoing * @access public * @return void */ - public function importTask($toProject, $fromProject = 0) + public function importTask($toProject, $fromProject = 0, $containDoing = false) { if(!empty($_POST)) { @@ -325,7 +327,7 @@ class project extends control $project = $this->commonAction($toProject); $branches = $this->project->getProjectBranches($toProject); $tasks = $this->project->getTasks2Imported($toProject, $branches); - $projects = $this->project->getProjectsToImport(array_keys($tasks)); + $projects = $this->project->getProjectsToImport(array_keys($tasks), $containDoing); unset($projects[$toProject]); unset($tasks[$toProject]); @@ -352,6 +354,7 @@ class project extends control $this->view->tasks2Imported = $tasks2Imported; $this->view->projects = $projects; $this->view->projectID = $project->id; + $this->view->containDoing = $containDoing; $this->view->fromProject = $fromProject; $this->display(); } diff --git a/module/project/css/importtask.css b/module/project/css/importtask.css index 9c7db148a6..9c2bcbe15e 100644 --- a/module/project/css/importtask.css +++ b/module/project/css/importtask.css @@ -1,2 +1,2 @@ -#titlebar .input-group {position: relative; top: -6px; margin-left: 10px; width: 300px;} +#titlebar .input-group {position: relative; top: -6px; margin-left: 10px; width: 500px;} #titlebar .input-group-addon, #titlebar .form-control {font-size: 12px; padding: 5px 10px; line-height: 18px; height: 30px} diff --git a/module/project/js/importtask.js b/module/project/js/importtask.js index 65cf6f7dbd..56e68cb51b 100644 --- a/module/project/js/importtask.js +++ b/module/project/js/importtask.js @@ -1,6 +1,6 @@ function reload(toProject, fromProject) { - link = createLink('project','importtask','toProject='+toProject + '&fromProject='+fromProject); + link = createLink('project','importtask','toProject='+toProject + '&fromProject='+fromProject + '&containDoing=' + containDoing); location.href = link; } $(function() diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 46bc5fe121..5bcde02b31 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -50,6 +50,7 @@ $lang->project->mine = 'My Responsibility: '; $lang->project->other = 'Other:'; $lang->project->deleted = 'Deleted'; $lang->project->delayed = 'Delayed'; +$lang->project->containDoing = 'Contain doing project'; $lang->project->start = 'Start'; $lang->project->activate = 'Activate'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 3971e75082..de1d10bebc 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -50,6 +50,7 @@ $lang->project->mine = '我负责:'; $lang->project->other = '其他:'; $lang->project->deleted = '已删除'; $lang->project->delayed = '已延期'; +$lang->project->containDoing = '包含进行中的项目'; $lang->project->start = '开始'; $lang->project->activate = '激活'; diff --git a/module/project/model.php b/module/project/model.php index 11057ae0ff..20b13fbd34 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -974,7 +974,7 @@ class projectModel extends model * @access public * @return array */ - public function getProjectsToImport($projectIds) + public function getProjectsToImport($projectIds, $containDoing = 'false') { $projects = $this->dao->select('*')->from(TABLE_PROJECT) ->where('id')->in($projectIds) @@ -986,7 +986,14 @@ class projectModel extends model $now = date('Y-m-d'); foreach($projects as $id => $project) { - if($this->checkPriv($project) and ($project->status == 'done' or $project->end < $now)) $pairs[$id] = ucfirst(substr($project->code, 0, 1)) . ':' . $project->name; + if($containDoing) + { + if($this->checkPriv($project) and ($project->status == 'done' or $project->status == 'doing' or $project->end < $now)) $pairs[$id] = ucfirst(substr($project->code, 0, 1)) . ':' . $project->name; + } + else + { + if($this->checkPriv($project) and ($project->status == 'done' or $project->end < $now)) $pairs[$id] = ucfirst(substr($project->code, 0, 1)) . ':' . $project->name; + } } return $pairs; } diff --git a/module/project/view/importtask.html.php b/module/project/view/importtask.html.php index 26ed104a32..4a6b9afeb4 100644 --- a/module/project/view/importtask.html.php +++ b/module/project/view/importtask.html.php @@ -12,6 +12,7 @@ ?> +