diff --git a/module/index/config.php b/module/index/config.php index bb5ad0c27e..5e0ece6c9b 100644 --- a/module/index/config.php +++ b/module/index/config.php @@ -38,3 +38,4 @@ $config->index->oldPages[] = 'weekly-index'; $config->index->oldPages[] = 'kanban-importticket'; $config->index->oldPages[] = 'message-ajaxgetdropmenuforold'; $config->index->oldPages[] = 'product-ajaxgetolddropmenu'; +$config->index->oldPages[] = 'project-ajaxgetolddropmenu'; diff --git a/module/project/control.php b/module/project/control.php index 392c29b640..139345bad8 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -127,6 +127,48 @@ class project extends control $this->display(); } + /** + * 旧页面:设置1.5级项目下拉菜单。 + * Ajax get project drop menu. + * + * @param int $projectID + * @param string $module + * @param string $method + * @access public + * @return void + */ + public function ajaxGetOldDropMenu(int $projectID, string $module, string $method, string $extra = '') + { + /* Set cookie for show all project. */ + $_COOKIE['showClosed'] = 1; + + /* Query user's project and program. */ + $projects = $this->project->getListByCurrentUser(); + $involvedProjects = $this->project->getInvolvedListByCurrentUser(); + $programs = $this->loadModel('program')->getPairs(true); + + /* Generate project tree. */ + $orderedProjects = array(); + foreach($projects as $project) + { + $project->parent = $this->program->getTopByID($project->parent); + $project->parent = isset($programs[$project->parent]) ? $project->parent : $project->id; + + $orderedProjects[$project->parent][] = $project; + } + + $this->view->link = $this->project->getProjectLink($module, $method, $projectID, $extra); // Create the link from module,method. + $this->view->projectID = $projectID; + $this->view->module = $module; + $this->view->method = $method; + $this->view->programs = $programs; + + $this->view->projects = $orderedProjects; + $this->view->involvedProjects = $involvedProjects; + + $this->display(); + } + /** * 移除项目团队成员时进行提示。 * Ajax prompts when removing project team members. diff --git a/module/project/model.php b/module/project/model.php index 7b3081d063..afc3f57c84 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -2647,8 +2647,11 @@ class projectModel extends model return $output; } - $dropMenuLink = helper::createLink('project', 'ajaxGetDropMenu', "objectID=$projectID&module=$currentModule&method=$currentMethod"); - $output = "