diff --git a/module/project/control.php b/module/project/control.php index 4ab4477ea1..a3b3a0611c 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -984,7 +984,7 @@ class project extends control $acl = $copyProject->acl; $whitelist = $copyProject->whitelist; $products = $this->project->getProducts($copyProjectID); - } + } if(!empty($planID)) { @@ -1462,7 +1462,7 @@ class project extends control $this->view->project = $project; $this->view->projectID = $projectID; $this->view->level = $type; - $this->view->tree = $tree; + $this->view->tree = $this->project->printTree($tree); $this->display(); } diff --git a/module/project/css/tree.css b/module/project/css/tree.css index ccb2a8032d..ff6b6868bf 100644 --- a/module/project/css/tree.css +++ b/module/project/css/tree.css @@ -1,35 +1,51 @@ -.no-padding {padding: 0!important;} +#taskTree li {padding: 0 0 0 8px;} +#taskTree li.has-list {padding-left: 20px;} +#taskTree li > a {display: block; padding: 5px 0; border-radius: 2px; padding-left: 6px;} +#taskTree li > a > span {display: inline-block;} +#taskTree li > a > span + span {margin-left: 8px;} +#taskTree li.selected > a {background-color: #E8F3FC;} +#taskTree li.selected > a > span.title {color: #006AF1;} +.label-product, #taskTree .item-product > a > .label-type {background: #88DE8B;} +.label-story, #taskTree .item-story > a > .label-type {background: #00A9FC;} +.label-module, #taskTree .item-module > a > .label-type {background: #52CEDD;} +.label-task, #taskTree .item-task > a > .label-type {background: #006AF1;} +#taskTree li > a > span.title {color: #3C4353; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;} +#taskTree li > a > span.user {color: #A6AAB8;} +#taskTree li > a > span.user > .icon-person {font-size: 14px; position: relative; top: -1px;} +#taskTree li > .list-toggle {transform: rotate(0deg); width: 16px; height: 16px; border: 4px solid #CBD0DB; border-radius: 2px; top: 7px;} +#taskTree li > .list-toggle:before {content: ' '; display: block; position: absolute; border: 1px solid #CBD0DB; top: 2px; left: -3px; right: -3px; bottom: 2px; min-width: 0; transition: all .2s;} +#taskTree li > .list-toggle:hover:before, +#taskTree li > .list-toggle:hover {border-color: #006AF1;} +#taskTree li.open > .list-toggle {width: 12px; height: 12px; top: 9px; background-color: #CBD0DB; border-width: 3px; left: 3px;} +#taskTree li.open > .list-toggle:before {border: none; height: 2px; width: 6px; left: 0; top: 2px; background: #fff;} +#taskTree li.open > .list-toggle:hover {background: #006AF1;} -#projectTree {margin-bottom: 0} -#projectTree .tree-item-id {display: inline-block; font-size: 12px; border: 1px solid #aaa; line-height: 14px; color: #666; padding: 0 2px; margin-right: 5px; min-width: 16px; text-align: center; border-radius: 1px;} -#projectTree .label-story {line-height: 14px; padding: 0 2px; font-size: 12px; display: inline-flex; margin-right: 5px; position: relative; top: -1px; background: #8666b8; color: #fff; border: 1px solid #8666b8; border-radius: 1px;} -#projectTree > .tree-action-item {display: none!important} -#projectTree li > .tree-item-wrapper > .tree-toggle {display: block} -#projectTree li > .tree-item-wrapper:hover {background-color: #edf3fe; cursor: pointer; margin-left: -20px; padding-left: 20px;} -#projectTree li {line-height: 24px; padding-top: 0; padding-bottom: 0} -#projectTree > li.open > .tree-item-wrapper {border-bottom: none} -#projectTree.tree li.has-list.open > ul:after {top: -10px; bottom: 17px; display: none} -#projectTree.tree ul > li.has-list:after {top: 10px} -#projectTree.tree ul > li:after {top: 11px} -#projectTree.tree ul > li:before {display: block; content: ' '; border: none; border-left: 1px dotted #999; top: -8px; bottom: 9px; left: -11px; position: absolute; width: auto; height: auto} -#projectTree.tree ul > li:last-child:before {bottom: auto; height: 19px} -#projectTree.tree ul > li > .tree-item-wrapper:before {display: none;} -#projectTree.tree ul > li.has-list > .tree-item-wrapper:before {display: none;} -#projectTree.tree ul > li.item-type-task > .tree-item-wrapper {padding-left: 15px; margin-left: -15px;} -#projectTree.tree ul > li.item-type-task > .tree-item-wrapper:hover {background-color: #edf3fe} -#projectTree.tree ul > li.item-type-task > .tree-item-wrapper:before {left: 0; z-index: 2} -#projectTree.tree li>.list-toggle {top: -2px} -#projectTree.tree li:before {display: none} -#projectTree .item-type-story > ul > li {padding-left: 10px;} -#projectTree .item-type-tasks > .tree-item-wrapper:hover {background-color: #f5f5f5} -#projectTree .task-assignto {display: inline-block; margin-left: 10px; color: #808080} -#projectTree .task-info {display: none;} -#projectTree .task-info > div {display: inline-block; margin: 0 5px;} -#projectTree .task-info > div.buttons {position: relative; top: 2px} -#projectTree .item-type-task:hover .task-info {display: inline-block; margin-left:10px;} +#taskTree ul > li:after {display: block; position: absolute; content: ' '; border-top: 2px solid #EDEFF3; top: 14px; left: -12px; z-index: 1; width: 10px;} +#taskTree ul > li:before, +#taskTree ul > li.has-list:before {background: none; content: ' '; display: block; position: absolute; width: auto; height: auto; border: none; border-left: 2px solid #EDEFF3; top: -13px; bottom: 12px; left: -12px;} +#taskTree ul > li:last-child:before {bottom: auto; height: 29px;} +#taskTree ul > li:first-child:before {top: -9px;} +#taskTree ul > li.tree-single-item:before {height: 23px;} +#taskTree ul > li.has-list:after {width: 14px;} -.tree-view-btn {min-width: 36px;} -.main > .panel > .panel-heading > .panel-actions {margin-top: -8px; margin-right: -12px;} +.tree-show-root .btn-tree-view[data-type="root"], +.btn-tree-view[data-type="all"] {display: none;} +.tree-show-root .btn-tree-view[data-type="all"] {display: inline-block;} -.label-task-count {background: #ddd; color: #333} +#itemContent {min-height: 200px;} +#mainContent > .side-col {width: 460px; display: table-cell; overflow: hidden; transition: width .2s;} +#mainContent > .side-col > .cell {opacity: 1; transition: opacity .2s .1s;} +#mainContent.hide-side > .side-col {display: table-cell; width: 0px;} +#mainContent.hide-side > .side-col > .cell {opacity: 0;} + +h2.detail-title {font-size: 16px;} +h2.detail-title .label-id, h2.detail-title .label {top: -1px} +#itemContent > .detail:first-child {padding-top: 10px;} +.detail-content > .btn-toolbar {margin-top: 15px;} +.detail-content > .infos > span {display: inline-block;} +.detail-content > .infos > span + span {margin-left: 15px;} +.detail-content > .infos + .infos {margin-top: 5px;} +.detail + .detail {padding-top: 10px;} +.btn-comment.pull-right {z-index: 10;} +details .btn-comment.pull-right {right: 30px;} diff --git a/module/project/js/tree.js b/module/project/js/tree.js new file mode 100644 index 0000000000..4e8f461880 --- /dev/null +++ b/module/project/js/tree.js @@ -0,0 +1,100 @@ +$(function() +{ + var $taskTree = $('#taskTree').tree( + { + name: 'taskTree', + initialState: 'preserve' + }); + + var taskTree = $taskTree.data('zui.tree'); + + // 根据列表展开树形列表 + var showTreeLevel = function(level) + { + if (level === 'root') + { + taskTree.collapse(); + } + else if (level === 'all') + { + taskTree.collapse(); + taskTree.expand($taskTree.find('li.has-list'), true); + } + else if (level === 'task') + { + taskTree.collapse(); + taskTree.show($taskTree.find('li.item-task').parent().parent(), true); + } + else if (level === 'story') + { + taskTree.collapse(); + taskTree.show($taskTree.find('li.item-story').parent().parent(), true); + } + $('#main').toggleClass('tree-show-root', level === 'root'); + }; + + $(document).on('click', '.btn-tree-view', function() + { + showTreeLevel($(this).data('type')); + }); + + // 第一次访问时,展示所以节点 + if (!$.zui.store.get('zui.tree::taskTree#taskTree')) showTreeLevel('all'); + + // 在右侧显示内容 + var $itemContent = $('#itemContent'); + var $mainContent = $('#mainContent'); + var isItemLoading = false, lastAjaxRequest; + var showItem = function(url, loadingText) + { + $.zui.messager.hide(); + $mainContent.toggleClass('hide-side', !url); + if (!url) + { + $taskTree.find('li.selected').removeClass('selected'); + isItemLoading = false; + return; + } + if (lastAjaxRequest) lastAjaxRequest.abort(); + $itemContent.empty().addClass('loading').attr('data-loading', loadingText || ''); + isItemLoading = true; + lastAjaxRequest = $.ajax( + { + url: url, + success: function(data) + { + if (!isItemLoading) return; + $itemContent.html(data).removeClass('loading'); + lastAjaxRequest = null; + isItemLoading = false; + $itemContent.find('.text-limit').textLimit(); + $itemContent.find('.histories').histories(); + }, + error: function() + { + $mainContent.addClass('hide-side'); + isItemLoading = false; + $.zui.messager.danger(window.lang.timeout); + } + }); + }; + + var stopPropagation = function(e) {e.stopPropagation();}; + $taskTree.on('click', '.tree-link', function(e) + { + var $link = $(this); + showItem($link.attr('href'), $link.find('.title').text()); + $taskTree.find('li.selected').removeClass('selected'); + $link.closest('li').addClass('selected'); + e.preventDefault(); + stopPropagation(e); + }); + + $itemContent.on('click', stopPropagation); + $taskTree.on('click', stopPropagation); + + $(document).on('click', function() + { + showItem(false); + }); +}); diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 9d7b341a53..38f3ad2cdd 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -297,10 +297,10 @@ $lang->project->featureBar['task']['needconfirm'] = 'StoryChanged'; $lang->project->featureBar['task']['status'] = $lang->project->statusSelects['']; $lang->project->treeLevel = array(); +$lang->project->treeLevel['all'] = 'Expand All'; $lang->project->treeLevel['root'] = 'Collapse All'; $lang->project->treeLevel['story'] = 'Show Story'; $lang->project->treeLevel['task'] = 'Show Task'; -$lang->project->treeLevel['all'] = 'Expand All'; global $config; if($config->global->flow == 'onlyTask') diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 666d0685e6..19ccb1e108 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -305,10 +305,10 @@ $lang->project->featureBar['task']['needconfirm'] = '需求变动'; $lang->project->featureBar['task']['status'] = $lang->project->statusSelects['']; $lang->project->treeLevel = array(); -$lang->project->treeLevel['root'] = '全部折叠'; -$lang->project->treeLevel['story'] = '显示需求'; -$lang->project->treeLevel['task'] = '显示任务'; $lang->project->treeLevel['all'] = '全部展开'; +$lang->project->treeLevel['root'] = '全部折叠'; +$lang->project->treeLevel['story'] = '只看需求'; +$lang->project->treeLevel['task'] = '只看任务'; global $config; if($config->global->flow == 'onlyTask') diff --git a/module/project/model.php b/module/project/model.php index 1855765bb0..c03e04f291 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1381,8 +1381,8 @@ class projectModel extends model /** * Stat story, task, bug data for project. - * - * @param int $projectID + * + * @param int $projectID * @access public * @return void */ @@ -2545,7 +2545,7 @@ class projectModel extends model $taskGroups[$task->module][$task->story][$task->id] = $task; if(!empty($childTasks[$task->id])) { - $taskGroups[$task->module][$task->story][$task->id]->children = $childTasks[$task->id]; + $taskGroups[$task->module][$task->story][$task->id]->children = $childTasks[$task->id]; } } } @@ -2581,6 +2581,8 @@ class projectModel extends model $storyItem->color = $story->color; $storyItem->pri = $story->pri; $storyItem->storyId = $story->id; + $storyItem->openedBy = $story->openedBy; + $storyItem->assignedTo = $story->assignedTo; $storyItem->url = helper::createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$projectID"); $storyItem->taskCreateUrl = helper::createLink('task', 'batchCreate', "projectID={$projectID}&story={$story->id}"); @@ -2661,9 +2663,11 @@ class projectModel extends model $taskItem->color = $task->color; $taskItem->pri = (int)$task->pri; $taskItem->status = $task->status; + $taskItem->parent = $task->parent; $taskItem->estimate = $task->estimate; $taskItem->consumed = $task->consumed; $taskItem->left = $task->left; + $taskItem->openedBy = $users[$task->openedBy]; $taskItem->assignedTo = $users[$task->assignedTo]; $taskItem->url = helper::createLink('task', 'view', "task=$task->id"); $taskItem->storyChanged = $story and $story->status == 'active' and $story->version > $story->taskVersion; @@ -2735,4 +2739,50 @@ class projectModel extends model } return $productPlans; } + + /** + * Print html for tree. + * + * @param object $trees + * @access pubic + * @return string + */ + public function printTree($trees) + { + $html = ''; + foreach($trees as $tree) + { + if(is_array($tree)) $tree = (object)$tree; + switch($tree->type) + { + case 'module': + $this->app->loadLang('tree'); + $html .= "
  • "; + $html .= '' . (empty($tree->parent) ? $this->lang->tree->module : $this->lang->tree->child) . '' . $tree->name . ''; + break; + case 'task': + $html .= '
  • '; + $html .= '' . $tree->id . '' . (empty($tree->parent) ? $this->lang->task->common : $this->lang->task->children) . '' . $tree->title . ' ' . (empty($tree->assignedTo) ? $tree->openedBy : $tree->assignedTo) . ''; + break; + case 'product': + $this->app->loadLang('product'); + $html .= '
  • '; + $html .= '' . $this->lang->productCommon . '' . $tree->name . ''; + break; + case 'story': + $this->app->loadLang('story'); + $html .= '
  • '; + $html .= '' . $tree->storyId . '' . $this->lang->story->common . '' . $tree->title . ' ' . (empty($tree->assignedTo) ? $tree->openedBy : $tree->assignedTo) . ''; + break; + } + if(isset($tree->children)) + { + $html .= ''; + } + $html .= '
  • '; + } + return $html; + } } diff --git a/module/project/view/tree.html.php b/module/project/view/tree.html.php index 6260f7c21b..b9d57cb38f 100644 --- a/module/project/view/tree.html.php +++ b/module/project/view/tree.html.php @@ -10,195 +10,63 @@ * @link http://www.zentao.net */ ?> - + + - -project->treeLevel);?> +
    +
    +
    +
      + +
    +
    +
    +
    +
    +
    +
    +
    +
    diff --git a/module/tree/lang/en.php b/module/tree/lang/en.php index ea236ec550..9d2ae405e5 100644 --- a/module/tree/lang/en.php +++ b/module/tree/lang/en.php @@ -43,6 +43,7 @@ $lang->tree->successSave = 'Saved.'; $lang->tree->successFixed = 'Fixed.'; $lang->tree->repeatName = 'The name "%s" has existed!'; +$lang->tree->module = 'Module'; $lang->tree->name = 'Name'; $lang->tree->line = 'Product Line'; $lang->tree->cate = 'Category Name'; diff --git a/module/tree/lang/zh-cn.php b/module/tree/lang/zh-cn.php index 44f262f082..6302eba226 100644 --- a/module/tree/lang/zh-cn.php +++ b/module/tree/lang/zh-cn.php @@ -43,6 +43,7 @@ $lang->tree->successSave = '成功保存'; $lang->tree->successFixed = '成功修正数据!'; $lang->tree->repeatName = '模块名“%s”已经存在!'; +$lang->tree->module = '模块'; $lang->tree->name = '模块名称'; $lang->tree->line = '产品线名称'; $lang->tree->cate = '分类名称'; diff --git a/module/tree/model.php b/module/tree/model.php index ed14055a00..e9f26b7230 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -15,8 +15,8 @@ class treeModel extends model { /** * Get module by ID. - * - * @param int $moduleID + * + * @param int $moduleID * @access public * @return object */ @@ -27,10 +27,10 @@ class treeModel extends model /** * Build the sql query. - * - * @param int $rootID - * @param string $type - * @param int $startModule + * + * @param int $rootID + * @param string $type + * @param int $startModule * @access public * @return void */ @@ -67,15 +67,15 @@ class treeModel extends model ->beginIF((!empty($branch) and $branch != 'null'))->andWhere("branch")->eq($branch)->fi() ->andWhere('deleted')->eq(0) ->orderBy('grade desc, `order`') - ->get(); + ->get(); } /** * Create an option menu in html. - * - * @param int $rootID - * @param string $type - * @param int $startModule + * + * @param int $rootID + * @param string $type + * @param int $startModule * @access public * @return string */ @@ -125,10 +125,10 @@ class treeModel extends model /** * Get module pairs. - * - * @param int $rootID - * @param string $viewType - * @param string $showModule + * + * @param int $rootID + * @param string $viewType + * @param string $showModule * @access public * @return array */ @@ -171,8 +171,8 @@ class treeModel extends model } /** - * Get line pairs. - * + * Get line pairs. + * * @access public * @return array */ @@ -183,9 +183,9 @@ class treeModel extends model /** * Create an option menu of task in html. - * - * @param int $rootID - * @param int $startModule + * + * @param int $rootID + * @param int $startModule * @access public * @return void */ @@ -195,14 +195,14 @@ class treeModel extends model $products = $this->loadModel('product')->getProductsByProject($rootID); $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); - if(!$this->isMergeModule($rootID, 'task') or !$products) return $this->getOptionMenu($rootID, 'task', $startModule); + if(!$this->isMergeModule($rootID, 'task') or !$products) return $this->getOptionMenu($rootID, 'task', $startModule); /* createdVersion > 4.1. */ $startModulePath = ''; if($startModule > 0) { $startModule = $this->getById($startModule); - if($startModule) + if($startModule) { $startModulePath = $startModule->path . '%'; $modulePaths = explode(",", $startModulePath); @@ -258,7 +258,7 @@ class treeModel extends model } foreach($topMenu as $moduleID => $moduleName) { - if(!isset($projectModules[$moduleID])) unset($treeMenu[$moduleID]); + if(!isset($projectModules[$moduleID])) unset($treeMenu[$moduleID]); } } } @@ -267,11 +267,11 @@ class treeModel extends model /** * Build tree array. - * - * @param $&treeMenu - * @param array $modules - * @param object $module - * @param string $moduleName + * + * @param $&treeMenu + * @param array $modules + * @param object $module + * @param string $moduleName * @access public * @return void */ @@ -398,7 +398,7 @@ class treeModel extends model if(!$this->isMergeModule($rootID, 'task') or !$products) { $extra['tip'] = false; - return $this->getTreeMenu($rootID, 'task', $startModule, $userFunc, $extra); + return $this->getTreeMenu($rootID, 'task', $startModule, $userFunc, $extra); } /* createdVersion > 4.1. */ @@ -487,7 +487,7 @@ class treeModel extends model * @access public * @return object */ - public function getTaskStructure($rootID, $productID = 0, $manage = true) + public function getTaskStructure($rootID, $productID = 0, $manage = true) { $extra = array('projectID' => $rootID, 'productID' => $productID, 'tip' => true); @@ -542,9 +542,9 @@ class treeModel extends model /** * Get tree structure. - * - * @param int $rootID - * @param string $type + * + * @param int $rootID + * @param string $type * @access public * @return array */ @@ -556,10 +556,10 @@ class treeModel extends model /** * Get project story tree menu. - * - * @param int $rootID - * @param int $startModule - * @param array $userFunc + * + * @param int $rootID + * @param int $startModule + * @param array $userFunc * @access public * @return string */ @@ -627,13 +627,13 @@ class treeModel extends model /** * Build tree. - * - * @param & $&treeMenu - * @param object $module - * @param string $type - * @param array $userFunc - * @param array $extra - * @param int $branch + * + * @param & $&treeMenu + * @param object $module + * @param string $type + * @param array $userFunc + * @param array $extra + * @param int $branch * @access public * @return void */ @@ -693,21 +693,21 @@ class treeModel extends model if(isset($treeMenu[$module->id]) and !empty($treeMenu[$module->id])) { if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = ''; - $treeMenu[$module->parent] .= "
  • $linkHtml"; + $treeMenu[$module->parent] .= "
  • $linkHtml"; $treeMenu[$module->parent] .= "\n"; } else { if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = ""; - $treeMenu[$module->parent] .= "
  • $linkHtml\n"; + $treeMenu[$module->parent] .= "
  • $linkHtml\n"; } - $treeMenu[$module->parent] .= "
  • \n"; + $treeMenu[$module->parent] .= "\n"; } /** - * Get project modules. - * - * @param int $projectID + * Get project modules. + * + * @param int $projectID * @param bool $parent * @param bool $linkStory * @access public @@ -765,7 +765,7 @@ class treeModel extends model /* Get all modules from paths. */ foreach($paths as $path) { - $modules = explode(',', $path); + $modules = explode(',', $path); foreach($modules as $module) $projectModules[$module] = $module; } return $projectModules; @@ -773,9 +773,9 @@ class treeModel extends model /** * Create link of a story. - * + * * @param string $type - * @param object $module + * @param object $module * @access public * @return string */ @@ -786,9 +786,9 @@ class treeModel extends model /** * Create link of a product line. - * + * * @param string $type - * @param object $module + * @param object $module * @param array $extra * @access public * @return string @@ -802,10 +802,10 @@ class treeModel extends model /** * Create link of a task. - * - * @param string $type - * @param object $module - * @param array $extra + * + * @param string $type + * @param object $module + * @param array $extra * @access public * @return string */ @@ -817,11 +817,11 @@ class treeModel extends model } /** - * Create link of project story. - * - * @param string $type - * @param object $module - * @param array $extra + * Create link of project story. + * + * @param string $type + * @param object $module + * @param array $extra * @access public * @return string */ @@ -834,8 +834,8 @@ class treeModel extends model /** * Create link of a doc. - * - * @param object $module + * + * @param object $module * @access public * @return string */ @@ -846,8 +846,8 @@ class treeModel extends model /** * Create the manage link of a module. - * - * @param object $module + * + * @param object $module * @access public * @return string */ @@ -877,9 +877,9 @@ class treeModel extends model /** * Create the task manage link of a module. - * - * @param int $productID - * @param int $module + * + * @param int $productID + * @param int $module * @access public * @return void */ @@ -906,8 +906,8 @@ class treeModel extends model /** * Create link of a bug. - * - * @param object $module + * + * @param object $module * @access public * @return string */ @@ -918,8 +918,8 @@ class treeModel extends model /** * Create link of a test case. - * - * @param object $module + * + * @param object $module * @access public * @return string */ @@ -930,8 +930,8 @@ class treeModel extends model /** * Create link of a test task. - * - * @param object $module + * + * @param object $module * @access public * @return string */ @@ -941,10 +941,10 @@ class treeModel extends model } /** - * Create case lib link - * - * @param string $type - * @param string $module + * Create case lib link + * + * @param string $type + * @param string $module * @access public * @return string */ @@ -954,12 +954,12 @@ class treeModel extends model } /** - * Create branch link - * - * @param string $type - * @param int $rootID - * @param int $branchID - * @param string $branch + * Create branch link + * + * @param string $type + * @param int $rootID + * @param int $branchID + * @param string $branch * @access public * @return string */ @@ -972,10 +972,10 @@ class treeModel extends model /** * Get sons of a module. - * - * @param int $rootID - * @param int $moduleID - * @param string $type + * + * @param int $rootID + * @param int $moduleID + * @param string $type * @access public * @return array */ @@ -1010,10 +1010,10 @@ class treeModel extends model /** * Get sons of a task module. - * - * @param int $rootID - * @param int $productID - * @param int $moduleID + * + * @param int $rootID + * @param int $productID + * @param int $moduleID * @access public * @return void */ @@ -1043,8 +1043,8 @@ class treeModel extends model /** * Get id list of a module's childs. - * - * @param int $moduleID + * + * @param int $moduleID * @access public * @return array */ @@ -1059,10 +1059,10 @@ class treeModel extends model } /** - * Get project module. - * - * @param int $projectID - * @param int $productID + * Get project module. + * + * @param int $projectID + * @param int $productID * @access public * @return void */ @@ -1087,8 +1087,8 @@ class treeModel extends model /** * Get parents of a module. - * - * @param int $moduleID + * + * @param int $moduleID * @access public * @return array */ @@ -1103,8 +1103,8 @@ class treeModel extends model /** * Get product by moduleID. - * - * @param int $moduleID + * + * @param int $moduleID * @access public * @return void */ @@ -1122,8 +1122,8 @@ class treeModel extends model /** * Get the module that its type == 'story'. - * - * @param int $moduleID + * + * @param int $moduleID * @access public * @return void */ @@ -1185,8 +1185,8 @@ class treeModel extends model /** * Update modules' order. - * - * @param array $orders + * + * @param array $orders * @access public * @return void */ @@ -1291,7 +1291,7 @@ class treeModel extends model /** * Update a module. * - * @param int $moduleID + * @param int $moduleID * @access public * @return void */ @@ -1316,11 +1316,11 @@ class treeModel extends model /** * Change root. - * - * @param int $moduleID - * @param int $oldRoot - * @param int $newRoot - * @param string $type + * + * @param int $moduleID + * @param int $oldRoot + * @param int $newRoot + * @param string $type * @access public * @return void */ @@ -1373,8 +1373,8 @@ class treeModel extends model /** * Delete a module. - * - * @param int $moduleID + * + * @param int $moduleID * @param null $null compatible with that of model::delete() * @access public * @return void @@ -1400,7 +1400,7 @@ class treeModel extends model if($module->type == 'task') $this->dao->update(TABLE_TASK)->set('module')->eq($module->parent)->where('module')->in($childs)->exec(); if($module->type == 'bug') $this->dao->update(TABLE_BUG)->set('module')->eq($module->parent)->where('module')->in($childs)->exec(); if($module->type == 'case') $this->dao->update(TABLE_CASE)->set('module')->eq($module->parent)->where('module')->in($childs)->exec(); - if($module->type == 'story') + if($module->type == 'story') { $this->dao->update(TABLE_STORY)->set('module')->eq($module->parent)->where('module')->in($childs)->exec(); $this->dao->update(TABLE_TASK)->set('module')->eq($module->parent)->where('module')->in($childs)->exec(); @@ -1414,8 +1414,8 @@ class treeModel extends model /** * Fix the path, grade fields according to the id and parent fields. * - * @param string $root - * @param string $type + * @param string $root + * @param string $type * @access public * @return void */ @@ -1464,12 +1464,12 @@ class treeModel extends model /** * Check unique module name. - * - * @param int $rootID - * @param string $viewType - * @param int $parentModuleID - * @param array $modules - * @param array $branches + * + * @param int $rootID + * @param string $viewType + * @param int $parentModuleID + * @param array $modules + * @param array $branches * @access public * @return bool */ @@ -1505,9 +1505,9 @@ class treeModel extends model /** * Check merge module version. - * - * @param int $rootID - * @param string $viewType + * + * @param int $rootID + * @param string $viewType * @access public * @return bool */ @@ -1530,11 +1530,11 @@ class treeModel extends model /** * Get full trees. - * - * @param int $rootID - * @param string $viewType - * @param int $branch - * @param int $currentModuleID + * + * @param int $rootID + * @param string $viewType + * @param int $branch + * @param int $currentModuleID * @access public * @return array */ @@ -1578,7 +1578,7 @@ class treeModel extends model * @access public * @return array */ - public function getDataStructure($stmt, $viewType, $keepModules = array()) + public function getDataStructure($stmt, $viewType, $keepModules = array()) { $parent = array(); while($module = $stmt->fetch()) @@ -1610,11 +1610,11 @@ class treeModel extends model /** * Get all doc structure. - * + * * @access public * @return array */ - public function getDocStructure() + public function getDocStructure() { $stmt = $this->dbh->query($this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('doc')->get()); $parent = array();