From 8856efb813b4787bafb0ed4d2f9f420f6ab04b25 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 18 May 2016 16:39:57 +0800 Subject: [PATCH 1/6] * fix bug for all page for project and product. * fix bug for manage tree and dept. --- module/dept/view/browse.html.php | 11 ++++++++--- module/product/view/all.html.php | 2 +- module/project/view/all.html.php | 2 +- module/tree/view/browse.html.php | 2 ++ module/tree/view/browsetask.html.php | 11 ++++++++--- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/module/dept/view/browse.html.php b/module/dept/view/browse.html.php index ad83fce354..9467fd03b8 100644 --- a/module/dept/view/browse.html.php +++ b/module/dept/view/browse.html.php @@ -98,8 +98,7 @@ $(function() { var data = $.parseJSON(''); - var $tree = $('#deptTree').tree( - { + var options = { name: 'deptTree', initialState: 'preserve', data: data, @@ -164,7 +163,13 @@ $(function() }); } } - }); + }; + + if() options.actions["sort"] = false; + if() options.actions["edit"] = false; + if() options.actions["delete"] = false; + + var $tree = $('#deptTree').tree(options); var tree = $tree.data('zui.tree'); if(!tree.store.time) tree.expand($tree.find('li:not(.tree-action-item)').first()); diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index bc717e4b63..8d0cbdd7ad 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -37,7 +37,7 @@
' id='productsForm'> - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> diff --git a/module/project/view/all.html.php b/module/project/view/all.html.php index 0b35be0ef9..302e2bb608 100644 --- a/module/project/view/all.html.php +++ b/module/project/view/all.html.php @@ -29,7 +29,7 @@ '>
idAB);?>
- recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index 68e282aa12..4721df7706 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -185,6 +185,8 @@ $(function() }; if() options.actions["sort"] = false; + if() options.actions["edit"] = false; + if() options.actions["delete"] = false; var $tree = $('#modulesTree').tree(options); diff --git a/module/tree/view/browsetask.html.php b/module/tree/view/browsetask.html.php index 00fb728537..4b59e564bb 100644 --- a/module/tree/view/browsetask.html.php +++ b/module/tree/view/browsetask.html.php @@ -102,8 +102,7 @@ $(function() { var data = $.parseJSON(''); - var $tree = $('#modulesTree').tree( - { + var options = { name: 'tree-project-edit', initialState: 'preserve', data: data, @@ -180,7 +179,13 @@ $(function() }); } } - }); + }; + + if() options.actions["sort"] = false; + if() options.actions["edit"] = false; + if() options.actions["delete"] = false; + + var $tree = $('#modulesTree').tree(options); var tree = $tree.data('zui.tree'); if(!tree.store.time) tree.expand($tree.find('li:not(.tree-action-item)').first()); From f3b764c07921ba24201f8827d516b5089088161a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 19 May 2016 11:41:52 +0800 Subject: [PATCH 2/6] * adjust for check custom pri and severity when create. --- module/bug/view/create.html.php | 28 ++++++++++++++++++++++++---- module/story/view/create.html.php | 14 ++++++++++++-- module/task/view/create.html.php | 24 +++++++++++++++++------- module/testcase/view/create.html.php | 14 ++++++++++++-- 4 files changed, 65 insertions(+), 15 deletions(-) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index e1f0135a39..27f771289e 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -126,8 +126,18 @@ js::set('refresh', $lang->refresh);
bug->severity;?> - bug->severityList));?> - + bug->severityList as $severityKey => $severityValue) + { + if($severityKey != $severityValue) + { + $hasCustomSeverity = true; + break; + } + } + ?> + bug->severityList, $severity, "class='form-control minw-80px'");?>
- + diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 6bd1018044..238f91c295 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -94,8 +94,18 @@
testcase->pri;?> - testcase->priList));?> - + testcase->priList as $priKey => $priValue) + { + if($priKey != $priValue) + { + $hasCustomPri = true; + break; + } + } + ?> + testcase->priList, $pri, "class='form-control minw-80px'");?>
@@ -56,12 +58,4 @@ config.confirmRemoveBlock = 'block->confirmRemoveBlock; ?>'; var module = ''; getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> - + diff --git a/module/common/model.php b/module/common/model.php index 19b2e4c709..e514f9453a 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -169,13 +169,14 @@ class commonModel extends model if($module == 'sso' and $method == 'bind') return true; if($module == 'sso' and $method == 'gettodolist') return true; if($module == 'product' and $method == 'showerrornone') return true; - if($module == 'block') return true; + if($module == 'block' and $method == 'printblock') return true; if($this->loadModel('user')->isLogon()) { if(stripos($method, 'ajax') !== false) return true; if(stripos($method, 'downnotify') !== false) return true; if($module == 'tutorial') return true; + if($module == 'block') return true; } if(stripos($method, 'ajaxgetdropmenu') !== false) return true; From d17beaf08ca0ebbdeb9b723d1def45b17dd0575b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 May 2016 09:21:26 +0800 Subject: [PATCH 5/6] * fix for check module unique. --- module/tree/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/tree/model.php b/module/tree/model.php index 430e4ea517..5499c69aec 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1419,10 +1419,11 @@ class treeModel extends model public function checkUnique($rootID, $viewType, $parentModuleID, $modules = array(), $branches = array()) { if(empty($branches)) $branches = $this->post->branch; + $branches = array_unique($branches); if($this->isMergeModule($rootID, $viewType)) $viewType .= ',story'; - $existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->fetchAll(); + $existsModules = $this->dao->select('id,branch,name')->from(TABLE_MODULE)->where('root')->eq($rootID)->andWhere('type')->in($viewType)->andWhere('parent')->eq($parentModuleID)->andWhere('branch')->in($branches)->fetchAll(); $repeatName = ''; foreach($modules as $id => $name) { From cd8cd0b43c5931af6c42e78c897b1470e8b29cd5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 May 2016 09:22:03 +0800 Subject: [PATCH 6/6] * fix for get cookie branch. --- module/bug/control.php | 8 ++++---- module/product/control.php | 6 +++--- module/qa/control.php | 2 +- module/testcase/control.php | 10 +++++----- module/testtask/control.php | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index d2c6acea50..8d29c3c216 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -66,9 +66,9 @@ class bug extends control /* Set productID, moduleID, queryID and branch. */ $productID = $this->product->saveState($productID, $this->products); - $branch = ($branch == '') ? $this->cookie->preBranch : $branch; + $branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot); - setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot); + setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot); if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch) { @@ -230,7 +230,7 @@ class bug extends control /* Get product, then set menu. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = $this->cookie->preBranch; + if($branch === '') $branch = (int)$this->cookie->preBranch; $branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); $this->bug->setMenu($this->products, $productID, $branch); @@ -367,7 +367,7 @@ class bug extends control /* Get product, then set menu. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = $this->cookie->preBranch; + if($branch === '') $branch = (int)$this->cookie->preBranch; $this->bug->setMenu($this->products, $productID, $branch); /* If projectID is setted, get builds and stories of this project. */ diff --git a/module/product/control.php b/module/product/control.php index f8509fb961..a290c4bbad 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -64,7 +64,7 @@ class product extends control unset($this->lang->product->menu->index); $productID = $this->product->saveState($productID, $this->products); - $branch = $this->cookie->preBranch; + $branch = (int)$this->cookie->preBranch; $this->product->setMenu($this->products, $productID, $branch); $this->view->title = $this->lang->product->index; @@ -121,9 +121,9 @@ class product extends control /* Set product, module and query. */ $productID = $this->product->saveState($productID, $this->products); - $branch = ($branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot); - setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot); + setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot); if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch) { diff --git a/module/qa/control.php b/module/qa/control.php index c4c9db729f..bab4ceb8b0 100644 --- a/module/qa/control.php +++ b/module/qa/control.php @@ -36,7 +36,7 @@ class qa extends control unset($this->lang->qa->menu->index); $productID = $this->product->saveState($productID, $this->products); - $branch = $this->cookie->preBranch; + $branch = (int)$this->cookie->preBranch; $this->qa->setMenu($this->products, $productID, $branch); $this->view->title = $this->lang->qa->index; diff --git a/module/testcase/control.php b/module/testcase/control.php index bc8bef37f3..7b8a7dacdd 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -62,9 +62,9 @@ class testcase extends control /* Set browseType, productID, moduleID and queryID. */ $productID = $this->product->saveState($productID, $this->products); - $branch = ($branch === '') ? $this->cookie->preBranch : $branch; + $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot); - setcookie('preBranch', $branch, $this->config->cookieLife, $this->config->webRoot); + setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot); if($this->cookie->preProductID != $productID or $this->cookie->preBranch != $branch) { @@ -147,7 +147,7 @@ class testcase extends control { $groupBy = empty($groupBy) ? 'stroy' : $groupBy; $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = $this->cookie->preBranch; + if($branch === '') $branch = (int)$this->cookie->preBranch; $this->app->loadLang('testtask'); @@ -228,7 +228,7 @@ class testcase extends control /* Set productID and currentModuleID. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = $this->cookie->preBranch; + if($branch === '') $branch = (int)$this->cookie->preBranch; if($storyID and empty($moduleID)) { $story = $this->loadModel('story')->getByID($storyID); @@ -351,7 +351,7 @@ class testcase extends control /* Set productID and currentModuleID. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = $this->cookie->preBranch; + if($branch === '') $branch = (int)$this->cookie->preBranch; if($storyID and empty($moduleID)) { $story = $this->loadModel('story')->getByID($storyID); diff --git a/module/testtask/control.php b/module/testtask/control.php index 8bcdefc5d4..909bc368d3 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -57,7 +57,7 @@ class testtask extends control /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); - if($branch === '') $branch = $this->cookie->preBranch; + if($branch === '') $branch = (int)$this->cookie->preBranch; $this->testtask->setMenu($this->products, $productID, $branch); /* Load pager. */
idAB);?>task->desc;?> desc, "rows='10' class='form-control'");?>
task->mailto : $lang->task->datePlan;?>