From 46c8d2c9234efa6859722aa0cc56f6bb7c53c81a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 5 Mar 2021 10:18:58 +0800 Subject: [PATCH] * Adjust code for todo module. --- module/tree/control.php | 109 ++++++++++++++--------------- module/tree/lang/de.php | 38 +++++----- module/tree/lang/en.php | 38 +++++----- module/tree/lang/fr.php | 38 +++++----- module/tree/lang/vi.php | 38 +++++----- module/tree/lang/zh-cn.php | 38 +++++----- module/tree/model.php | 140 ++++++++++++++++++------------------- 7 files changed, 218 insertions(+), 221 deletions(-) diff --git a/module/tree/control.php b/module/tree/control.php index 16d5fe17e9..3a071bfcf4 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -15,7 +15,7 @@ class tree extends control /** * Module browse. - * + * * @param int $rootID * @param string $viewType story|bug|case|doc * @param int $currentModuleID @@ -98,7 +98,7 @@ class tree extends control if($from == 'project') { $this->lang->navGroup->tree = 'project'; - $productPairs = $this->product->getProductPairsByProject($this->session->PRJ); + $productPairs = $this->product->getProductPairsByProject($this->session->project); } elseif($from == 'qa') { @@ -141,7 +141,7 @@ class tree extends control if($from == 'project') { $this->lang->navGroup->tree = 'project'; - $productPairs = $this->product->getProductPairsByProject($this->session->PRJ); + $productPairs = $this->product->getProductPairsByProject($this->session->project); } elseif($from == 'qa') { @@ -209,12 +209,12 @@ class tree extends control $this->lang->tree->menu = $this->lang->project->menu; $this->lang->tree->menuOrder = $this->lang->project->menuOrder; - /* The PRJ parameter needs to be present when the tree module belongs to the project grouping. */ - if($this->session->docList && $this->session->PRJ && strpos($this->session->docList, 'PRJ') === false) $this->session->set('docList', $this->session->docList . '?PRJ=' . $this->session->PRJ); + /* The project parameter needs to be present when the tree module belongs to the project grouping. */ + if($this->session->docList && $this->session->project && strpos($this->session->docList, 'project') === false) $this->session->set('docList', $this->session->docList . '?project=' . $this->session->project); } if($from == 'doc') $this->lang->navGroup->doc = 'doc'; - $type = $lib->product ? 'product' : ($lib->project ? 'project' : 'custom'); + $type = $lib->product ? 'product' : ($lib->execution ? 'project' : 'custom'); $this->doc->setMenu($type, $rootID, $currentModuleID); $this->lang->tree->menu = $this->lang->doc->menu; $this->lang->tree->menuOrder = $this->lang->doc->menuOrder; @@ -226,7 +226,7 @@ class tree extends control } elseif($viewType == 'line') { - $products = $this->product->getPairs('', $this->session->PRJ); + $products = $this->product->getPairs('', $this->session->project); $this->lang->set('menugroup.tree', 'product'); $this->product->setMenu($products, $rootID, $branch, 'line', '', 'line'); @@ -287,63 +287,60 @@ class tree extends control /** * Browse task module. - * - * @param int $rootID - * @param int $productID - * @param int $currentModuleID + * + * @param int $rootID + * @param int $productID + * @param int $currentModuleID * @access public * @return void */ public function browseTask($rootID, $productID = 0, $currentModuleID = 0) { - $this->lang->navGroup->tree = 'project'; + $this->lang->navGroup->tree = 'execution'; - /* Get project. */ - $project = $this->loadModel('project')->getById($rootID); - $this->view->root = $project; + /* Get execution. */ + $execution = $this->loadModel('execution')->getById($rootID); + $this->view->root = $execution; /* Get all associated products. */ - $products = $this->project->getProducts($rootID); + $products = $this->execution->getProducts($rootID); $this->view->products = $products; - $projects = $this->project->getExecutionPairs($this->session->PRJ); + $executions = $this->execution->getPairs($this->session->project); /* Set menu. */ - $this->lang->set('menugroup.tree', 'project'); - $this->project->setMenu($projects, $rootID); - $this->lang->tree->menu = $this->lang->project->menu; - $this->lang->tree->menuOrder = $this->lang->project->menuOrder; + $this->lang->set('menugroup.tree', 'execution'); + $this->execution->setMenu($executions, $rootID); + $this->lang->tree->menu = $this->lang->execution->menu; + $this->lang->tree->menuOrder = $this->lang->execution->menuOrder; - unset($projects[$rootID]); - $currentProject = key($projects); - $parentModules = $this->tree->getParents($currentModuleID); - $newModule = (version_compare($project->openedVersion, '4.1', '>') and $products) ? true : false; + unset($executions[$rootID]); + $parentModules = $this->tree->getParents($currentModuleID); + $newModule = (version_compare($execution->openedVersion, '4.1', '>') and $products) ? true : false; - $title = $this->lang->tree->manageProject; - $position[] = html::a($this->createLink('project', 'task', "projectID=$rootID"), $project->name); - $position[] = $this->lang->tree->manageProject; + $title = $this->lang->tree->manageExecution; + $position[] = html::a($this->createLink('execution', 'task', "executionID=$rootID"), $execution->name); + $position[] = $this->lang->tree->manageExecution; $this->view->title = $title; $this->view->position = $position; $this->view->rootID = $rootID; $this->view->productID = $productID; - $this->view->allProject = $projects; + $this->view->allProject = $executions; $this->view->newModule = $newModule; - $this->view->currentProject = $currentProject; - $this->view->projectModules = $this->tree->getTaskOptionMenu($currentProject, $productID); $this->view->modules = $this->tree->getTaskTreeMenu($rootID, $productID, $rooteModuleID = 0, array('treeModel', 'createTaskManageLink'), 'allModule'); $this->view->sons = $this->tree->getTaskSons($rootID, $productID, $currentModuleID); $this->view->parentModules = $parentModules; $this->view->currentModuleID = $currentModuleID; $this->view->tree = $this->tree->getTaskStructure($rootID, $productID); - $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. + $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->display(); - } + } /** * Edit a module. - * - * @param int $moduleID + * + * @param int $moduleID * @access public * @return void */ @@ -393,9 +390,9 @@ class tree extends control /** * Fix path, grades. - * - * @param string $root - * @param string $type + * + * @param string $root + * @param string $type * @access public * @return void */ @@ -407,7 +404,7 @@ class tree extends control /** * Update modules' orders. - * + * * @access public * @return void */ @@ -422,9 +419,9 @@ class tree extends control /** * Manage child modules. - * - * @param int $rootID - * @param string $viewType + * + * @param int $rootID + * @param string $viewType * @access public * @return void */ @@ -442,9 +439,9 @@ class tree extends control /** * Delete a module. - * - * @param int $rootID - * @param int $moduleID + * + * @param int $rootID + * @param int $moduleID * @param string $confirm yes|no * @access public * @return void @@ -468,8 +465,8 @@ class tree extends control /** * AJAX: Get the option menu of modules. - * - * @param int $rootID + * + * @param int $rootID * @param string $viewType * @param int $branch * @param int $rootModuleID @@ -483,7 +480,7 @@ class tree extends control { if($viewType == 'task') { - $optionMenu = $this->tree->getTaskOptionMenu($rootID, 0, 0, $extra); + $optionMenu = $this->tree->getTaskOptionMenu($rootID, 0, 0, $extra); } else { @@ -531,11 +528,11 @@ class tree extends control /** * Ajax get drop menu. - * - * @param int $rootID - * @param string $module - * @param string $method - * @param string $extra + * + * @param int $rootID + * @param string $module + * @param string $method + * @param string $extra * @access public * @return void */ @@ -581,9 +578,9 @@ class tree extends control /** * AJAX: get a module's son modules. - * - * @param int $moduleID - * @param int $rootID + * + * @param int $moduleID + * @param int $rootID * @param string $type * @access public * @return string json_encoded modules. diff --git a/module/tree/lang/de.php b/module/tree/lang/de.php index e52a1ebe52..c4c54e2fcc 100644 --- a/module/tree/lang/de.php +++ b/module/tree/lang/de.php @@ -18,7 +18,7 @@ $lang->tree->browseTask = 'Aufgaben Modul verwalten'; $lang->tree->manage = 'Modul verwalten'; $lang->tree->fix = 'Fix'; $lang->tree->manageProduct = "Verwalte {$lang->productCommon}"; -$lang->tree->manageProject = "Verwalte {$lang->executionCommon}"; +$lang->tree->manageExecution = "Verwalte {$lang->executionCommon}"; $lang->tree->manageLine = "Manage {$lang->productCommon} Line"; $lang->tree->manageBug = 'Verwalte Bugs'; $lang->tree->manageCase = 'Verwalte Fälle'; @@ -45,21 +45,21 @@ $lang->tree->successFixed = 'Fixed.'; $lang->tree->repeatName = 'The name "%s" exists!'; $lang->tree->shouldNotBlank = 'Module name should not be blank!'; -$lang->tree->module = 'Modul'; -$lang->tree->name = 'Name'; -$lang->tree->line = "{$lang->productCommon} Line"; -$lang->tree->cate = 'Kategorie Name'; -$lang->tree->root = 'Root'; -$lang->tree->branch = 'Platform/Branch'; -$lang->tree->path = 'Pfad'; -$lang->tree->type = 'Typ'; -$lang->tree->parent = 'Übergeordnet'; -$lang->tree->parentCate = 'Parent Category'; -$lang->tree->child = 'Untergeordnet'; -$lang->tree->lineChild = "Child {$lang->productCommon} Line"; -$lang->tree->owner = 'Besitzer'; -$lang->tree->order = 'Reihenfolge'; -$lang->tree->short = 'Sortierung'; -$lang->tree->all = 'Alle Module'; -$lang->tree->projectDoc = "{$lang->executionCommon} Dok"; -$lang->tree->product = $lang->productCommon; +$lang->tree->module = 'Modul'; +$lang->tree->name = 'Name'; +$lang->tree->line = "{$lang->productCommon} Line"; +$lang->tree->cate = 'Kategorie Name'; +$lang->tree->root = 'Root'; +$lang->tree->branch = 'Platform/Branch'; +$lang->tree->path = 'Pfad'; +$lang->tree->type = 'Typ'; +$lang->tree->parent = 'Übergeordnet'; +$lang->tree->parentCate = 'Parent Category'; +$lang->tree->child = 'Untergeordnet'; +$lang->tree->lineChild = "Child {$lang->productCommon} Line"; +$lang->tree->owner = 'Besitzer'; +$lang->tree->order = 'Reihenfolge'; +$lang->tree->short = 'Sortierung'; +$lang->tree->all = 'Alle Module'; +$lang->tree->executionDoc = "{$lang->executionCommon} Dok"; +$lang->tree->product = $lang->productCommon; diff --git a/module/tree/lang/en.php b/module/tree/lang/en.php index 656214ac57..f7d3139185 100644 --- a/module/tree/lang/en.php +++ b/module/tree/lang/en.php @@ -18,7 +18,7 @@ $lang->tree->browseTask = 'Manage Task Module'; $lang->tree->manage = 'Manage Module'; $lang->tree->fix = 'Fix Module'; $lang->tree->manageProduct = "Manage {$lang->productCommon} Modules"; -$lang->tree->manageProject = "Manage {$lang->executionCommon} Modules"; +$lang->tree->manageExecution = "Manage {$lang->executionCommon} Modules"; $lang->tree->manageLine = "Manage {$lang->productCommon} Line"; $lang->tree->manageBug = 'Manage Bug'; $lang->tree->manageCase = 'Manage Case'; @@ -45,21 +45,21 @@ $lang->tree->successFixed = 'Fixed.'; $lang->tree->repeatName = 'The name "%s" exists!'; $lang->tree->shouldNotBlank = 'Module name should not be blank!'; -$lang->tree->module = 'Module'; -$lang->tree->name = 'Name'; -$lang->tree->line = "{$lang->productCommon} Line"; -$lang->tree->cate = 'Category'; -$lang->tree->root = 'Root'; -$lang->tree->branch = 'Platform/Branch'; -$lang->tree->path = 'Path'; -$lang->tree->type = 'Type'; -$lang->tree->parent = 'Parent Module'; -$lang->tree->parentCate = 'Parent Category'; -$lang->tree->child = 'Children'; -$lang->tree->lineChild = "Child {$lang->productCommon} Line"; -$lang->tree->owner = 'Owner'; -$lang->tree->order = 'Order'; -$lang->tree->short = 'Abbr.'; -$lang->tree->all = 'All Modules'; -$lang->tree->projectDoc = "{$lang->executionCommon} Document"; -$lang->tree->product = $lang->productCommon; +$lang->tree->module = 'Module'; +$lang->tree->name = 'Name'; +$lang->tree->line = "{$lang->productCommon} Line"; +$lang->tree->cate = 'Category'; +$lang->tree->root = 'Root'; +$lang->tree->branch = 'Platform/Branch'; +$lang->tree->path = 'Path'; +$lang->tree->type = 'Type'; +$lang->tree->parent = 'Parent Module'; +$lang->tree->parentCate = 'Parent Category'; +$lang->tree->child = 'Children'; +$lang->tree->lineChild = "Child {$lang->productCommon} Line"; +$lang->tree->owner = 'Owner'; +$lang->tree->order = 'Order'; +$lang->tree->short = 'Abbr.'; +$lang->tree->all = 'All Modules'; +$lang->tree->executionDoc = "{$lang->executionCommon} Document"; +$lang->tree->product = $lang->productCommon; diff --git a/module/tree/lang/fr.php b/module/tree/lang/fr.php index 160860729e..1d717b6773 100644 --- a/module/tree/lang/fr.php +++ b/module/tree/lang/fr.php @@ -18,7 +18,7 @@ $lang->tree->browseTask = 'Gérer les Modules Tâche'; $lang->tree->manage = 'Gérer les Modules'; $lang->tree->fix = 'Corrigez Module'; $lang->tree->manageProduct = "Gérer les Modules {$lang->productCommon}"; -$lang->tree->manageProject = "Gérer les Modules {$lang->executionCommon}"; +$lang->tree->manageExecution = "Gérer les Modules {$lang->executionCommon}"; $lang->tree->manageLine = 'Gérer Ligne Produit'; $lang->tree->manageBug = 'Gérer Bugs'; $lang->tree->manageCase = 'Gérer CasTests'; @@ -45,21 +45,21 @@ $lang->tree->successFixed = 'Corrigé.'; $lang->tree->repeatName = 'Le nom "%s" existe déjà !'; $lang->tree->shouldNotBlank = 'Module name should not be blank!'; -$lang->tree->module = 'Module'; -$lang->tree->name = 'Nom'; -$lang->tree->line = 'Ligne Produit'; -$lang->tree->cate = 'Catégorie'; -$lang->tree->root = 'Racine'; -$lang->tree->branch = 'Plateforme/Branche'; -$lang->tree->path = 'Chemin'; -$lang->tree->type = 'Type'; -$lang->tree->parent = 'Module Parent'; -$lang->tree->parentCate = 'Catégorie Parente'; -$lang->tree->child = 'Enfants'; -$lang->tree->lineChild = 'Sous-Ligne Produit'; -$lang->tree->owner = 'Propriétaire'; -$lang->tree->order = 'Ordre'; -$lang->tree->short = 'Abbr.'; -$lang->tree->all = 'Tous les Modules'; -$lang->tree->projectDoc = "Document {$lang->executionCommon}"; -$lang->tree->product = $lang->productCommon; +$lang->tree->module = 'Module'; +$lang->tree->name = 'Nom'; +$lang->tree->line = 'Ligne Produit'; +$lang->tree->cate = 'Catégorie'; +$lang->tree->root = 'Racine'; +$lang->tree->branch = 'Plateforme/Branche'; +$lang->tree->path = 'Chemin'; +$lang->tree->type = 'Type'; +$lang->tree->parent = 'Module Parent'; +$lang->tree->parentCate = 'Catégorie Parente'; +$lang->tree->child = 'Enfants'; +$lang->tree->lineChild = 'Sous-Ligne Produit'; +$lang->tree->owner = 'Propriétaire'; +$lang->tree->order = 'Ordre'; +$lang->tree->short = 'Abbr.'; +$lang->tree->all = 'Tous les Modules'; +$lang->tree->executionDoc = "Document {$lang->executionCommon}"; +$lang->tree->product = $lang->productCommon; diff --git a/module/tree/lang/vi.php b/module/tree/lang/vi.php index a21179b691..5531f5a04e 100644 --- a/module/tree/lang/vi.php +++ b/module/tree/lang/vi.php @@ -18,7 +18,7 @@ $lang->tree->browseTask = 'Quản lý Module nhiệm vụ'; $lang->tree->manage = 'Quản lý Module'; $lang->tree->fix = 'Sửa Module'; $lang->tree->manageProduct = "Quản lý module {$lang->productCommon}"; -$lang->tree->manageProject = "Quản lý module {$lang->executionCommon}"; +$lang->tree->manageExecution = "Quản lý module {$lang->executionCommon}"; $lang->tree->manageLine = "Quản lý dòng {$lang->productCommon}"; $lang->tree->manageBug = 'Quản lý Bug'; $lang->tree->manageCase = 'Quản lý tình huống'; @@ -45,21 +45,21 @@ $lang->tree->successFixed = 'Đã sửa'; $lang->tree->repeatName = 'Tên "%s" đã tồn tại!'; $lang->tree->shouldNotBlank = 'Module name should not be blank!'; -$lang->tree->module = 'Module'; -$lang->tree->name = 'Tên'; -$lang->tree->line = "Dòng {$lang->productCommon}"; -$lang->tree->cate = 'Danh mục'; -$lang->tree->root = 'Root'; -$lang->tree->branch = 'Platform/Branch'; -$lang->tree->path = 'Đường dẫn'; -$lang->tree->type = 'Loại'; -$lang->tree->parent = 'Module mẹ'; -$lang->tree->parentCate = 'Danh mục mẹ'; -$lang->tree->child = 'Con'; -$lang->tree->lineChild = "Dòng {$lang->productCommon} con"; -$lang->tree->owner = 'Sở hữu'; -$lang->tree->order = 'Sắp xếp'; -$lang->tree->short = 'V.tắt'; -$lang->tree->all = 'Tất cả Modules'; -$lang->tree->projectDoc = "Tài liệu {$lang->executionCommon}"; -$lang->tree->product = $lang->productCommon; +$lang->tree->module = 'Module'; +$lang->tree->name = 'Tên'; +$lang->tree->line = "Dòng {$lang->productCommon}"; +$lang->tree->cate = 'Danh mục'; +$lang->tree->root = 'Root'; +$lang->tree->branch = 'Platform/Branch'; +$lang->tree->path = 'Đường dẫn'; +$lang->tree->type = 'Loại'; +$lang->tree->parent = 'Module mẹ'; +$lang->tree->parentCate = 'Danh mục mẹ'; +$lang->tree->child = 'Con'; +$lang->tree->lineChild = "Dòng {$lang->productCommon} con"; +$lang->tree->owner = 'Sở hữu'; +$lang->tree->order = 'Sắp xếp'; +$lang->tree->short = 'V.tắt'; +$lang->tree->all = 'Tất cả Modules'; +$lang->tree->executionDoc = "Tài liệu {$lang->executionCommon}"; +$lang->tree->product = $lang->productCommon; diff --git a/module/tree/lang/zh-cn.php b/module/tree/lang/zh-cn.php index 5f5ebca72f..3ac73e24c5 100644 --- a/module/tree/lang/zh-cn.php +++ b/module/tree/lang/zh-cn.php @@ -18,7 +18,7 @@ $lang->tree->browseTask = '任务模块维护'; $lang->tree->manage = '维护模块'; $lang->tree->fix = '修正数据'; $lang->tree->manageProduct = "维护{$lang->productCommon}视图模块"; -$lang->tree->manageProject = "维护{$lang->executionCommon}视图模块"; +$lang->tree->manageExecution = "维护{$lang->executionCommon}视图模块"; $lang->tree->manageLine = "维护{$lang->productCommon}线"; $lang->tree->manageBug = '维护测试视图模块'; $lang->tree->manageCase = '维护用例视图模块'; @@ -45,21 +45,21 @@ $lang->tree->successFixed = '成功修正数据!'; $lang->tree->repeatName = '模块名“%s”已经存在!'; $lang->tree->shouldNotBlank = '模块名不能为空格!'; -$lang->tree->module = '模块'; -$lang->tree->name = '模块名称'; -$lang->tree->line = "{$lang->productCommon}线名称"; -$lang->tree->cate = '分类名称'; -$lang->tree->root = '所属根'; -$lang->tree->branch = '平台/分支'; -$lang->tree->path = '路径'; -$lang->tree->type = '类型'; -$lang->tree->parent = '上级模块'; -$lang->tree->parentCate = '上级分类'; -$lang->tree->child = '子模块'; -$lang->tree->lineChild = "子{$lang->productCommon}线"; -$lang->tree->owner = '负责人'; -$lang->tree->order = '排序'; -$lang->tree->short = '简称'; -$lang->tree->all = '所有模块'; -$lang->tree->projectDoc = "{$lang->executionCommon}文档"; -$lang->tree->product = "所属{$lang->productCommon}"; +$lang->tree->module = '模块'; +$lang->tree->name = '模块名称'; +$lang->tree->line = "{$lang->productCommon}线名称"; +$lang->tree->cate = '分类名称'; +$lang->tree->root = '所属根'; +$lang->tree->branch = '平台/分支'; +$lang->tree->path = '路径'; +$lang->tree->type = '类型'; +$lang->tree->parent = '上级模块'; +$lang->tree->parentCate = '上级分类'; +$lang->tree->child = '子模块'; +$lang->tree->lineChild = "子{$lang->productCommon}线"; +$lang->tree->owner = '负责人'; +$lang->tree->order = '排序'; +$lang->tree->short = '简称'; +$lang->tree->all = '所有模块'; +$lang->tree->executionDoc = "{$lang->executionCommon}文档"; +$lang->tree->product = "所属{$lang->productCommon}"; diff --git a/module/tree/model.php b/module/tree/model.php index 4f8bd4077a..df186b2660 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -46,7 +46,7 @@ class treeModel extends model $pairs[0] = '/'; foreach($modules as $module) { - if($module->grade == 1) + if($module->grade == 1) { $pairs[$module->id] = '/' . $module->name; continue; @@ -132,8 +132,8 @@ class treeModel extends model } } elseif($product and $product->type == 'normal') - { - $branches = array(0 => ''); + { + $branches = array(0 => ''); } } @@ -239,7 +239,7 @@ class treeModel extends model } $treeMenu = array(); $lastMenu[] = '/'; - $projectModules = $this->getTaskTreeModules($rootID, true); + $executionModules = $this->getTaskTreeModules($rootID, true); $noProductModules = $this->dao->select('*')->from(TABLE_MODULE) ->where('root')->eq((int)$rootID) ->andWhere('type')->eq('task') @@ -292,11 +292,11 @@ class treeModel extends model { if(!strpos($menu, '|')) continue; list($label, $moduleID) = explode('|', $menu); - if(isset($projectModules[$moduleID]) or strpos($extra, 'allModule') !== false) $lastMenu[$moduleID] = $label; + if(isset($executionModules[$moduleID]) or strpos($extra, 'allModule') !== false) $lastMenu[$moduleID] = $label; } foreach($topMenu as $moduleID => $moduleName) { - if(!isset($projectModules[$moduleID])) unset($treeMenu[$moduleID]); + if(!isset($executionModules[$moduleID])) unset($treeMenu[$moduleID]); } } } @@ -433,7 +433,7 @@ class treeModel extends model */ public function getTaskTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc, $extra = '') { - $extra = array('projectID' => $rootID, 'productID' => $productID, 'tip' => true, 'extra' => $extra); + $extra = array('executionID' => $rootID, 'productID' => $productID, 'tip' => true, 'extra' => $extra); /* If createdVersion <= 4.1, go to getTreeMenu(). */ $products = $this->loadModel('product')->getProductPairsByProject($rootID); @@ -459,7 +459,7 @@ class treeModel extends model $manage = $userFunc[1] == 'createTaskManageLink' ? true : false; /* if not manage, only get linked modules and ignore others. */ - if(!$manage) $projectModules = $this->getTaskTreeModules($rootID, true); + if(!$manage) $executionModules = $this->getTaskTreeModules($rootID, true); /* Get module according to product. */ $productNum = count($products); @@ -472,7 +472,7 @@ class treeModel extends model } else { - $link = helper::createLink('project', 'task', "root=$rootID&status=byProduct&praram=$id"); + $link = helper::createLink('execution', 'task', "executionID=$rootID&status=byProduct&praram=$id"); if($productNum > 1) $menu .= "
  • " . html::a($link, $product, '_self', "id='product$id'"); } @@ -488,9 +488,9 @@ class treeModel extends model ->orderBy('grade desc, `order`, type') ->get(); $stmt = $this->dbh->query($query); - while($module = $stmt->fetch()) + while($module = $stmt->fetch()) { - if(!$manage and !isset($projectModules[$module->id]) and strpos($extra['extra'], 'allModule') === false) continue; + if(!$manage and !isset($executionModules[$module->id]) and strpos($extra['extra'], 'allModule') === false) continue; $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra); } if(isset($treeMenu[0]) and $branch) $treeMenu[0] = "
  • $branchName
  • "; @@ -501,7 +501,7 @@ class treeModel extends model $menu .= $tree; } - /* Get project module. */ + /* Get execution module. */ if($startModule == 0) { /* tree menu. */ @@ -524,14 +524,14 @@ class treeModel extends model /** * Get full task tree - * @param integer $projectID, common value is project id + * @param integer $executionID, common value is execution id * @param integer $productID * @access public * @return array */ public function getTaskStructure($rootID, $productID = 0) { - $extra = array('projectID' => $rootID, 'productID' => $productID, 'tip' => true); + $extra = array('executionID' => $rootID, 'productID' => $productID, 'tip' => true); /* If createdVersion <= 4.1, go to getTreeMenu(). */ $products = $this->loadModel('product')->getProductPairsByProject($rootID); @@ -541,12 +541,12 @@ class treeModel extends model { $extra['tip'] = false; $stmt = $this->dbh->query($this->buildMenuQuery($rootID, 'task', $startModule = 0)); - if(empty($products)) $this->config->project->task->allModule = 1; + if(empty($products)) $this->config->execution->task->allModule = 1; return $this->getDataStructure($stmt, 'task'); } /* only get linked modules and ignore others. */ - $projectModules = $this->getTaskTreeModules($rootID, true); + $executionModules = $this->getTaskTreeModules($rootID, true); /* Get module according to product. */ $fullTrees = array(); @@ -564,10 +564,10 @@ class treeModel extends model ->orderBy('grade desc, `order`, type') ->get(); $stmt = $this->dbh->query($query); - if($branch == 0) $productTree = $this->getDataStructure($stmt, 'task', $projectModules); + if($branch == 0) $productTree = $this->getDataStructure($stmt, 'task', $executionModules); if($branch != 0) { - $children = $this->getDataStructure($stmt, 'task', $projectModules); + $children = $this->getDataStructure($stmt, 'task', $executionModules); if($children) $branchTrees[] = array('name' => $branchName, 'root' => $id, 'type' => 'branch', 'actions' => false, 'children' => $children); } } @@ -575,15 +575,15 @@ class treeModel extends model $fullTrees[] = array('name' => $productInfo->name, 'root' => $id, 'type' => 'product', 'actions' => false, 'children' => $productTree); } - /* Get project module. */ - $query = $this->dao->select('*')->from(TABLE_MODULE) + /* Get execution module. */ + $query = $this->dao->select('*')->from(TABLE_MODULE) ->where('root')->eq((int)$rootID) ->andWhere('type')->eq('task') ->andWhere('deleted')->eq(0) ->orderBy('grade desc, `order`, type') ->get(); $stmt = $this->dbh->query($query); - $taskTrees = $this->getDataStructure($stmt, 'task', $projectModules); + $taskTrees = $this->getDataStructure($stmt, 'task', $executionModules); foreach($taskTrees as $taskModule) $fullTrees[] = $taskModule; return $fullTrees; } @@ -603,7 +603,7 @@ class treeModel extends model } /** - * Get project story tree menu. + * Get execution story tree menu. * * @param int $rootID * @param int $startModule @@ -613,7 +613,7 @@ class treeModel extends model */ public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc) { - $extra['projectID'] = $rootID; + $extra['executionID'] = $rootID; $menu = "