diff --git a/module/project/control.php b/module/project/control.php index b8b3e27080..62a7cde7bd 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -123,32 +123,23 @@ class project extends control } /** - * Ajax get projects. + * 复制Kanban项目,获取项目数据。 + * Ajax get the kanban copy project. * * @access public * @return void */ public function ajaxGetCopyProjects() { - $data = fixer::input('post')->get(); + /* Get replicable kanban project pairs by model. */ + $projectKeys = $this->project->getCopyProjectPairs($this->post->name, $this->post->model); + $projects = $this->project->getPairsByModel('', 0, '', $projectKeys); - $model = $data->model; - if($data->model == 'agileplus') $model = array('scrum', 'agileplus'); - if($data->model == 'waterfallplus') $model = array('waterfall', 'waterfallplus'); - - $projectPairs = $this->dao->select('id, name')->from(TABLE_PROJECT) - ->where('type')->eq('project') - ->andWhere('deleted')->eq(0) - ->andWhere('vision')->eq($this->config->vision) - ->andWhere('model')->in($model) - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() - ->beginIF(trim($data->name))->andWhere('name')->like("%$data->name%")->fi() - ->fetchPairs(); - $projects = $this->project->getPairsByModel('', 0, '', array_keys($projectPairs)); + /* Building render pages requires data. */ $html = empty($projects) ? "