From f877273082c7d6f602bfaa7f283987fcbbb510ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 12 Dec 2017 16:51:57 +0800 Subject: [PATCH 01/50] * Format code --- module/project/view/story.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index fac65186c3..7b67a0d011 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -58,7 +58,7 @@
- + From d7cec4597fef793fe3288877b65f083780780c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 12 Dec 2017 16:52:20 +0800 Subject: [PATCH 02/50] * Task #3456 add lang --- module/productplan/lang/en.php | 1 + module/productplan/lang/zh-cn.php | 1 + 2 files changed, 2 insertions(+) diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index 68db8c6b0c..f0450c5f84 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -26,6 +26,7 @@ $lang->productplan->unlinkStory = "Unlink Story"; $lang->productplan->batchUnlinkStory = "Batch Unlink"; $lang->productplan->linkedStories = 'link Story'; $lang->productplan->unlinkedStories = 'UnLinkEd'; +$lang->productplan->updateOrder = 'Ranking'; $lang->productplan->linkBug = "Link Bug"; $lang->productplan->unlinkBug = "Unlink Bug"; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index e406b71b8c..4f6b622a60 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -26,6 +26,7 @@ $lang->productplan->unlinkStory = "移除需求"; $lang->productplan->batchUnlinkStory = "批量移除需求"; $lang->productplan->linkedStories = '需求'; $lang->productplan->unlinkedStories = '未关联需求'; +$lang->productplan->updateOrder = '排序'; $lang->productplan->linkBug = "关联Bug"; $lang->productplan->unlinkBug = "移除Bug"; From a2672a6c446a02c8b295e144199c5ead47af04ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 12 Dec 2017 17:42:42 +0800 Subject: [PATCH 03/50] * Task #3446 --- module/bug/config.php | 2 +- module/bug/control.php | 5 ++++- module/bug/js/common.js | 2 +- module/bug/model.php | 6 +++++- module/bug/view/batchcreate.html.php | 2 +- module/story/config.php | 2 +- module/story/control.php | 1 + module/story/model.php | 5 +++++ module/story/view/batchcreate.html.php | 2 +- module/tree/model.php | 2 +- 10 files changed, 21 insertions(+), 8 deletions(-) diff --git a/module/bug/config.php b/module/bug/config.php index 102a38f872..190b518f2d 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -6,7 +6,7 @@ $config->bug->longlife = 7; $config->bug->create = new stdclass(); $config->bug->edit = new stdclass(); $config->bug->resolve = new stdclass(); -$config->bug->create->requiredFields = 'title,openedBuild'; +$config->bug->create->requiredFields = 'title,openedBuild,module'; $config->bug->edit->requiredFields = $config->bug->create->requiredFields; $config->bug->resolve->requiredFields = 'resolution'; diff --git a/module/bug/control.php b/module/bug/control.php index 943a4d29dc..07473775d2 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -328,6 +328,9 @@ class bug extends control $projectMembers = $this->view->users; } + $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); + if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); + /* Set custom. */ foreach(explode(',', $this->config->bug->list->customCreateFields) as $field) $customFields[$field] = $this->lang->bug->$field; $this->view->customFields = $customFields; @@ -339,7 +342,7 @@ class bug extends control $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); + $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->stories = $stories; $this->view->projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : 0, $params = 'nodeleted'); $this->view->builds = $builds; diff --git a/module/bug/js/common.js b/module/bug/js/common.js index e8dc98b4bf..6fcc8a9ae1 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -78,7 +78,7 @@ function loadBranch() $('#taskIdBox').innerHTML = ''; // Reset the task. $('#task').chosen(defaultChosenOptions); productID = $('#product').val(); - loadProductModules(productID); + loadProductModules(productID); loadProductProjects(productID); loadProductBuilds(productID); loadProductplans(productID); diff --git a/module/bug/model.php b/module/bug/model.php index 8b8b380b32..65e926525f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -113,7 +113,11 @@ class bugModel extends model for($i = 0; $i < $batchNum; $i++) { - if(!empty($data->title[$i]) and empty($data->openedBuilds[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->bug->openedBuild))); + if(!empty($data->title[$i])) + { + if(empty($data->modules[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->bug->module))); + if(empty($data->openedBuilds[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->bug->openedBuild))); + } } /* Get pairs(moduleID => moduleOwner) for bug. */ diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 17fcbcae4e..4b6dda944d 100644 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -39,7 +39,7 @@ foreach(explode(',', $showFields) as $field) - + diff --git a/module/story/config.php b/module/story/config.php index faee54527c..f6db8e00e8 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -13,7 +13,7 @@ $config->story->edit = new stdclass(); $config->story->change = new stdclass(); $config->story->close = new stdclass(); $config->story->review = new stdclass(); -$config->story->create->requiredFields = 'title'; +$config->story->create->requiredFields = 'title,module'; $config->story->change->requiredFields = 'title'; $config->story->close->requiredFields = 'closedReason'; $config->story->review->requiredFields = 'assignedTo,reviewedBy'; diff --git a/module/story/control.php b/module/story/control.php index 3a33fa09d9..c7fbf2c8db 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -102,6 +102,7 @@ class story extends control $users = $this->user->getPairs('pdfirst|noclosed|nodeleted'); $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch); + if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); /* Set menu. */ $this->product->setMenu($products, $product->id, $branch); diff --git a/module/story/model.php b/module/story/model.php index 3390a032db..ad0c5d1cec 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -258,8 +258,13 @@ class storyModel extends model $plan = 0; $pri = 0; $source = ''; + for($i = 0; $i < $batchNum; $i++) { + if(!empty($stories->title[$i]) && empty($stories->modules[$i])) + { + die(js::alert(sprintf($this->lang->error->notempty, $this->lang->story->module))); + } $module = $stories->module[$i] == 'ditto' ? $module : $stories->module[$i]; $plan = $stories->plan[$i] == 'ditto' ? $plan : $stories->plan[$i]; $pri = $stories->pri[$i] == 'ditto' ? $pri : $stories->pri[$i]; diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php index ea25f482ad..20df69c929 100644 --- a/module/story/view/batchcreate.html.php +++ b/module/story/view/batchcreate.html.php @@ -40,7 +40,7 @@ if($this->story->checkForceReview()) unset($visibleFields['review']); - + diff --git a/module/tree/model.php b/module/tree/model.php index 27e674d157..f2e42571de 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -112,7 +112,7 @@ class treeModel extends model ksort($treeMenu); $topMenu = @array_shift($treeMenu); $topMenu = explode("\n", trim($topMenu)); - $lastMenu[] = '/'; + $lastMenu[] = in_array($type, array('bug', 'story')) ? '' : '/'; foreach($topMenu as $menu) { if(!strpos($menu, '|')) continue; From c404eff816119cc70bf3619698a2e2f40f80eccb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 10:56:56 +0800 Subject: [PATCH 04/50] * finish task #3476. --- module/install/lang/en.php | 42 ++++++++++++++++++----------------- module/install/lang/zh-cn.php | 42 ++++++++++++++++++----------------- 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 71f2c6203d..09e9e79755 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -126,26 +126,28 @@ $lang->install->account = 'Admin Account'; $lang->install->password = 'Admin Password'; $lang->install->errorEmptyPassword = 'Password should not be blank.'; -$lang->install->groupList['ADMIN']['name'] = 'Admin'; -$lang->install->groupList['ADMIN']['desc'] = 'System Administrator'; -$lang->install->groupList['DEV']['name'] = 'Dev'; -$lang->install->groupList['DEV']['desc'] = 'Dev Team'; -$lang->install->groupList['QA']['name'] = 'QA'; -$lang->install->groupList['QA']['desc'] = 'QA Team'; -$lang->install->groupList['PM']['name'] = 'PM'; -$lang->install->groupList['PM']['desc'] = 'for Project Manager'; -$lang->install->groupList['PO']['name'] = 'PO'; -$lang->install->groupList['PO']['desc'] = 'for Product Owner'; -$lang->install->groupList['TD']['name'] = 'Dev Manager'; -$lang->install->groupList['TD']['desc'] = 'for Dev Manager'; -$lang->install->groupList['PD']['name'] = 'PD'; -$lang->install->groupList['PD']['desc'] = 'for Product Director'; -$lang->install->groupList['QD']['name'] = 'QD'; -$lang->install->groupList['QD']['desc'] = 'for QA Director'; -$lang->install->groupList['TOP']['name'] = 'Senior'; -$lang->install->groupList['TOP']['desc'] = 'for Senior Manager'; -$lang->install->groupList['OTHERS']['name'] = 'Other'; -$lang->install->groupList['OTHERS']['desc'] = 'for Other'; +$lang->install->groupList['ADMIN']['name'] = 'Admin'; +$lang->install->groupList['ADMIN']['desc'] = 'System Administrator'; +$lang->install->groupList['DEV']['name'] = 'Dev'; +$lang->install->groupList['DEV']['desc'] = 'Dev Team'; +$lang->install->groupList['QA']['name'] = 'QA'; +$lang->install->groupList['QA']['desc'] = 'QA Team'; +$lang->install->groupList['PM']['name'] = 'PM'; +$lang->install->groupList['PM']['desc'] = 'for Project Manager'; +$lang->install->groupList['PO']['name'] = 'PO'; +$lang->install->groupList['PO']['desc'] = 'for Product Owner'; +$lang->install->groupList['TD']['name'] = 'Dev Manager'; +$lang->install->groupList['TD']['desc'] = 'for Dev Manager'; +$lang->install->groupList['PD']['name'] = 'PD'; +$lang->install->groupList['PD']['desc'] = 'for Product Director'; +$lang->install->groupList['QD']['name'] = 'QD'; +$lang->install->groupList['QD']['desc'] = 'for QA Director'; +$lang->install->groupList['TOP']['name'] = 'Senior'; +$lang->install->groupList['TOP']['desc'] = 'for Senior Manager'; +$lang->install->groupList['OTHERS']['name'] = 'Other'; +$lang->install->groupList['OTHERS']['desc'] = 'for Other'; +$lang->install->groupList['LIMITED']['name'] = 'Limited User'; +$lang->install->groupList['LIMITED']['desc'] = 'for Limited user (editing only content related to itself)'; $lang->install->cronList[''] = 'Monitor cron'; $lang->install->cronList['moduleName=project&methodName=computeburn'] = 'Update Burndown Chart'; diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 2840984611..b11a4f4e00 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -126,26 +126,28 @@ $lang->install->account = '管理员帐号'; $lang->install->password = '管理员密码'; $lang->install->errorEmptyPassword = '密码不能为空'; -$lang->install->groupList['ADMIN']['name'] = '管理员'; -$lang->install->groupList['ADMIN']['desc'] = '系统管理员'; -$lang->install->groupList['DEV']['name'] = '研发'; -$lang->install->groupList['DEV']['desc'] = '研发人员'; -$lang->install->groupList['QA']['name'] = '测试'; -$lang->install->groupList['QA']['desc'] = '测试人员'; -$lang->install->groupList['PM']['name'] = '项目经理'; -$lang->install->groupList['PM']['desc'] = '项目经理'; -$lang->install->groupList['PO']['name'] = '产品经理'; -$lang->install->groupList['PO']['desc'] = '产品经理'; -$lang->install->groupList['TD']['name'] = '研发主管'; -$lang->install->groupList['TD']['desc'] = '研发主管'; -$lang->install->groupList['PD']['name'] = '产品主管'; -$lang->install->groupList['PD']['desc'] = '产品主管'; -$lang->install->groupList['QD']['name'] = '测试主管'; -$lang->install->groupList['QD']['desc'] = '测试主管'; -$lang->install->groupList['TOP']['name'] = '高层管理'; -$lang->install->groupList['TOP']['desc'] = '高层管理'; -$lang->install->groupList['OTHERS']['name'] = '其他'; -$lang->install->groupList['OTHERS']['desc'] = '其他'; +$lang->install->groupList['ADMIN']['name'] = '管理员'; +$lang->install->groupList['ADMIN']['desc'] = '系统管理员'; +$lang->install->groupList['DEV']['name'] = '研发'; +$lang->install->groupList['DEV']['desc'] = '研发人员'; +$lang->install->groupList['QA']['name'] = '测试'; +$lang->install->groupList['QA']['desc'] = '测试人员'; +$lang->install->groupList['PM']['name'] = '项目经理'; +$lang->install->groupList['PM']['desc'] = '项目经理'; +$lang->install->groupList['PO']['name'] = '产品经理'; +$lang->install->groupList['PO']['desc'] = '产品经理'; +$lang->install->groupList['TD']['name'] = '研发主管'; +$lang->install->groupList['TD']['desc'] = '研发主管'; +$lang->install->groupList['PD']['name'] = '产品主管'; +$lang->install->groupList['PD']['desc'] = '产品主管'; +$lang->install->groupList['QD']['name'] = '测试主管'; +$lang->install->groupList['QD']['desc'] = '测试主管'; +$lang->install->groupList['TOP']['name'] = '高层管理'; +$lang->install->groupList['TOP']['desc'] = '高层管理'; +$lang->install->groupList['OTHERS']['name'] = '其他'; +$lang->install->groupList['OTHERS']['desc'] = '其他'; +$lang->install->groupList['LIMITED']['name'] = '受限用户'; +$lang->install->groupList['LIMITED']['desc'] = '受限用户分组(只能编辑与自己相关的内容)'; $lang->install->cronList[''] = '监控定时任务'; $lang->install->cronList['moduleName=project&methodName=computeburn'] = '更新燃尽图'; From db3b3deafb675f4839ed37bbe7223d718e7e3ad1 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 11:12:21 +0800 Subject: [PATCH 05/50] * code for task #3476. --- module/upgrade/model.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 4d9e721c4a..a5094c9664 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -1901,4 +1901,21 @@ class upgradeModel extends model return true; } + + /** + * Change limited name. + * + * @access public + * @return bool + */ + public function changeLimitedName() + { + $this->app->loadLang('install'); + $this->dao->update(TABLE_GROUP)->set('name')->eq($this->lang->install->groupList['LIMITED']['name']) + ->set('desc')->eq($this->lang->install->groupList['LIMITED']['desc']) + ->where('role')->eq('limited') + ->exec(); + + return true; + } } From 3eba5feb136d7aa2bd3b9bc8e5e6dcbc8f9f0182 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 11:33:55 +0800 Subject: [PATCH 06/50] * code for task #3476. --- db/zentao.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/zentao.sql b/db/zentao.sql index affac107d4..518265f513 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -916,7 +916,7 @@ INSERT INTO `zt_group` (`id`, `name`, `role`, `desc`) VALUES (9, 'TOP', 'top', 'for top manager.'), (10, 'OTHERS', 'others', 'for others.'), (11, 'guest', 'guest', 'For guest'), -(12, 'limited', 'limited', 'For limited user'); +(12, 'LIMITED', 'limited', 'For limited user'); INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'action', 'editComment'), From cfce20ea3bc312729eeec3e83ebe13ac41d86f8b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 11:35:20 +0800 Subject: [PATCH 07/50] * finish task #3375. --- module/cron/control.php | 6 +++++- module/group/model.php | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/cron/control.php b/module/cron/control.php index 333c021906..0bd99db7a2 100644 --- a/module/cron/control.php +++ b/module/cron/control.php @@ -159,6 +159,7 @@ class cron extends control while(true) { dao::$cache = array(); + /* When cron is null then die. */ if(empty($crons)) break; if(empty($parsedCrons)) break; @@ -170,10 +171,12 @@ class cron extends control /* Run crons. */ $now = new datetime('now'); + unset($_SESSION['company']); + unset($this->app->company); + $this->common->setCompany(); $this->common->loadConfigFromDB(); foreach($parsedCrons as $id => $cron) { - $cronInfo = $this->cron->getById($id); /* Skip empty and stop cron.*/ if(empty($cronInfo) or $cronInfo->status == 'stop') continue; @@ -211,6 +214,7 @@ class cron extends control $log = ''; $time = $now->format('G:i:s'); $log = "$time task " . $id . " executed,\ncommand: $cron[command].\nreturn : $return.\noutput : $output\n"; + $log .= $this->app->company->name . "\n"; $this->cron->logCron($log); unset($log); } diff --git a/module/group/model.php b/module/group/model.php index 3565b60128..1e28da57ce 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -422,7 +422,6 @@ class groupModel extends model $action = strtolower($action); if($action == 'manageview' and $group->role == 'limited') return false; - if($action == 'edit' and $group->role == 'limited') return false; if($action == 'copy' and $group->role == 'limited') return false; return true; From 3571212ee34997828e2d61126bb08447b263fbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 12:06:52 +0800 Subject: [PATCH 08/50] * Format code --- module/testcase/control.php | 212 ++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index d704bf4f24..b4d14ed56b 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -15,7 +15,7 @@ class testcase extends control /** * Construct function, load product, tree, user auto. - * + * * @access public * @return void */ @@ -31,7 +31,7 @@ class testcase extends control /** * Index page. - * + * * @access public * @return void */ @@ -61,8 +61,8 @@ class testcase extends control $browseType = strtolower($browseType); /* Set browseType, productID, moduleID and queryID. */ - $productID = $this->product->saveState($productID, $this->products); - $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; + $productID = $this->product->saveState($productID, $this->products); + $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot); setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot); @@ -75,9 +75,9 @@ class testcase extends control if($browseType == 'bysuite') setcookie('caseSuite', (int)$param, $this->config->cookieLife, $this->config->webRoot); if($browseType != 'bymodule') $this->session->set('caseBrowseType', $browseType); - $moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->caseModule ? $this->cookie->caseModule : 0)); - $suiteID = ($browseType == 'bysuite') ? (int)$param : ($browseType == 'bymodule' ? ($this->cookie->caseSuite ? $this->cookie->caseSuite : 0) : 0); - $queryID = ($browseType == 'bysearch') ? (int)$param : 0; + $moduleID = ($browseType == 'bymodule') ? (int)$param : ($browseType == 'bysearch' ? 0 : ($this->cookie->caseModule ? $this->cookie->caseModule : 0)); + $suiteID = ($browseType == 'bysuite') ? (int)$param : ($browseType == 'bymodule' ? ($this->cookie->caseSuite ? $this->cookie->caseSuite : 0) : 0); + $queryID = ($browseType == 'bysearch') ? (int)$param : 0; /* Set menu, save session. */ $this->testcase->setMenu($this->products, $productID, $branch, $moduleID, $suiteID); @@ -93,7 +93,7 @@ class testcase extends control /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = pager::init($recTotal, $recPerPage, $pageID); - $sort = $this->loadModel('common')->appendOrder($orderBy); + $sort = $this->loadModel('common')->appendOrder($orderBy); /* Get test cases. */ $cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager); @@ -141,9 +141,9 @@ class testcase extends control /** * Group case. - * - * @param int $productID - * @param string $groupBy + * + * @param int $productID + * @param string $groupBy * @access public * @return void */ @@ -173,21 +173,21 @@ class testcase extends control } } - $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common; - $this->view->position[] = html::a($this->createLink('testcase', 'groupTask', "productID=$productID&groupBy=$groupBy"), $this->products[$productID]); - $this->view->position[] = $this->lang->testcase->common; - $this->view->productID = $productID; - $this->view->productName = $this->products[$productID]; - $this->view->users = $this->user->getPairs('noletter'); - $this->view->browseType = 'group'; - $this->view->groupBy = $groupBy; - $this->view->orderBy = $groupBy; - $this->view->groupByList = $groupByList; - $this->view->cases = $groupCases; - $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); - $this->view->suiteID = 0; - $this->view->moduleID = 0; - $this->view->branch = $branch; + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common; + $this->view->position[] = html::a($this->createLink('testcase', 'groupTask', "productID=$productID&groupBy=$groupBy"), $this->products[$productID]); + $this->view->position[] = $this->lang->testcase->common; + $this->view->productID = $productID; + $this->view->productName = $this->products[$productID]; + $this->view->users = $this->user->getPairs('noletter'); + $this->view->browseType = 'group'; + $this->view->groupBy = $groupBy; + $this->view->orderBy = $groupBy; + $this->view->groupByList = $groupByList; + $this->view->cases = $groupCases; + $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); + $this->view->suiteID = 0; + $this->view->moduleID = 0; + $this->view->branch = $branch; $this->display(); } @@ -286,13 +286,13 @@ class testcase extends control /* If bugID large than 0, use this bug as template. */ if($bugID > 0) { - $bug = $this->loadModel('bug')->getById($bugID); - $type = $bug->type; - $pri = $bug->pri ? $bug->pri : $bug->severity; - $storyID = $bug->story; - $caseTitle= $bug->title; - $keywords = $bug->keywords; - $steps = $this->testcase->createStepsFromBug($bug->steps); + $bug = $this->loadModel('bug')->getById($bugID); + $type = $bug->type; + $pri = $bug->pri ? $bug->pri : $bug->severity; + $storyID = $bug->story; + $caseTitle = $bug->title; + $keywords = $bug->keywords; + $steps = $this->testcase->createStepsFromBug($bug->steps); } /* Padding the steps to the default steps count. */ @@ -428,9 +428,9 @@ class testcase extends control /** * Create bug. - * - * @param int $productID - * @param string $extras + * + * @param int $productID + * @param string $extras * @access public * @return void */ @@ -453,20 +453,20 @@ class testcase extends control if(!$case) die(js::error($this->lang->notFound) . js::locate('back', 'parent')); - $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->createBug; - $this->view->runID = $runID; - $this->view->case = $case; - $this->view->caseID = $caseID; - $this->view->version = $version; + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->createBug; + $this->view->runID = $runID; + $this->view->case = $case; + $this->view->caseID = $caseID; + $this->view->version = $version; $this->display(); } /** * View a test case. - * - * @param int $caseID - * @param int $version - * @param string $from + * + * @param int $caseID + * @param int $version + * @param string $from * @access public * @return void */ @@ -527,8 +527,8 @@ class testcase extends control /** * Edit a case. - * - * @param int $caseID + * + * @param int $caseID * @access public * @return void */ @@ -586,9 +586,9 @@ class testcase extends control } else { - $productID = $case->product; - $title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->edit; - $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); + $productID = $case->product; + $title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->edit; + $position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); /* Set menu. */ $this->testcase->setMenu($this->products, $productID, $case->branch); @@ -615,21 +615,21 @@ class testcase extends control $position[] = $this->lang->testcase->common; $position[] = $this->lang->testcase->edit; - $this->view->title = $title; - $this->view->position = $position; - $this->view->currentModuleID = $case->module; - $this->view->users = $this->user->getPairs('noletter'); - $this->view->case = $case; - $this->view->actions = $this->loadModel('action')->getList('case', $caseID); - $this->view->isLibCase = $isLibCase; + $this->view->title = $title; + $this->view->position = $position; + $this->view->currentModuleID = $case->module; + $this->view->users = $this->user->getPairs('noletter'); + $this->view->case = $case; + $this->view->actions = $this->loadModel('action')->getList('case', $caseID); + $this->view->isLibCase = $isLibCase; $this->display(); } /** * Batch edit case. - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ @@ -750,8 +750,8 @@ class testcase extends control /** * Review case. - * - * @param int $caseID + * + * @param int $caseID * @access public * @return void */ @@ -761,7 +761,7 @@ class testcase extends control { $this->testcase->review($caseID); if(dao::isError()) die(js::error(dao::getError())); - $result = $this->post->result; + $result = $this->post->result; $this->loadModel('action')->create('case', $caseID, 'Reviewed', $this->post->comment, ucfirst($result)); die(js::reload('parent.parent')); } @@ -774,8 +774,8 @@ class testcase extends control /** * Batch review case. - * - * @param string $result + * + * @param string $result * @access public * @return void */ @@ -791,8 +791,8 @@ class testcase extends control /** * Delete a test case - * - * @param int $caseID + * + * @param int $caseID * @param string $confirm yes|noe * @access public * @return void @@ -828,8 +828,8 @@ class testcase extends control /** * Batch delete cases. - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ @@ -871,8 +871,8 @@ class testcase extends control /** * Batch review case. - * - * @param string $result + * + * @param string $result * @access public * @return void */ @@ -973,9 +973,9 @@ class testcase extends control } /** - * Confirm testcase changed. - * - * @param int $caseID + * Confirm testcase changed. + * + * @param int $caseID * @access public * @return void */ @@ -988,8 +988,8 @@ class testcase extends control /** * Confirm story changes. - * - * @param int $caseID + * + * @param int $caseID * @access public * @return void */ @@ -1003,8 +1003,8 @@ class testcase extends control /** * Batch ctory change cases. - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ @@ -1018,11 +1018,11 @@ class testcase extends control } /** - * export - * - * @param int $productID - * @param string $orderBy - * @param int $taskID + * export + * + * @param int $productID + * @param string $orderBy + * @param int $taskID * @access public * @return void */ @@ -1196,9 +1196,9 @@ class testcase extends control } /** - * Export templet - * - * @param int $productID + * Export templet + * + * @param int $productID * @access public * @return void */ @@ -1220,8 +1220,8 @@ class testcase extends control $fields['stage'] = $this->lang->testcase->stage; $fields[''] = ''; - $fields['typeValue'] = $this->lang->testcase->lblTypeValue; - $fields['stageValue'] = $this->lang->testcase->lblStageValue; + $fields['typeValue'] = $this->lang->testcase->lblTypeValue; + $fields['stageValue'] = $this->lang->testcase->lblStageValue; if($product->type != 'normal') $fields['branchValue'] = $this->lang->product->branchName[$product->type]; $branches = $this->loadModel('branch')->getPairs($productID); @@ -1257,9 +1257,9 @@ class testcase extends control } /** - * Import csv - * - * @param int $productID + * Import csv + * + * @param int $productID * @access public * @return void */ @@ -1324,14 +1324,14 @@ class testcase extends control /** * Import case from lib. - * - * @param int $productID - * @param int $branch - * @param int $libID - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * + * @param int $productID + * @param int $branch + * @param int $libID + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ @@ -1395,8 +1395,8 @@ class testcase extends control /** * Show import data - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ @@ -1419,7 +1419,7 @@ class testcase extends control $fields = array_flip($fields); $rows = $this->loadModel('file')->parseCSV($file); - $header = array(); + $header = array(); foreach($rows[0] as $i => $rowValue) { if(empty($rowValue)) break; @@ -1451,7 +1451,7 @@ class testcase extends control { $id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')'); $case->$field = $id; - } + } } elseif(in_array($field, $caseConfig->export->listFields)) { @@ -1568,10 +1568,10 @@ class testcase extends control /** * Case bugs. - * - * @param int $runID - * @param int $caseID - * @param int $version + * + * @param int $runID + * @param int $caseID + * @param int $version * @access public * @return void */ From 452ab148f00e7722f88c5d7edfab751ec54c07d2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 13:11:20 +0800 Subject: [PATCH 09/50] * remove test code. --- module/cron/control.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/cron/control.php b/module/cron/control.php index 0bd99db7a2..81fbe3592c 100644 --- a/module/cron/control.php +++ b/module/cron/control.php @@ -214,7 +214,6 @@ class cron extends control $log = ''; $time = $now->format('G:i:s'); $log = "$time task " . $id . " executed,\ncommand: $cron[command].\nreturn : $return.\noutput : $output\n"; - $log .= $this->app->company->name . "\n"; $this->cron->logCron($log); unset($log); } From 22f4518437df60985ce26d35fc49cba9208f52e5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 13:38:46 +0800 Subject: [PATCH 10/50] * finish task #3383. --- module/git/control.php | 4 ++++ module/git/model.php | 23 ++++++++++++++++++++--- module/git/view/diff.html.php | 2 +- module/svn/control.php | 4 ++++ module/svn/model.php | 23 ++++++++++++++++++++--- module/svn/view/diff.html.php | 2 +- 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/module/git/control.php b/module/git/control.php index 88f37ce641..e513d6432f 100644 --- a/module/git/control.php +++ b/module/git/control.php @@ -32,7 +32,9 @@ class git extends control */ public function diff($path, $revision) { + if(isset($_GET['repoUrl'])) $path = $this->get->repoUrl; $path = helper::safe64Decode($path); + $this->view->path = $path; $this->view->revision = $revision; $this->view->diff = $this->git->diff($path, $revision); @@ -50,7 +52,9 @@ class git extends control */ public function cat($path, $revision) { + if(isset($_GET['repoUrl'])) $path = $this->get->repoUrl; $path = helper::safe64Decode($path); + $this->view->path = $path; $this->view->revision = $revision; $this->view->code = $this->git->cat($path, $revision); diff --git a/module/git/model.php b/module/git/model.php index ee564f1356..1932bc00b5 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -643,9 +643,8 @@ class gitModel extends model { foreach($actionFiles as $file) { - $param = array('url' => helper::safe64Encode($repoRoot . $file), 'revision' => $log->revision); - $catLink = trim(html::a(helper::createLink('git', 'cat', $param, 'html'), 'view', '', "class='repolink'")); - $diffLink = trim(html::a(helper::createLink('git', 'diff', $param, 'html'), 'diff', '', "class='repolink'")); + $catLink = trim(html::a($this->buildURL('cat', $repoRoot . $file, $log->revision), 'view', '', "class='repolink'")); + $diffLink = trim(html::a($this->buildURL('diff', $repoRoot . $file, $log->revision), 'diff', '', "class='repolink'")); $diff .= $action . " " . $file . " $catLink "; $diff .= $action == 'M' ? "$diffLink\n" : "\n" ; } @@ -747,4 +746,22 @@ class gitModel extends model { echo helper::now() . " $log\n"; } + + /** + * Build URL. + * + * @param string $methodName + * @param string $url + * @param int $revision + * @access public + * @return string + */ + public function buildURL($methodName, $url, $revision) + { + $buildedURL = helper::createLink('git', $methodName, "path=&revision=$revision", 'html'); + $buildedURL .= strpos($buildURL, '?') === false ? '?' : '&'; + $buildedURL .= 'repoUrl=' . helper::safe64Encode($url); + + return $buildedURL; + } } diff --git a/module/git/view/diff.html.php b/module/git/view/diff.html.php index 20c035297d..3c710254db 100644 --- a/module/git/view/diff.html.php +++ b/module/git/view/diff.html.php @@ -11,7 +11,7 @@ */ ?> - +git->buildURL('cat', $path, $revision);?>
<?php echo $diff;?>
diff --git a/module/svn/control.php b/module/svn/control.php index 78eb9cf9c9..1319e3c69c 100644 --- a/module/svn/control.php +++ b/module/svn/control.php @@ -32,7 +32,9 @@ class svn extends control */ public function diff($url, $revision) { + if(isset($_GET['repoUrl'])) $url = $this->get->repoUrl; $url = helper::safe64Decode($url); + $this->view->url = $url; $this->view->revision = $revision; $this->view->diff = $this->svn->diff($url, $revision); @@ -50,7 +52,9 @@ class svn extends control */ public function cat($url, $revision) { + if(isset($_GET['repoUrl'])) $url = $this->get->repoUrl; $url = helper::safe64Decode($url); + $this->view->url = $url; $this->view->revision = $revision; $this->view->code = $this->svn->cat($url, $revision); diff --git a/module/svn/model.php b/module/svn/model.php index 161337527c..1d8c2d8469 100644 --- a/module/svn/model.php +++ b/module/svn/model.php @@ -611,9 +611,8 @@ class svnModel extends model { foreach($actionFiles as $file) { - $param = array('url' => helper::safe64Encode($repoRoot . $file), 'revision' => $log->revision); - $catLink = trim(html::a(helper::createLink('svn', 'cat', $param, 'html'), 'view', '', "class='repolink'")); - $diffLink = trim(html::a(helper::createLink('svn', 'diff', $param, 'html'), 'diff', '', "class='repolink'")); + $catLink = trim(html::a($this->buildURL('cat', $repoRoot . $file, $log->revision), 'view', '', "class='repolink'")); + $diffLink = trim(html::a($this->buildURL('diff', $repoRoot . $file, $log->revision), 'diff', '', "class='repolink'")); $diff .= $action . " " . $file . " $catLink "; $diff .= $action == 'M' ? "$diffLink\n" : "\n" ; } @@ -715,4 +714,22 @@ class svnModel extends model { echo helper::now() . " $log\n"; } + + /** + * Build URL. + * + * @param string $methodName + * @param string $url + * @param int $revision + * @access public + * @return string + */ + public function buildURL($methodName, $url, $revision) + { + $buildedURL = helper::createLink('svn', $methodName, "url=&revision=$revision", 'html'); + $buildedURL .= strpos($buildedURL, '?') === false ? '?' : '&'; + $buildedURL .= 'repoUrl=' . helper::safe64Encode($url); + + return $buildedURL; + } } diff --git a/module/svn/view/diff.html.php b/module/svn/view/diff.html.php index e1ef71b6ee..a95e312446 100644 --- a/module/svn/view/diff.html.php +++ b/module/svn/view/diff.html.php @@ -11,7 +11,7 @@ */ ?> - +svn->buildURL('cat', $url, $revision);?>
<?php echo $diff;?>
From 526dad43d3a478df6212c7511e465af87a6e5f12 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 14:07:25 +0800 Subject: [PATCH 11/50] * finish task #3394. --- module/story/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index c7fbf2c8db..7b699d8107 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -673,7 +673,7 @@ class story extends control $this->story->review($storyID); if(dao::isError()) die(js::error(dao::getError())); $result = $this->post->result; - if($this->post->closedReason != '' and strpos('done,postponed,subdivided', $this->post->closedReason) === false) $result = 'pass'; + if($this->post->closedReason != '' and strpos('done,postponed,subdivided,willnotdo', $this->post->closedReason) === false) $result = 'pass'; $actionID = $this->action->create('story', $storyID, 'Reviewed', $this->post->comment, ucfirst($result)); $this->story->sendmail($storyID, $actionID); if($this->post->result == 'reject') From 6006f3e93a5fe76f6ced9a20059fa390971f9ba3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 14:22:09 +0800 Subject: [PATCH 12/50] * finish task #3397. --- config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.php b/config/config.php index 60180e1c8d..b01c02e9c7 100644 --- a/config/config.php +++ b/config/config.php @@ -38,7 +38,7 @@ $config->langs['zh-tw'] = '繁體'; $config->langs['en'] = 'English'; /* 设备类型视图文件前缀。The prefix for view file for different device. */ -$config->devicePrefix['mhtml'] = 'm.'; +$config->devicePrefix['mhtml'] = ''; /* 默认值设置。Default settings. */ $config->default = new stdclass(); From 221291c0f3142663653dac749eaafb898474e246 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 15:52:36 +0800 Subject: [PATCH 13/50] * finish task #3429. --- module/bug/control.php | 28 ++++++++++++++++++++++++++ module/bug/model.php | 29 +++++++++++++++++++++++++++ module/bug/view/browse.html.php | 17 ++++++++++++++++ module/testcase/control.php | 27 +++++++++++++++++++++++++ module/testcase/model.php | 30 ++++++++++++++++++++++++++++ module/testcase/view/browse.html.php | 17 ++++++++++++++++ 6 files changed, 148 insertions(+) diff --git a/module/bug/control.php b/module/bug/control.php index 07473775d2..428b3c4b45 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -766,6 +766,34 @@ class bug extends control $this->display(); } + /** + * Batch change branch. + * + * @param int $branchID + * @access public + * @return void + */ + public function batchChangeBranch($branchID) + { + if($this->post->bugIDList) + { + $bugIDList = $this->post->bugIDList; + $bugIDList = array_unique($bugIDList); + unset($_POST['bugIDList']); + $allChanges = $this->bug->batchChangeBranch($bugIDList, $branchID); + if(dao::isError()) die(js::error(dao::getError())); + foreach($allChanges as $bugID => $changes) + { + $this->loadModel('action'); + $actionID = $this->action->create('bug', $bugID, 'Edited'); + $this->action->logHistory($actionID, $changes); + $this->bug->sendmail($bugID, $actionID); + } + } + $this->loadModel('score')->create('ajax', 'batchOther'); + die(js::locate($this->session->bugList, 'parent')); + } + /** * Batch change the module of bug. * diff --git a/module/bug/model.php b/module/bug/model.php index 65e926525f..b6802cef13 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -869,6 +869,35 @@ class bugModel extends model $this->linkBugToBuild($bugID, $bug->resolvedBuild); } + /** + * Batch change branch. + * + * @param array $bugIDList + * @param int $branchID + * @access public + * @return array + */ + public function batchChangeBranch($bugIDList, $branchID) + { + $now = helper::now(); + $allChanges = array(); + $oldBugs = $this->getByList($bugIDList); + foreach($bugIDList as $bugID) + { + $oldBug = $oldBugs[$bugID]; + if($branchID == $oldBug->branch) continue; + + $bug = new stdclass(); + $bug->lastEditedBy = $this->app->user->account; + $bug->lastEditedDate = $now; + $bug->branch = $branchID; + + $this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec(); + if(!dao::isError()) $allChanges[$bugID] = common::createChanges($oldBug, $bug); + } + return $allChanges; + } + /** * Batch change the module of bug. * diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 01e27a1313..d96aed6646 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -237,6 +237,23 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow $misc = common::hasPriv('bug', 'batchActivate') ? "onclick=\"setFormAction('$actionLink')\"" : $class; if($misc) echo "
  • " . html::a('javascript:;', $lang->bug->activate, '', $misc) . "
  • "; + if(common::hasPriv('bug', 'batchChangeBranch') and $this->session->currentProductType != 'normal') + { + $withSearch = count($branches) > 8; + echo "'; + } + if(common::hasPriv('bug', 'batchChangeModule')) { $withSearch = count($modules) > 8; diff --git a/module/testcase/control.php b/module/testcase/control.php index b4d14ed56b..f0b26653a1 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -842,6 +842,33 @@ class testcase extends control die(js::locate($this->session->caseList)); } + /** + * Batch change branch. + * + * @param int $branchID + * @access public + * @return void + */ + public function batchChangeBranch($branchID) + { + if($this->post->caseIDList) + { + $caseIDList = $this->post->caseIDList; + $caseIDList = array_unique($caseIDList); + unset($_POST['caseIDList']); + $allChanges = $this->testcase->batchChangeBranch($caseIDList, $branchID); + if(dao::isError()) die(js::error(dao::getError())); + foreach($allChanges as $caseID => $changes) + { + $this->loadModel('action'); + $actionID = $this->action->create('case', $caseID, 'Edited'); + $this->action->logHistory($actionID, $changes); + } + } + + die(js::locate($this->session->caseList, 'parent')); + } + /** * Batch change the module of case. * diff --git a/module/testcase/model.php b/module/testcase/model.php index 276b169a29..6bcd2e5f27 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -817,6 +817,36 @@ class testcaseModel extends model return $allChanges; } + /** + * Batch change branch. + * + * @param array $caseIDList + * @param int $branchID + * @access public + * @return array + */ + public function batchChangeBranch($caseIDList, $branchID) + { + $now = helper::now(); + $allChanges = array(); + $oldCases = $this->getByList($caseIDList); + foreach($caseIDList as $caseID) + { + $oldCase = $oldCases[$caseID]; + if($branchID == $oldCase->branch) continue; + + $case = new stdclass(); + $case->lastEditedBy = $this->app->user->account; + $case->lastEditedDate = $now; + $case->branch = $branchID; + + $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('id')->eq((int)$caseID)->exec(); + if(!dao::isError()) $allChanges[$caseID] = common::createChanges($oldCase, $case); + } + + return $allChanges; + } + /** * Batch change the module of case. * diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 7a2d74378d..5568136d72 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -128,6 +128,23 @@ js::set('branch', $branch); $misc = common::hasPriv('testtask', 'batchRun') ? "onclick=\"setFormAction('$actionLink')\"" : $class; echo "
  • " . html::a('#', $lang->testtask->runCase, '', $misc) . "
  • "; + if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType != 'normal') + { + $withSearch = count($branches) > 8; + echo "'; + } + if(common::hasPriv('testcase', 'batchChangeModule')) { $withSearch = count($modules) > 8; From 5fc4f0dadb26c058299098dcdf2cce88490deac0 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 13 Dec 2017 16:06:00 +0800 Subject: [PATCH 14/50] * finish task #3433. --- module/doc/view/showfiles.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index 2a024e0daf..0d190921c9 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -133,7 +133,7 @@
    - objectID");?>'>title . '.' . $file->extension . ' [' . strtoupper($file->objectType) . ' #' . $file->objectID . ']';?> + objectID");?>' title='addedDate, 0, 10)?>'>title . '.' . $file->extension . ' [' . strtoupper($file->objectType) . ' #' . $file->objectID . ']';?> id"); ?>' target='hiddenwin' title='delete?>' class='delete pull-right'> From 0e5b6e52ce5ac2366a4ae2ccafda97c85576bcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 16:41:38 +0800 Subject: [PATCH 15/50] * Task #3448 --- module/testcase/control.php | 3 ++- module/testcase/model.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index b4d14ed56b..8af632b6c3 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -728,7 +728,8 @@ class testcase extends control if($showSuhosinInfo) $this->view->suhosinInfo = extension_loaded('suhosin') ? sprintf($this->lang->suhosinInfo, $countInputVars) : sprintf($this->lang->maxVarsInfo, $countInputVars); $this->loadModel('story'); - $this->view->stories = $this->story->getProductStoryPairs($productID, $branch); + $stories = $this->story->getProductStoryPairs($productID, $branch); + $this->view->stories = array('' => '', 'ditto' => $this->lang->testcase->ditto) + $stories; /* Set custom. */ foreach(explode(',', $this->config->testcase->customBatchEditFields) as $field) $customFields[$field] = $this->lang->testcase->$field; diff --git a/module/testcase/model.php b/module/testcase/model.php index 276b169a29..71c96cdc83 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -762,13 +762,15 @@ class testcaseModel extends model if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; if($data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; + if($data->stories[$caseID] == 'ditto') $data->stories[$caseID] = isset($prev['story']) ? $prev['story'] : 0; if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; if($data->stories[$caseID] == '') $data->stories[$caseID] = 0; $prev['pri'] = $data->pris[$caseID]; + $prev['type'] = $data->types[$caseID]; + $prev['story'] = $data->stories[$caseID]; $prev['branch'] = $data->branches[$caseID]; $prev['module'] = $data->modules[$caseID]; - $prev['type'] = $data->types[$caseID]; } /* Initialize cases from the post data.*/ From f289c99c984ff6fea76f287ec45c953c117ec597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 16:48:18 +0800 Subject: [PATCH 16/50] * Task #3465 --- module/my/css/managecontacts.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/module/my/css/managecontacts.css b/module/my/css/managecontacts.css index ba39800635..ff377438c5 100644 --- a/module/my/css/managecontacts.css +++ b/module/my/css/managecontacts.css @@ -1,3 +1 @@ body.body-modal {padding-bottom: 20px; min-height: 400px} - -.list-group-item.active {color: #1A4F85} From 7449b93402a7d743e06f17ae587a5cec835d13db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 19:17:29 +0800 Subject: [PATCH 17/50] * Task #3465 --- module/my/control.php | 14 ++++++++++---- module/my/lang/en.php | 1 + module/my/lang/zh-cn.php | 1 + module/my/view/managecontacts.html.php | 11 ++++++++++- module/project/model.php | 2 +- module/user/model.php | 16 ++++++++++++++++ 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index b50db17dce..60ab5c18d3 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -406,12 +406,14 @@ class my extends control if($this->post->mode == 'new') { $listID = $this->user->createContactList($this->post->newList, $this->post->users); + if(isset($_POST['share'])) $this->user->setGlobalContacts($listID); if(isonlybody()) die(js::closeModal('parent.parent', '', 'function(){parent.parent.ajaxGetContacts(\'#mailtoGroup\')}')); die(js::locate(inlink('manageContacts', "listID=$listID"), 'parent')); } elseif($this->post->mode == 'edit') { $this->user->updateContactList($this->post->listID, $this->post->listName, $this->post->users); + if(isset($_POST['share'])) $this->user->setGlobalContacts($this->post->listID); die(js::locate(inlink('manageContacts', "listID={$this->post->listID}"), 'parent')); } } @@ -434,10 +436,14 @@ class my extends control $this->view->list = $this->user->getContactListByID($listID); } - $this->view->mode = $mode; - $this->view->lists = $lists; - $this->view->listID = $listID; - $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed'); + $globalContacts = isset($this->config->my->global->globalContact) ? $this->config->my->global->globalContact : ''; + if(!empty($globalContacts)) $globalContacts = explode(',', $globalContacts); + + $this->view->mode = $mode; + $this->view->lists = $lists; + $this->view->listID = $listID; + $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed'); + $this->view->globalContacts = $globalContacts; $this->display(); } diff --git a/module/my/lang/en.php b/module/my/lang/en.php index e9a746aa4b..a5909c9093 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -17,6 +17,7 @@ $lang->my->changePassword = 'Edit Password'; $lang->my->unbind = 'Unbind Ranger'; $lang->my->manageContacts = 'Maintain Contact'; $lang->my->deleteContacts = 'Delete Contact'; +$lang->my->shareContacts = 'Share List'; $lang->my->limited = 'Restricted operation (editing only content related to itself)'; $lang->my->score = 'My Score'; $lang->my->scoreRule = 'Score Rule'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 1c9adf8250..fe82f4cf71 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -17,6 +17,7 @@ $lang->my->changePassword = '修改密码'; $lang->my->unbind = '解除然之绑定'; $lang->my->manageContacts = '维护联系人'; $lang->my->deleteContacts = '删除联系人'; +$lang->my->shareContacts = '共享联系人列表'; $lang->my->limited = '受限操作(只能编辑与自己相关的内容)'; $lang->my->score = '我的积分'; $lang->my->scoreRule = '积分规则'; diff --git a/module/my/view/managecontacts.html.php b/module/my/view/managecontacts.html.php index 2f0f1ff76e..0a52c7ce66 100644 --- a/module/my/view/managecontacts.html.php +++ b/module/my/view/managecontacts.html.php @@ -19,7 +19,8 @@ foreach($lists as $id => $listName) { $listClass = ($id == $listID) ? 'list-group-item active' : 'list-group-item'; - echo html::a(inlink('managecontacts', "listID=$id&mode=edit"), $listName, '', "class='{$listClass}'"); + $shareIcon = in_array($id, $globalContacts) ? ' ' : ''; + echo html::a(inlink('managecontacts', "listID=$id&mode=edit"), $shareIcon . $listName, '', "class='{$listClass}'"); } ?> @@ -72,6 +73,14 @@ ?>
    + + + + + + + id, $disabled)):?> +
    idAB;?> '> product->branch;?>'> bug->module;?>'> bug->module;?> '>bug->project;?> bug->openedBuild;?> bug->title;?>
    idAB;?> '>product->branch;?>'>story->module;?>'>story->module;?> '>story->plan;?> = 9) echo "class='w-150px'"?>>story->title;?> '>story->spec;?>
    + +
    diff --git a/module/project/model.php b/module/project/model.php index 2ba24b764c..74d6d665a0 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2239,7 +2239,7 @@ class projectModel extends model */ public function getPrevKanban($projectID) { - $prevKanbans = $this->loadModel('setting')->getItem("ower=null&module=project§ion=kanban&key=project$projectID"); + $prevKanbans = $this->loadModel('setting')->getItem("owner=null&module=project§ion=kanban&key=project$projectID"); return json_decode($prevKanbans, true); } diff --git a/module/user/model.php b/module/user/model.php index 3daf2b6c1b..c52c772809 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1011,6 +1011,22 @@ class userModel extends model if(dao::isError()) die(js::error(dao::getError())); } + /** + * Update global contact. + * + * @param $listID + * + * @access public + * @return void + */ + public function setGlobalContacts($listID) + { + $contacts = $this->loadModel('setting')->getItem("owner=system&module=my§ion=global&key=globalContact"); + $contactsIDs = empty($contacts) ? array() : explode(',', $contacts); + array_push($contactsIDs, $listID); + $this->loadModel('setting')->setItem('system.my.global.globalContact', join(',', $contactsIDs)); + } + /** * Delete a contact list. * From f34e4c7ee3af6d1d7bb204778e293d0ddd6283aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 19:30:29 +0800 Subject: [PATCH 18/50] * Task #3465 --- module/my/control.php | 4 ++-- module/user/model.php | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 60ab5c18d3..622322f647 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -406,14 +406,14 @@ class my extends control if($this->post->mode == 'new') { $listID = $this->user->createContactList($this->post->newList, $this->post->users); - if(isset($_POST['share'])) $this->user->setGlobalContacts($listID); + $this->user->setGlobalContacts($listID, isset($_POST['share'])); if(isonlybody()) die(js::closeModal('parent.parent', '', 'function(){parent.parent.ajaxGetContacts(\'#mailtoGroup\')}')); die(js::locate(inlink('manageContacts', "listID=$listID"), 'parent')); } elseif($this->post->mode == 'edit') { $this->user->updateContactList($this->post->listID, $this->post->listName, $this->post->users); - if(isset($_POST['share'])) $this->user->setGlobalContacts($this->post->listID); + $this->user->setGlobalContacts($this->post->listID, isset($_POST['share'])); die(js::locate(inlink('manageContacts', "listID={$this->post->listID}"), 'parent')); } } diff --git a/module/user/model.php b/module/user/model.php index c52c772809..36f5153f23 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1014,16 +1014,25 @@ class userModel extends model /** * Update global contact. * - * @param $listID + * @param $listID + * @param bool $isPush * * @access public * @return void */ - public function setGlobalContacts($listID) + public function setGlobalContacts($listID, $isPush = true) { $contacts = $this->loadModel('setting')->getItem("owner=system&module=my§ion=global&key=globalContact"); $contactsIDs = empty($contacts) ? array() : explode(',', $contacts); - array_push($contactsIDs, $listID); + if($isPush) + { + if(!in_array($listID, $contactsIDs)) array_push($contactsIDs, $listID); + } + else + { + $key = array_search($listID, $contactsIDs); + if($key !== false) array_splice($contactsIDs, $key, 1); + } $this->loadModel('setting')->setItem('system.my.global.globalContact', join(',', $contactsIDs)); } From 2f966a1d9db5b52e61c42a93020aa2e70b6fcb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 21:29:58 +0800 Subject: [PATCH 19/50] * Task #3465 --- module/my/control.php | 23 +++++++++++---- module/my/view/managecontacts.html.php | 4 +++ module/user/model.php | 39 ++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 11 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 622322f647..7013141438 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -418,8 +418,23 @@ class my extends control } } - $mode = empty($mode) ? 'edit' : $mode; - $lists = $this->user->getContactLists($this->app->user->account); + $mode = empty($mode) ? 'edit' : $mode; + $lists = $this->user->getContactLists($this->app->user->account); + + $globalContacts = isset($this->config->my->global->globalContacts) ? $this->config->my->global->globalContacts : ''; + $globalContacts = !empty($globalContacts) ? explode(',', $globalContacts) : array(); + + $myContacts = $this->user->getListByAccount($this->app->user->account); + $disabled = $globalContacts; + + if(!empty($myContacts) && !empty($globalContacts)) + { + foreach($globalContacts as $id) + { + if(in_array($id, array_keys($myContacts))) unset($disabled[array_search($id, $disabled)]); + } + } + $listID = $listID ? $listID : key($lists); if(!$listID) $mode = 'new'; @@ -436,13 +451,11 @@ class my extends control $this->view->list = $this->user->getContactListByID($listID); } - $globalContacts = isset($this->config->my->global->globalContact) ? $this->config->my->global->globalContact : ''; - if(!empty($globalContacts)) $globalContacts = explode(',', $globalContacts); - $this->view->mode = $mode; $this->view->lists = $lists; $this->view->listID = $listID; $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed'); + $this->view->disabled = $disabled; $this->view->globalContacts = $globalContacts; $this->display(); } diff --git a/module/my/view/managecontacts.html.php b/module/my/view/managecontacts.html.php index 0a52c7ce66..bd8af46356 100644 --- a/module/my/view/managecontacts.html.php +++ b/module/my/view/managecontacts.html.php @@ -73,6 +73,7 @@ ?>
    @@ -81,6 +82,8 @@
    @@ -88,6 +91,7 @@ delete, 'hiddenwin', "class='btn btn-danger'");?>
    diff --git a/module/user/model.php b/module/user/model.php index 36f5153f23..d124add45d 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -915,15 +915,29 @@ class userModel extends model /** * Get contact list of a user. * - * @param string $account - * @param string $params withempty|withnote + * @param string $account + * @param string $params withempty|withnote + * * @access public * @return object */ public function getContactLists($account, $params= '') { - $contacts = $this->dao->select('id, listName')->from(TABLE_USERCONTACT)->where('account')->eq($account)->fetchPairs(); - if(!$contacts) return array(); + $contacts = $this->getListByAccount($account); + $globalIDs = isset($this->config->my->global->globalContacts) ? $this->config->my->global->globalContacts : ''; + + if(!empty($globalIDs)) + { + $globalIDs = explode(',', $globalIDs); + $globalContacts = $this->dao->select('id, listName')->from(TABLE_USERCONTACT)->where('id')->in($globalIDs)->fetchPairs(); + foreach($globalContacts as $id => $contact) + { + if(in_array($id, array_keys($contacts))) unset($globalContacts[$id]); + } + if(!empty($globalContacts)) $contacts = $globalContacts + $contacts; + } + + if(empty($contacts)) return array(); if(strpos($params, 'withempty') !== false) $contacts = array('' => '') + $contacts; if(strpos($params, 'withnote') !== false) $contacts = array('' => $this->lang->user->contacts->common) + $contacts; @@ -931,6 +945,19 @@ class userModel extends model return $contacts; } + /** + * Get Contact List by account. + * + * @param string $account + * + * @access public + * @return array + */ + public function getListByAccount($account) + { + return $this->dao->select('id, listName')->from(TABLE_USERCONTACT)->where('account')->eq($account)->fetchPairs(); + } + /** * Get a contact list by id. * @@ -1022,7 +1049,7 @@ class userModel extends model */ public function setGlobalContacts($listID, $isPush = true) { - $contacts = $this->loadModel('setting')->getItem("owner=system&module=my§ion=global&key=globalContact"); + $contacts = $this->loadModel('setting')->getItem("owner=system&module=my§ion=global&key=globalContacts"); $contactsIDs = empty($contacts) ? array() : explode(',', $contacts); if($isPush) { @@ -1033,7 +1060,7 @@ class userModel extends model $key = array_search($listID, $contactsIDs); if($key !== false) array_splice($contactsIDs, $key, 1); } - $this->loadModel('setting')->setItem('system.my.global.globalContact', join(',', $contactsIDs)); + $this->loadModel('setting')->setItem('system.my.global.globalContacts', join(',', $contactsIDs)); } /** From 3697775a1abfef81e7fd45ae6465968fae9a6fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 21:31:35 +0800 Subject: [PATCH 20/50] * Format code --- module/my/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/my/control.php b/module/my/control.php index 7013141438..e1791ea6fe 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -455,7 +455,7 @@ class my extends control $this->view->lists = $lists; $this->view->listID = $listID; $this->view->users = $this->user->getPairs('noletter|noempty|noclosed|noclosed'); - $this->view->disabled = $disabled; + $this->view->disabled = $disabled; $this->view->globalContacts = $globalContacts; $this->display(); } From f21bfab1ebfa83a0da65bcce9fc04c6126300a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 13 Dec 2017 21:38:15 +0800 Subject: [PATCH 21/50] * Task #3465 --- module/my/view/managecontacts.html.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/my/view/managecontacts.html.php b/module/my/view/managecontacts.html.php index bd8af46356..22954526c0 100644 --- a/module/my/view/managecontacts.html.php +++ b/module/my/view/managecontacts.html.php @@ -45,13 +45,14 @@
    id, $disabled) ? ' readonly' : ''; if($mode == 'new') { echo html::input('newList', '', "class='form-control'"); } else { - echo html::input('listName', $list->listName, "class='form-control'"); + echo html::input('listName', $list->listName, "$readonly class='form-control'"); echo html::hidden('listID', $list->id); } ?> @@ -68,7 +69,7 @@ } else { - echo html::select('users[]', $users, $list->userList, "multiple class='form-control chosen'"); + echo html::select('users[]', $users, $list->userList, "multiple $readonly class='form-control chosen'"); } ?> From 2c896fbe8f6027d101e8120730aa14bfdac45d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 09:36:39 +0800 Subject: [PATCH 22/50] * Task #3456 Add SQL --- db/update9.6.3.sql | 1 + db/zentao.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 db/update9.6.3.sql diff --git a/db/update9.6.3.sql b/db/update9.6.3.sql new file mode 100644 index 0000000000..39bc5e846b --- /dev/null +++ b/db/update9.6.3.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_productplan` ADD `order` TEXT NOT NULL AFTER `end`; diff --git a/db/zentao.sql b/db/zentao.sql index 518265f513..bafc633bfb 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -438,6 +438,7 @@ CREATE TABLE IF NOT EXISTS `zt_productplan` ( `desc` text NOT NULL, `begin` date NOT NULL, `end` date NOT NULL, + `order` text NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `plan` (`product`,`end`) From b3515831b824a0a1073909c6fdc87af71b8ed3c9 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 09:38:39 +0800 Subject: [PATCH 23/50] * finish task #3468. --- module/extension/lang/en.php | 1 + module/extension/lang/zh-cn.php | 1 + module/extension/model.php | 31 +++++++++++++++++++++++++++ module/extension/view/browse.html.php | 2 ++ 4 files changed, 35 insertions(+) diff --git a/module/extension/lang/en.php b/module/extension/lang/en.php index af7d6fad96..895ecd3bd8 100644 --- a/module/extension/lang/en.php +++ b/module/extension/lang/en.php @@ -46,6 +46,7 @@ $lang->extension->downloads = 'Downloads'; $lang->extension->compatible = 'Compatibility'; $lang->extension->grade = 'Score'; $lang->extension->depends = 'Dependent'; +$lang->extension->expireDate = 'Expire'; $lang->extension->zentaoCompatible = 'Compatible Version'; $lang->extension->installedTime = 'Installed Time'; diff --git a/module/extension/lang/zh-cn.php b/module/extension/lang/zh-cn.php index b182beefb5..42d0cec101 100644 --- a/module/extension/lang/zh-cn.php +++ b/module/extension/lang/zh-cn.php @@ -46,6 +46,7 @@ $lang->extension->downloads = '下载量'; $lang->extension->compatible = '兼容性'; $lang->extension->grade = '评分'; $lang->extension->depends = '依赖'; +$lang->extension->expireDate = '到期日期'; $lang->extension->zentaoCompatible = '适用版本'; $lang->extension->installedTime = '安装时间'; diff --git a/module/extension/model.php b/module/extension/model.php index cc70c170ea..e1917e8b6e 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -886,4 +886,35 @@ class extensionModel extends model if($type != 'between') return !$result; return $result; } + + /** + * Get extension expire date. + * + * @param int $extension + * @access public + * @return void + */ + public function getExpireDate($extension) + { + $licencePath = $this->app->getConfigRoot() . 'license/'; + $today = date('Y-m-d'); + $expireDate = ''; + + $licenceOrderFile = $licencePath . 'order' . $extension->code . $extension->version . '.txt'; + if(file_exists($licenceOrderFile)) + { + $order = file_get_contents($licenceOrderFile); + $order = unserialize($order); + if($order->type != 'life') + { + $days = isset($order->days) ? $order->days : 0; + if($order->type == 'demo') $days = 31; + if($order->type == 'year') $days = 365; + $startDate = $order->paidDate != '0000-00-00 00:00:00' ? $order->paidDate : $order->createdDate; + if($days) $expireDate = date('Y-m-d', strtotime($startDate) + $days * 24 * 3600); + } + } + + return $expireDate; + } } diff --git a/module/extension/view/browse.html.php b/module/extension/view/browse.html.php index 33c0f4d316..2120e7145e 100644 --- a/module/extension/view/browse.html.php +++ b/module/extension/view/browse.html.php @@ -53,6 +53,8 @@ extension->version}: {$extension->version} "; echo "{$lang->extension->author}: {$extension->author} "; + $expireDate = $this->extension->getExpireDate($extension); + if(!empty($expireDate)) echo "{$lang->extension->expireDate}: {$expireDate}"; ?> From a259a3189143be1011e0fc9684ecf487560ccd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 10:32:29 +0800 Subject: [PATCH 24/50] * Add tips for create user. --- module/user/control.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/user/control.php b/module/user/control.php index cd96723199..6ed78a3d10 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -393,6 +393,10 @@ class user extends control if(!empty($_POST)) { + if(strtolower($_POST['account'] == 'guest')) + { + die(js::error(str_replace('ID', $this->lang->user->account, sprintf($this->lang->user->error->reserved, $_POST['account'])))); + } $this->user->create(); if(dao::isError()) die(js::error(dao::getError())); die(js::locate($this->createLink('company', 'browse'), 'parent')); From 4efc830f3175e1762aefa538b8602260a07f1fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 10:34:28 +0800 Subject: [PATCH 25/50] * Change tips. --- module/user/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/user/control.php b/module/user/control.php index 6ed78a3d10..8a50ef8419 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -395,7 +395,7 @@ class user extends control { if(strtolower($_POST['account'] == 'guest')) { - die(js::error(str_replace('ID', $this->lang->user->account, sprintf($this->lang->user->error->reserved, $_POST['account'])))); + die(js::error(str_replace('ID ', '', sprintf($this->lang->user->error->reserved, $_POST['account'])))); } $this->user->create(); if(dao::isError()) die(js::error(dao::getError())); From 5057abf5d8f020274ebc49ab9620c85996c99f83 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 11:16:03 +0800 Subject: [PATCH 26/50] * finish task #3427. --- module/project/model.php | 10 ++++++---- module/project/view/story.html.php | 16 +++++++++++++++- module/story/control.php | 5 ++++- module/story/model.php | 6 ++---- 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 74d6d665a0..23fa69b0c2 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1423,13 +1423,15 @@ class projectModel extends model * @access public * @return void */ - public function linkStory($projectID) + public function linkStory($projectID, $stories = array()) { - if($this->post->stories == false) return false; + if(empty($stories)) $stories = $this->post->stories; + if(empty($stories)) return false; + $this->loadModel('action'); - $versions = $this->loadModel('story')->getVersions($this->post->stories); + $versions = $this->loadModel('story')->getVersions($stories); $lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->orderBy('order_desc')->limit(1)->fetch('order'); - foreach($this->post->stories as $key => $storyID) + foreach($stories as $key => $storyID) { $productID = (int)$this->post->products[$storyID]; $data = new stdclass(); diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 7b67a0d011..6a218c1d7c 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -27,7 +27,21 @@ common::printIcon('story', 'export', "productID=$productID&orderBy=id_desc", '', 'button', '', '', 'export'); $this->lang->story->create = $this->lang->project->createStory; - if($productID and !$this->loadModel('story')->checkForceReview()) common::printIcon('story', 'create', "productID=$productID&branch=&moduleID=0&story=0&project=$project->id"); + if($productID and !$this->loadModel('story')->checkForceReview()) + { + echo "
    "; + common::printIcon('story', 'create', "productID=$productID&branch=0&moduleID=0&story=0&project=$project->id"); + + $misc = common::hasPriv('story', 'batchCreate') ? '' : "disabled"; + $link = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$productID&branch=0&moduleID=0&story=0&project=$project->id") : '#'; + echo "'; + echo "'; + echo '
    '; + } if(commonModel::isTutorialMode()) { diff --git a/module/story/control.php b/module/story/control.php index 7b699d8107..1d6ddbfa68 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -200,17 +200,20 @@ class story extends control * @access public * @return void */ - public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0) + public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $project = 0) { if(!empty($_POST)) { $mails = $this->story->batchCreate($productID, $branch); if(dao::isError()) die(js::error(dao::getError())); + $stories = array(); foreach($mails as $mail) { + $stories[] = $mail->storyID; if($mail->actionID) $this->story->sendmail($mail->storyID, $mail->actionID); } + if($project) $this->loadModel('project')->linkStory($project, $stories); /* If storyID not equal zero, subdivide this story to child stories and close it. */ if($storyID) diff --git a/module/story/model.php b/module/story/model.php index ad0c5d1cec..d529a6db62 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -261,10 +261,6 @@ class storyModel extends model for($i = 0; $i < $batchNum; $i++) { - if(!empty($stories->title[$i]) && empty($stories->modules[$i])) - { - die(js::alert(sprintf($this->lang->error->notempty, $this->lang->story->module))); - } $module = $stories->module[$i] == 'ditto' ? $module : $stories->module[$i]; $plan = $stories->plan[$i] == 'ditto' ? $plan : $stories->plan[$i]; $pri = $stories->pri[$i] == 'ditto' ? $pri : $stories->pri[$i]; @@ -273,6 +269,8 @@ class storyModel extends model $stories->plan[$i] = $plan; $stories->pri[$i] = (int)$pri; $stories->source[$i] = $source; + + if(!empty($stories->title[$i]) && empty($stories->module[$i])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->story->module))); } if(isset($stories->uploadImage)) $this->loadModel('file'); From b4517c994539cd275e168abed8248dbf97bce9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 11:17:15 +0800 Subject: [PATCH 27/50] * Fix bug --- module/user/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/user/control.php b/module/user/control.php index 8a50ef8419..2188c95621 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -393,7 +393,7 @@ class user extends control if(!empty($_POST)) { - if(strtolower($_POST['account'] == 'guest')) + if(strtolower($_POST['account']) == 'guest') { die(js::error(str_replace('ID ', '', sprintf($this->lang->user->error->reserved, $_POST['account'])))); } From 0f13899945a343741f2e4ded36454ed8737503f4 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 11:37:48 +0800 Subject: [PATCH 28/50] * code for task #3427. --- module/productplan/view/view.html.php | 10 ++++++++++ module/story/control.php | 4 ++-- module/story/view/batchcreate.html.php | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 2716b39533..14ba946701 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -30,7 +30,17 @@ { ob_start(); echo "
    "; + echo "
    "; common::printIcon('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=0&bugID=0&planID=$plan->id", $plan, 'button', 'plus'); + $misc = common::hasPriv('story', 'batchCreate') ? '' : "disabled"; + $link = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$plan->product&branch=$plan->branch&moduleID=0&story=0&project=0&plan={$plan->id}") : '#'; + echo "'; + echo "'; + echo '
    '; if(common::hasPriv('productplan', 'linkStory')) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkStory, '', "class='btn'"); if(common::hasPriv('productplan', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkBug, '', "class='btn'"); echo '
    '; diff --git a/module/story/control.php b/module/story/control.php index 1d6ddbfa68..282fa03761 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -200,7 +200,7 @@ class story extends control * @access public * @return void */ - public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $project = 0) + public function batchCreate($productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $project = 0, $plan = 0) { if(!empty($_POST)) { @@ -240,7 +240,7 @@ class story extends control $this->product->setMenu($products, $product->id, $branch); /* Init vars. */ - $planID = 0; + $planID = $plan; $pri = 0; $estimate = ''; $title = ''; diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php index 20df69c929..186532129f 100644 --- a/module/story/view/batchcreate.html.php +++ b/module/story/view/batchcreate.html.php @@ -56,7 +56,7 @@ if($this->story->checkForceReview()) unset($visibleFields['review']); $fileName):?> - + @@ -88,7 +88,7 @@ if($this->story->checkForceReview()) unset($visibleFields['review']); story->batchCreate; $i++):?> - + From a069ceb65496df52e0ed8797912128076a61b850 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 13:49:43 +0800 Subject: [PATCH 29/50] * change for task #3435. --- module/product/lang/zh-cn.php | 2 +- module/project/lang/zh-cn.php | 4 ++-- module/story/control.php | 3 +++ module/tutorial/lang/zh-cn.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 236ad7622f..0871c3fb3b 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -16,7 +16,7 @@ $lang->product->dynamic = "动态"; $lang->product->view = "{$lang->productCommon}概况"; $lang->product->edit = "编辑{$lang->productCommon}"; $lang->product->batchEdit = "批量编辑"; -$lang->product->create = "新增{$lang->productCommon}"; +$lang->product->create = "添加{$lang->productCommon}"; $lang->product->delete = "删除{$lang->productCommon}"; $lang->product->deleted = "已删除"; $lang->product->close = "关闭"; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index b8eb08ef9f..d2322a676a 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -42,7 +42,7 @@ $lang->project->progress = '进度'; $lang->project->hours = '预计 %s 消耗 %s 剩余 %s'; $lang->project->viewBug = '查看bug'; $lang->project->noProduct = "无{$lang->productCommon}{$lang->projectCommon}"; -$lang->project->createStory = "新增需求"; +$lang->project->createStory = "添加需求"; $lang->project->all = '所有'; $lang->project->undone = '未完成'; $lang->project->unclosed = '未关闭'; @@ -214,7 +214,7 @@ $lang->project->tips = '提示'; $lang->project->afterInfo = "{$lang->projectCommon}添加成功,您现在可以进行以下操作:"; $lang->project->setTeam = '设置团队'; $lang->project->linkStory = '关联需求'; -$lang->project->createTask = '添加任务'; +$lang->project->createTask = '创建任务'; $lang->project->goback = "返回任务列表"; $lang->project->noweekend = '去除周末'; $lang->project->withweekend = '显示周末'; diff --git a/module/story/control.php b/module/story/control.php index 282fa03761..6defe6006a 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -195,8 +195,11 @@ class story extends control * Create a batch stories. * * @param int $productID + * @param int $branch * @param int $moduleID * @param int $storyID + * @param int $project + * @param int $plan * @access public * @return void */ diff --git a/module/tutorial/lang/zh-cn.php b/module/tutorial/lang/zh-cn.php index d001e2396b..5db19acc34 100644 --- a/module/tutorial/lang/zh-cn.php +++ b/module/tutorial/lang/zh-cn.php @@ -39,7 +39,7 @@ $lang->tutorial->tasks['createAccount']['nav'] = array('module' => 'user', 'met $lang->tutorial->tasks['createAccount']['desc'] = "

    在系统创建一个新的用户帐号:

    • 打开 组织 用户 添加用户 页面;
    • 在添加用户表单中填写新用户信息;
    • 保存用户信息。
    "; $lang->tutorial->tasks['createProduct'] = array('title' => '创建产品'); -$lang->tutorial->tasks['createProduct']['nav'] = array('module' => 'product', 'method' => 'create', 'menu' => 'create', 'form' => '#dataform', 'submit' => '#submit', 'targetPageName' => '新增产品'); +$lang->tutorial->tasks['createProduct']['nav'] = array('module' => 'product', 'method' => 'create', 'menu' => 'create', 'form' => '#dataform', 'submit' => '#submit', 'targetPageName' => '添加产品'); $lang->tutorial->tasks['createProduct']['desc'] = "

    在系统创建一个新的产品:

    • 打开 产品 添加产品 页面;
    • 在表单中填写要创建的产品信息;
    • 保存产品信息。
    "; $lang->tutorial->tasks['createStory'] = array('title' => '创建需求'); From fc70d4ffdb17e3016c898dd557ef1e347dc22b66 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 14:06:47 +0800 Subject: [PATCH 30/50] * finish task #3491. --- module/bug/lang/en.php | 8 ++++---- module/bug/lang/zh-cn.php | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 2524661b50..8f983f6bb3 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -217,18 +217,18 @@ $lang->bug->browserList['other'] = 'Other'; $lang->bug->typeList[''] = ''; $lang->bug->typeList['codeerror'] = 'Code Error'; $lang->bug->typeList['interface'] = 'Interface Optimization'; -$lang->bug->typeList['designchange'] = 'Design Change'; -$lang->bug->typeList['newfeature'] = 'New Feature'; -$lang->bug->typeList['designdefect'] = 'Design Defect'; $lang->bug->typeList['config'] = 'Configuration'; $lang->bug->typeList['install'] = 'Install/Deploy'; $lang->bug->typeList['security'] = 'Security'; $lang->bug->typeList['performance'] = 'Performance'; $lang->bug->typeList['standard'] = 'Standard'; $lang->bug->typeList['automation'] = 'Testing Script'; -$lang->bug->typeList['trackthings'] = 'Issue Tracking'; $lang->bug->typeList['others'] = 'Other'; + + + + $lang->bug->statusList[''] = ''; $lang->bug->statusList['active'] = 'Active'; $lang->bug->statusList['resolved'] = 'Resolved'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index eb81221b4c..90b0fc7337 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -115,6 +115,7 @@ $lang->bug->byQuery = '搜索'; $lang->bug->needConfirm = '需求变动'; $lang->bug->allProduct = '所有' . $lang->productCommon; + $lang->bug->ditto = '同上'; $lang->bug->dittoNotice = '该bug与上一bug不属于同一产品!'; @@ -216,17 +217,17 @@ $lang->bug->browserList['other'] = '其他'; $lang->bug->typeList[''] = ''; $lang->bug->typeList['codeerror'] = '代码错误'; $lang->bug->typeList['interface'] = '界面优化'; -$lang->bug->typeList['designchange'] = '设计变更'; -$lang->bug->typeList['newfeature'] = '新增需求'; -$lang->bug->typeList['designdefect'] = '设计缺陷'; $lang->bug->typeList['config'] = '配置相关'; $lang->bug->typeList['install'] = '安装部署'; $lang->bug->typeList['security'] = '安全相关'; $lang->bug->typeList['performance'] = '性能问题'; $lang->bug->typeList['standard'] = '标准规范'; $lang->bug->typeList['automation'] = '测试脚本'; -$lang->bug->typeList['trackthings'] = '事务跟踪'; $lang->bug->typeList['others'] = '其他'; +$lang->bug->typeList['designchange'] = '设计变更'; +$lang->bug->typeList['newfeature'] = '新增需求'; +$lang->bug->typeList['designdefect'] = '设计缺陷'; +$lang->bug->typeList['trackthings'] = '事务跟踪'; $lang->bug->statusList[''] = ''; $lang->bug->statusList['active'] = '激活'; From 7770bab6afaa4788d76dd249e9ed2e41fa7191e5 Mon Sep 17 00:00:00 2001 From: dajiao007 Date: Thu, 14 Dec 2017 14:24:30 +0800 Subject: [PATCH 31/50] * fix the story of 3423 --- module/story/lang/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 8034df3b04..f572dabdef 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -73,7 +73,7 @@ $lang->story->lastEditedBy = 'Last Edited By'; $lang->story->lastEditedDate = 'Last Edited On'; $lang->story->closedBy = 'Closed By'; $lang->story->closedDate = 'Closed On'; -$lang->story->closedReason = 'Close Reason'; +$lang->story->closedReason = 'Reason'; $lang->story->rejectedReason = 'Reject Reason'; $lang->story->reviewedBy = 'Reviewer'; $lang->story->reviewedDate = 'Review on'; From 24366d4e549296a99746a86c0ff21314d1a69df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 15:12:05 +0800 Subject: [PATCH 32/50] * Fix Bug --- module/project/control.php | 8 ++++++-- module/project/view/task.html.php | 7 +++++++ module/project/view/taskheader.html.php | 2 ++ module/project/view/tips.html.php | 2 +- module/task/control.php | 13 +++++++++---- module/task/view/batchcreate.html.php | 2 +- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index cdfa144487..a48d5ff535 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -857,6 +857,9 @@ class project extends control /** * Create a project. * + * @param string $projectID + * @param string $copyProjectID + * * @access public * @return void */ @@ -1305,8 +1308,8 @@ class project extends control public function tree($projectID, $type = '') { $this->project->setMenu($this->projects, $projectID); - $project = $this->loadModel('project')->getById($projectID); - $tree = $this->project->getProjectTree($projectID); + $project = $this->loadModel('project')->getById($projectID); + $tree = $this->project->getProjectTree($projectID); /* Save to session. */ $uri = $this->app->getURI(true); @@ -1946,6 +1949,7 @@ class project extends control */ public function tips($projectID) { + $this->view->project = $this->project->getById($projectID); $this->view->projectID = $projectID; $this->display('project', 'tips'); } diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 1d3c87c8c1..05e2cec285 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -49,6 +49,13 @@ js::set('browseType', $browseType); if($useDatatable) include '../../common/view/datatable.html.php'; $customFields = $this->datatable->getSetting('project'); + if($project->type == 'ops') + { + foreach($customFields as $id => $customField) + { + if($customField->id == 'story') unset($customFields[$id]); + } + } $widths = $this->datatable->setFixedFieldWidth($customFields); $columns = 0; ?> diff --git a/module/project/view/taskheader.html.php b/module/project/view/taskheader.html.php index 214756f2ab..e6590fc19e 100644 --- a/module/project/view/taskheader.html.php +++ b/module/project/view/taskheader.html.php @@ -28,6 +28,7 @@ foreach(customModel::getFeatureMenu('project', 'task') as $menuItem) { + if($project->type == 'ops' && $menuItem->name == 'needconfirm') continue; if(isset($menuItem->hidden)) continue; $menuType = $menuItem->name; if(strpos($menuType, 'QUERY') === 0) @@ -73,6 +74,7 @@ foreach ($lang->project->groups as $key => $value) { if($key == '') continue; + if($project->type == 'ops' && $key == 'story') continue; echo ''; common::printLink('project', 'groupTask', "project=$projectID&groupBy=$key", $value); } diff --git a/module/project/view/tips.html.php b/module/project/view/tips.html.php index b932b2b231..93e982f658 100644 --- a/module/project/view/tips.html.php +++ b/module/project/view/tips.html.php @@ -2,7 +2,7 @@
    project->afterInfo;?>
    createLink('project', 'team', "projectID=$projectID"), $lang->project->setTeam, '', "class='btn'");?> - config->global->flow != 'onlyTask') echo html::a($this->createLink('project', 'linkstory', "projectID=$projectID"), $lang->project->linkStory, '', "class='btn'");?> + config->global->flow != 'onlyTask' && $project->type != 'ops') echo html::a($this->createLink('project', 'linkstory', "projectID=$projectID"), $lang->project->linkStory, '', "class='btn'");?> createLink('task', 'create', "project=$projectID"), $lang->project->createTask, '', "class='btn'");?> createLink('project', 'task', "projectID=$projectID"), $lang->project->goback, '', "class='btn'");?>
    diff --git a/module/task/control.php b/module/task/control.php index bc8da8d463..6efd176bda 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -152,6 +152,8 @@ class task extends control /* Set Custom*/ foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field; + if($project->type == 'ops') unset($customFields['story']); + $this->view->customFields = $customFields; $this->view->showFields = $this->config->task->custom->createFields; @@ -1172,14 +1174,17 @@ class task extends control */ public function export($projectID, $orderBy) { + $project = $this->project->getById($projectID); + $allExportFields = $this->config->task->exportFields; + if($project->type == 'ops') $allExportFields = str_replace(' story,', '', $allExportFields); + if($_POST) { $this->loadModel('file'); - $taskLang = $this->lang->task; - $taskConfig = $this->config->task; + $taskLang = $this->lang->task; /* Create field lists. */ - $fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $taskConfig->exportFields); + $fields = $this->post->exportFields ? $this->post->exportFields : explode(',', $allExportFields); foreach($fields as $key => $fieldName) { $fieldName = trim($fieldName); @@ -1286,7 +1291,7 @@ class task extends control $this->fetch('file', 'export2' . $this->post->fileType, $_POST); } - $this->view->allExportFields = $this->config->task->exportFields; + $this->view->allExportFields = $allExportFields; $this->view->customExport = true; $this->display(); } diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index a8c54b8ad4..da7d9e202f 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -16,7 +16,7 @@
    icons['task']);?> icons['batchCreate']);?> task->batchCreate;?> - story->zeroTask;?> + type != 'ops'):?>story->zeroTask;?>
    pasteText, "data-toggle='myModal'", 'btn btn-primary')?> From 11d80a5d93d299ba21cd287d5f8f9862bb70ed8e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 15:29:09 +0800 Subject: [PATCH 33/50] * finish task #3442. --- module/action/control.php | 17 +++++++++++++++++ module/action/lang/en.php | 1 + module/action/lang/zh-cn.php | 1 + module/bug/view/view.html.php | 2 +- module/common/model.php | 2 +- module/doc/view/view.html.php | 2 +- module/group/lang/resource.php | 3 +++ module/story/model.php | 2 +- module/story/view/view.html.php | 2 +- module/task/view/view.html.php | 2 +- module/testcase/view/view.html.php | 2 +- module/upgrade/model.php | 20 ++++++++++++++++++++ 12 files changed, 49 insertions(+), 7 deletions(-) diff --git a/module/action/control.php b/module/action/control.php index 4bfd85b965..5916f33db9 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -104,6 +104,23 @@ class action extends control } } + /** + * Comment. + * + * @param string $objectType + * @param int $objectID + * @access public + * @return void + */ + public function comment($objectType, $objectID) + { + $actionID = $this->action->create($objectType, $objectID, 'Commented', $this->post->comment); + + $moduleName = $objectType == 'case' ? 'testcase' : $objectType; + $this->loadModel($moduleName)->sendmail($objectID, $actionID); + die(js::reload('parent')); + } + /** * Edit comment of a action. * diff --git a/module/action/lang/en.php b/module/action/lang/en.php index c82640c395..34e6c6c784 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -25,6 +25,7 @@ $lang->action->undelete = 'Restore'; $lang->action->hideOne = 'Hide'; $lang->action->hideAll = 'Hide All'; $lang->action->editComment = 'Edit'; +$lang->action->comment = 'Comment'; $lang->action->trashTips = 'Note: Delete in ZenTao is logic.'; $lang->action->textDiff = 'Text Format'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index b03587b84c..7021b27d0d 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -25,6 +25,7 @@ $lang->action->undelete = '还原'; $lang->action->hideOne = '隐藏'; $lang->action->hideAll = '全部隐藏'; $lang->action->editComment = '修改备注'; +$lang->action->comment = '备注'; $lang->action->trashTips = '提示:为了保证系统的完整性,禅道系统的删除都是标记删除。'; $lang->action->textDiff = '文本格式'; diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 566e8e240b..1f26194dbf 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -89,7 +89,7 @@
    deleted) echo $actionLinks;?>
    comment;?> - id&comment=true")?>'> + id")?>' target='hiddenwin'>
    diff --git a/module/common/model.php b/module/common/model.php index abb20b1c12..6a1d892c9e 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -631,7 +631,7 @@ class commonModel extends model global $lang; - if(!commonModel::hasPriv($module, 'edit', $object)) return false; + if(!commonModel::hasPriv('action', 'comment', $object)) return false; echo html::a('#commentBox', '', '', "title='$lang->comment' onclick='setComment()' class='btn'"); } diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index 284c3dbecd..b584f29a10 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -126,7 +126,7 @@
    comment;?> -
    id&comment=true")?>'> + id")?>' target='hiddenwin'>
    diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index b075352107..437461f233 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1005,12 +1005,15 @@ $lang->resource->action->trash = 'trash'; $lang->resource->action->undelete = 'undelete'; $lang->resource->action->hideOne = 'hideOne'; $lang->resource->action->hideAll = 'hideAll'; +$lang->resource->action->comment = 'comment'; $lang->resource->action->editComment = 'editComment'; $lang->action->methodOrder[5] = 'trash'; $lang->action->methodOrder[10] = 'undelete'; $lang->action->methodOrder[15] = 'hideOne'; $lang->action->methodOrder[20] = 'hideAll'; +$lang->action->methodOrder[25] = 'comment'; +$lang->action->methodOrder[30] = 'editComment'; $lang->resource->backup = new stdclass(); $lang->resource->backup->index = 'index'; diff --git a/module/story/model.php b/module/story/model.php index d529a6db62..99373c4d66 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -479,7 +479,7 @@ class storyModel extends model ->join('mailto', ',') ->remove('linkStories,childStories,files,labels,comment') ->get(); - if(is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ','); + if(isset($story->plan) and is_array($story->plan)) $story->plan = trim(join(',', $story->plan), ','); if(empty($_POST['product'])) $story->branch = $oldStory->branch; $this->dao->update(TABLE_STORY) diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index fb1993a93d..14efabf849 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -116,7 +116,7 @@
    comment;?> -
    id")?>'> + id")?>' target='hiddenwin'>
    diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 6513264aab..50b935fa13 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -156,7 +156,7 @@
    deleted) echo $actionLinks;?>
    comment;?> -
    id&comment=true")?>'> + id")?>' target='hiddenwin'>
    diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 8dfc0b1984..a240f2f97d 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -119,7 +119,7 @@
    comment;?> -
    id&comment=true")?>'> + id")?>' target='hiddenwin'>
    diff --git a/module/upgrade/model.php b/module/upgrade/model.php index a5094c9664..a41e3331c2 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -1918,4 +1918,24 @@ class upgradeModel extends model return true; } + + /** + * Adjust Priv for 9.7 + * + * @access public + * @return bool + */ + public function adjustPriv9_7() + { + $groups = $this->dao->select('*')->from(TABLE_GROUPPRIV)->where('method')->eq('edit')->andWhere('module')->in('story,task,bug,testcase')->fetchPairs('group', 'group'); + foreach($groups as $groupID) + { + $groupPriv = new stdclass(); + $groupPriv->group = $groupID; + $groupPriv->module = 'action'; + $groupPriv->method = 'comment'; + $this->dao->replace(TABLE_GROUPPRIV)->data($groupPriv)->exec(); + } + return true; + } } From 831183be84dfd5184038d271526b7e2a2ebc78e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 15:32:37 +0800 Subject: [PATCH 34/50] * Task#3456 --- module/productplan/view/view.html.php | 43 ++++++++++++++++----------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 2716b39533..6fd3c50c3f 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -31,8 +31,14 @@ ob_start(); echo "
    "; common::printIcon('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=0&bugID=0&planID=$plan->id", $plan, 'button', 'plus'); - if(common::hasPriv('productplan', 'linkStory')) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkStory, '', "class='btn'"); - if(common::hasPriv('productplan', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkBug, '', "class='btn'"); + if(common::hasPriv('productplan', 'linkStory')) + { + echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkStory, '', "class='btn'"); + } + if(common::hasPriv('productplan', 'linkBug') and $config->global->flow != 'onlyStory') + { + echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkBug, '', "class='btn'"); + } echo '
    '; echo "
    "; common::printIcon('productplan', 'edit', "planID=$plan->id", $plan); @@ -60,6 +66,7 @@
    '> +
    id, \"story\")", ' ' . $lang->productplan->linkStory, '', "class='btn btn-sm btn-primary'");?>
    @@ -70,18 +77,21 @@ id}&type=story&orderBy=%s&link=$link¶m=$param"; ?> - idAB);?> - priAB);?> - - story->module);?> + idAB);?> + + productplan->updateOrder);?> - story->title);?> - openedByAB);?> - assignedToAB);?> - story->estimateAB);?> - statusAB);?> - story->stageAB);?> - actions?> + priAB);?> + + story->module);?> + + story->title);?> + openedByAB);?> + assignedToAB);?> + story->estimateAB);?> + statusAB);?> + story->stageAB);?> + actions?> @@ -102,10 +112,9 @@ id));?> + story->priList, $story->pri, $story->pri)?>'>story->priList, $story->pri, $story->pri);?> - - module)) echo $modulePairs[$story->module];?> - + module)) echo $modulePairs[$story->module];?> title);?> openedBy);?> assignedTo);?> @@ -126,7 +135,7 @@ - +
    From 583d24be0eacadb1f40f0cd6ebeb6cfd76e7ae21 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 16:36:16 +0800 Subject: [PATCH 35/50] * finish for task #3443. --- module/testcase/control.php | 6 ++---- module/testcase/model.php | 4 +++- module/testcase/view/view.html.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 457986003a..7dddc2cc14 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -1118,8 +1118,6 @@ class testcase extends control foreach($cases as $case) { - $case->title = htmlspecialchars_decode($case->title); - $relatedModuleIdList[$case->module] = $case->module; $relatedStoryIdList[$case->story] = $case->story; $relatedCaseIdList[$case->linkCase] = $case->linkCase; @@ -1162,8 +1160,8 @@ class testcase extends control } if($step->version != $case->version) continue; $sign = (in_array($this->post->fileType, array('html', 'xml'))) ? '
    ' : "\n"; - $case->stepDesc .= $stepId . ". " . htmlspecialchars_decode($step->desc) . $sign; - $case->stepExpect .= $stepId . ". " . htmlspecialchars_decode($step->expect) . $sign; + $case->stepDesc .= $stepId . ". " . $step->desc . $sign; + $case->stepExpect .= $stepId . ". " . $step->expect . $sign; $childId ++; } } diff --git a/module/testcase/model.php b/module/testcase/model.php index 41f9e6d163..a43dffa96c 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -541,13 +541,15 @@ class testcaseModel extends model else { /* Compare every step. */ + $i = 0; foreach($oldCase->steps as $key => $oldStep) { - if(trim($oldStep->desc) != trim($steps[$key]['desc']) or trim($oldStep->expect) != $steps[$key]['expect']) + if(trim($oldStep->desc) != trim($steps[$i]['desc']) or trim($oldStep->expect) != $steps[$i]['expect']) { $stepChanged = true; break; } + $i++; } } $version = $stepChanged ? $oldCase->version + 1 : $oldCase->version; diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index a240f2f97d..a0736b8f2b 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -119,7 +119,7 @@
    comment;?> -
    id")?>' target='hiddenwin'> + id")?>' target='hiddenwin'>
    From 04c5c50ccea41d5ac3e0a84f6f4e329219ad0aeb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 17:00:28 +0800 Subject: [PATCH 36/50] * fix bug. --- module/productplan/view/view.html.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 67b9247249..fa9370e780 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -32,12 +32,11 @@ echo "
    "; echo "
    "; common::printIcon('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=0&bugID=0&planID=$plan->id", $plan, 'button', 'plus'); - $misc = common::hasPriv('story', 'batchCreate') ? '' : "disabled"; - $link = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$plan->product&branch=$plan->branch&moduleID=0&story=0&project=0&plan={$plan->id}") : '#'; - a($link); - echo ""; + $batchMisc = common::hasPriv('story', 'batchCreate') ? '' : "disabled"; + $batchLink = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$plan->product&branch=$plan->branch&moduleID=0&story=0&project=0&plan={$plan->id}") : '#'; + echo ""; echo "'; echo '
    '; if(common::hasPriv('productplan', 'linkStory')) From 73fd2f057504f19b56506df69e49dccb10a93de5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 14 Dec 2017 17:11:13 +0800 Subject: [PATCH 37/50] * finish task #3457. --- bin/init.bat | 6 ++++- bin/init.sh | 6 ++++- bin/php/backup.php | 58 ---------------------------------------------- 3 files changed, 10 insertions(+), 60 deletions(-) delete mode 100755 bin/php/backup.php diff --git a/bin/init.bat b/bin/init.bat index 8643144b1e..04f534a605 100644 --- a/bin/init.bat +++ b/bin/init.bat @@ -39,7 +39,11 @@ echo %ztcli% > %baseDir%ztcli.bat echo ztcli.bat ok :: create backup.bat -SET backup= %phpcli% %baseDir%php\backup.php +if %requestType% == 'PATH_INFO' ( + SET backup= %phpcli% %baseDir%ztcli "%pmsRoot%/backup-backup.html" +)else ( + SET backup= %phpcli% %baseDir%ztcli "%pmsRoot%/index.php?m=backup&f=backup" +) echo %backup% > %baseDir%backup.bat echo backup.bat ok diff --git a/bin/init.sh b/bin/init.sh index 7dbf98b722..61fc4c5b47 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -42,7 +42,11 @@ echo $ztcli > $basePath/ztcli.sh echo "ztcli.sh ok" # backup database -backup="$phpcli $basePath/php/backup.php" +if [ $requestType == 'PATH_INFO' ]; then + backup="$phpcli $basePath/ztcli '$pmsRoot/backup-backup.html'"; +else + backup="$phpcli $basePath/ztcli '$pmsRoot/index.php?m=backup&f=backup'"; +fi echo $backup > $basePath/backup.sh echo "backup.sh ok" diff --git a/bin/php/backup.php b/bin/php/backup.php deleted file mode 100755 index 97f7d12e81..0000000000 --- a/bin/php/backup.php +++ /dev/null @@ -1,58 +0,0 @@ -db->host}; port={$config->db->port}; dbname={$config->db->name}"; -$dbh = new PDO($dsn, $config->db->user, $config->db->password, array(PDO::ATTR_PERSISTENT => $config->db->persistant)); -$dbh->exec("SET NAMES {$config->db->encoding}"); -echo "Backuping database,"; -$zdb = new zdb(); -$return = $zdb->dump($dbRawFile); -if($return->result) -{ - $dbZipFile = $destDir . "/" . str_replace("sql", "zip", $dbRawFile); - $archive = new pclzip($dbZipFile); - - if($archive->create($dbRawFile)) - { - unlink($dbRawFile); - echo " successfully saved to $dbZipFile\n"; - } - else - { - die("Error : " . $archive->errorInfo(true)); - } -} -else -{ - echo "Failed to backup database!\n"; -} - -/* Backup the attachments. */ -chdir(dirname(dirname(dirname(__FILE__))) . "/www"); -if(!is_dir('data/upload')) die(" No files needed backup.\n"); - -echo "Backuping files,"; -$attachFile = $destDir . "/" . "file." . date('Ymd', time()) . ".zip"; -$archive = new pclzip($attachFile); -if($archive->create("data/upload", PCLZIP_OPT_REMOVE_PATH, "data")) die(" successfully saved to $attachFile\n"); -die("Error : ".$archive->errorInfo(true)); From 073ff8fdb4c893a2279de58f5e05a713f8f6b3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Thu, 14 Dec 2017 18:27:26 +0800 Subject: [PATCH 38/50] * Format code --- module/bug/control.php | 152 ++++++++++++++++----------------- module/productplan/control.php | 94 ++++++++++++-------- 2 files changed, 135 insertions(+), 111 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 428b3c4b45..ad93f9e2a3 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -15,7 +15,7 @@ class bug extends control /** * Construct function, load some modules auto. - * + * * @access public * @return void */ @@ -43,7 +43,7 @@ class bug extends control /** * The index page, locate to browse. - * + * * @access public * @return void */ @@ -54,15 +54,15 @@ class bug extends control /** * Browse bugs. - * - * @param int $productID + * + * @param int $productID * @param string $branch - * @param string $browseType - * @param int $param - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * @param string $browseType + * @param int $param + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ @@ -171,11 +171,11 @@ class bug extends control /** * The report page. - * - * @param int $productID - * @param string $browseType + * + * @param int $productID + * @param string $browseType * @param int $branchID - * @param int $moduleID + * @param int $moduleID * @access public * @return void */ @@ -211,8 +211,8 @@ class bug extends control /** * Create a bug. - * - * @param int $productID + * + * @param int $productID * @param string $extras others params, forexample, projectID=10,moduleID=10 * @access public * @return void @@ -375,11 +375,11 @@ class bug extends control } /** - * Batch create. - * - * @param int $productID - * @param int $projectID - * @param int $moduleID + * Batch create. + * + * @param int $productID + * @param int $projectID + * @param int $moduleID * @access public * @return void */ @@ -456,8 +456,8 @@ class bug extends control /** * View a bug. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ @@ -484,7 +484,7 @@ class bug extends control /* Get product info. */ $productID = $bug->product; $productName = $this->products[$productID]; - + /* Header and positon. */ $this->view->title = "BUG #$bug->id $bug->title - " . $this->products[$productID]; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName); @@ -506,8 +506,8 @@ class bug extends control /** * Edit a bug. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ @@ -628,11 +628,11 @@ class bug extends control $this->bug->sendmail($bugID, $actionID); $bug = $this->bug->getById($bugID); - if($bug->toTask != 0) + if($bug->toTask != 0) { foreach($changes as $change) { - if($change['field'] == 'status') + if($change['field'] == 'status') { $confirmURL = $this->createLink('task', 'view', "taskID=$bug->toTask"); $cancelURL = $this->server->HTTP_REFERER; @@ -730,7 +730,7 @@ class bug extends control } /** - * Update assign of bug. + * Update assign of bug. * * @param int $bugID * @access public @@ -768,8 +768,8 @@ class bug extends control /** * Batch change branch. - * - * @param int $branchID + * + * @param int $branchID * @access public * @return void */ @@ -823,9 +823,9 @@ class bug extends control } /** - * Batch update assign of bug. - * - * @param int $projectID + * Batch update assign of bug. + * + * @param int $projectID * @access public * @return void */ @@ -854,8 +854,8 @@ class bug extends control /** * confirm a bug. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ @@ -887,8 +887,8 @@ class bug extends control } /** - * Batch confirm bugs. - * + * Batch confirm bugs. + * * @access public * @return void */ @@ -906,11 +906,11 @@ class bug extends control $this->loadModel('score')->create('ajax', 'batchOther'); die(js::locate($this->session->bugList, 'parent')); } - + /** * Resolve a bug. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ @@ -927,7 +927,7 @@ class bug extends control $this->bug->sendmail($bugID, $actionID); $bug = $this->bug->getById($bugID); - if($bug->toTask != 0) + if($bug->toTask != 0) { /* If task is not finished, update it's status. */ $task = $this->task->getById($bug->toTask); @@ -938,7 +938,7 @@ class bug extends control $cancelURL = $this->createLink('bug', 'view', "bugID=$bugID"); die(js::confirm(sprintf($this->lang->bug->remindTask, $bug->toTask), $confirmURL, $cancelURL, 'parent', 'parent.parent')); } - } + } if(isonlybody()) die(js::closeModal('parent.parent')); die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } @@ -967,9 +967,9 @@ class bug extends control /** * Batch resolve bugs. - * - * @param string $resolution - * @param string $resolvedBuild + * + * @param string $resolution + * @param string $resolvedBuild * @access public * @return void */ @@ -1026,8 +1026,8 @@ class bug extends control /** * Close a bug. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ @@ -1144,8 +1144,8 @@ class bug extends control } /** - * Batch close bugs. - * + * Batch close bugs. + * * @access public * @return void */ @@ -1256,7 +1256,7 @@ class bug extends control /** * Save current template. - * + * * @access public * @return string */ @@ -1269,7 +1269,7 @@ class bug extends control /** * Build the user templates selection code. - * + * * @access public * @return void */ @@ -1281,8 +1281,8 @@ class bug extends control /** * Delete a user template. - * - * @param int $templateID + * + * @param int $templateID * @access public * @return void */ @@ -1294,8 +1294,8 @@ class bug extends control /** * AJAX: get bugs of a user in html select. - * - * @param string $account + * + * @param string $account * @param string $id the id of the select control. * @access public * @return string @@ -1311,9 +1311,9 @@ class bug extends control /** * AJAX: Get bug owner of a module. - * - * @param int $moduleID - * @param int $productID + * + * @param int $moduleID + * @param int $productID * @access public * @return string */ @@ -1325,32 +1325,32 @@ class bug extends control /** * AJAX: get team members of the project as assignedTo list. - * - * @param int $projectID - * @param string $selectedUser + * + * @param int $projectID + * @param string $selectedUser * @access public * @return string */ public function ajaxLoadAssignedTo($projectID, $selectedUser = '') { $projectMembers = $this->loadModel('project')->getTeamMemberPairs($projectID); - + die(html::select('assignedTo', $projectMembers, $selectedUser, 'class="form-control"')); } /** * AJAX: get team members of the latest project of a product as assignedTo list. - * - * @param int $productID + * + * @param int $productID * x - * @param string $selectedUser + * @param string $selectedUser * @access public * @return string */ public function ajaxLoadProjectTeamMembers($productID, $selectedUser = '') { $latestProject = $this->product->getLatestProject($productID); - if(!empty($latestProject)) + if(!empty($latestProject)) { $projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted'); } @@ -1377,9 +1377,9 @@ class bug extends control } /** - * AJAX: get actions of a bug. for web app. - * - * @param int $bugID + * AJAX: get actions of a bug. for web app. + * + * @param int $bugID * @access public * @return void */ @@ -1390,10 +1390,10 @@ class bug extends control } /** - * Get data to export - * - * @param string $productID - * @param string $orderBy + * Get data to export + * + * @param string $productID + * @param string $orderBy * @access public * @return void */ @@ -1581,8 +1581,8 @@ class bug extends control /** * Ajax get bug by ID. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ diff --git a/module/productplan/control.php b/module/productplan/control.php index 638860fbce..48d00493ea 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -13,8 +13,10 @@ class productplan extends control { /** * Common actions - * - * @param int $productID + * + * @param int $productID + * @param int $branch + * * @access public * @return void */ @@ -33,8 +35,10 @@ class productplan extends control /** * Create a plan. - * - * @param int $product + * + * @param string $product + * @param int $branch + * * @access public * @return void */ @@ -70,8 +74,9 @@ class productplan extends control /** * Edit a plan. - * - * @param int $planID + * + * @param int $planID + * * @access public * @return void */ @@ -99,8 +104,10 @@ class productplan extends control /** * Batch edit plan. - * - * @param int $productID + * + * @param int $productID + * @param int $branch + * * @access public * @return void */ @@ -130,11 +137,11 @@ class productplan extends control } die(js::locate('back')); } - + /** * Delete a plan. - * - * @param int $planID + * + * @param int $planID * @param string $confirm yes|no * @access public * @return void @@ -171,11 +178,12 @@ class productplan extends control /** * Browse plans. - * - * @param int $product - * @param string $orderBy + * + * @param int $productID + * @param int $branch + * @param string $orderBy * @param string $browseType - * @param int $recTotal + * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public @@ -209,6 +217,9 @@ class productplan extends control * @param int $planID * @param string $type * @param string $orderBy + * @param string $link + * @param string $param + * * @access public * @return void */ @@ -248,10 +259,12 @@ class productplan extends control } /** - * Ajax: Get product plans. - * - * @param int $productID + * Ajax: Get product plans. + * + * @param int $productID + * @param int $branch * @param string $number + * * @access public * @return void */ @@ -267,7 +280,11 @@ class productplan extends control /** * Link stories. * - * @param int $planID + * @param int $planID + * @param string $browseType + * @param int $param + * @param string $orderBy + * * @access public * @return void */ @@ -340,9 +357,10 @@ class productplan extends control } /** - * Unlink story - * - * @param int $storyID + * Unlink story + * + * @param int $storyID + * @param int $planID * @param string $confirm yes|no * @access public * @return void @@ -377,9 +395,11 @@ class productplan extends control } /** - * Batch unlink story. - * - * @param string $confirm + * Batch unlink story. + * + * @param int $planID + * @param string $orderBy + * * @access public * @return void */ @@ -391,10 +411,12 @@ class productplan extends control /** * Link bugs. - * - * @param int $planID - * @param string $browseType - * @param int $param + * + * @param int $planID + * @param string $browseType + * @param int $param + * @param string $orderBy + * * @access public * @return void */ @@ -469,9 +491,9 @@ class productplan extends control } /** - * Unlink story - * - * @param int $bugID + * Unlink story + * + * @param int $bugID * @param string $confirm yes|no * @access public * @return void @@ -506,9 +528,11 @@ class productplan extends control } /** - * Batch unlink story. - * - * @param string $confirm + * Batch unlink story. + * + * @param $planID + * @param string $orderBy + * * @access public * @return void */ From f35ef39f896dbe5de8341735c6c8d9242f80c25f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Dec 2017 10:09:42 +0800 Subject: [PATCH 39/50] * finish task #3449. --- module/build/control.php | 13 ++- module/build/css/view.css | 3 + module/build/view/linkbug.html.php | 4 + module/build/view/linkstory.html.php | 4 + module/build/view/view.html.php | 159 ++++++++++++++------------- 5 files changed, 103 insertions(+), 80 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 6fe1f9d488..21a79b3d9d 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -174,7 +174,7 @@ class build extends control * @access public * @return void */ - public function view($buildID, $type = 'story', $link = 'false', $param = '') + public function view($buildID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc') { if($type == 'story')$this->session->set('storyList', $this->app->getURI(true)); if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true)); @@ -189,7 +189,9 @@ class build extends control $product = $this->loadModel('product')->getById($build->product); if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->andWhere('deleted')->eq(0)->fetchAll(); + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->andWhere('deleted')->eq(0) + ->beginIF($type == 'bug')->orderBy($orderBy)->fi() + ->fetchAll(); if($this->config->global->flow == 'onlyTest') { @@ -203,7 +205,9 @@ class build extends control } else { - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0)->fetchAll('id'); + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0) + ->beginIF($type == 'story')->orderBy($orderBy)->fi() + ->fetchAll('id'); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; @@ -214,7 +218,7 @@ class build extends control $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]); $this->view->position[] = $this->lang->build->view; $this->view->stories = $stories; - $this->view->generatedBugs = $this->bug->getProjectBugs($build->project, $build->id, '', 0, 'status_desc,id_desc', null); + $this->view->generatedBugs = $this->bug->getProjectBugs($build->project, $build->id, '', 0, $type == 'newbug' ? $orderBy : 'status_desc,id_desc', null); $this->view->bugs = $bugs; $this->view->type = $type; } @@ -225,6 +229,7 @@ class build extends control $this->view->actions = $this->loadModel('action')->getList('build', $buildID); $this->view->link = $link; $this->view->param = $param; + $this->view->orderBy = $orderBy; $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); $this->display(); } diff --git a/module/build/css/view.css b/module/build/css/view.css index 95edbdd747..7d36be4c67 100644 --- a/module/build/css/view.css +++ b/module/build/css/view.css @@ -10,5 +10,8 @@ .table-actions {padding-left: 5px;} +#buildInfo {border-top: 1px solid #ddd;} +#buildInfo > div {padding-top: 15px;} + #querybox form {margin: 0px !important;} #moreOrLite {right: 0px !important;} diff --git a/module/build/view/linkbug.html.php b/module/build/view/linkbug.html.php index a4ebfc4e74..299881388e 100644 --- a/module/build/view/linkbug.html.php +++ b/module/build/view/linkbug.html.php @@ -10,6 +10,10 @@ * @link http://www.zentao.net */ ?> +app->getWebRoot() . "js/"; +include '../../common/view/tablesorter.html.php'; +?>
    id}&browseType=$browseType¶m=$param");?>'> diff --git a/module/build/view/linkstory.html.php b/module/build/view/linkstory.html.php index c32cbc64c6..e62a058945 100644 --- a/module/build/view/linkstory.html.php +++ b/module/build/view/linkstory.html.php @@ -10,6 +10,10 @@ * @link http://www.zentao.net */ ?> +app->getWebRoot() . "js/"; +include '../../common/view/tablesorter.html.php'; +?>
    id}&browseType=$browseType¶m=$param");?>'> diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 469bec757f..43488d4f67 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -79,9 +79,10 @@ tfoot tr td .table-actions .btn{display:none;}
    ' id='stories'> @@ -91,16 +92,17 @@ tfoot tr td .table-actions .btn{display:none;} id}")?>' id='linkedStoriesForm'> + id}&type=story&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + @@ -150,16 +152,17 @@ tfoot tr td .table-actions .btn{display:none;} id");?>" id='linkedBugsForm'>
    idAB;?>priAB;?>story->title;?>openedByAB;?>story->estimateAB;?>statusAB;?>story->stageAB;?>actions;?> idAB);?> priAB);?> story->title);?> openedByAB);?> story->estimateAB);?> statusAB);?>story->stageAB);?> actions?>
    + id}&type=bug&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + @@ -203,16 +206,18 @@ tfoot tr td .table-actions .btn{display:none;}
    ' id='newBugs'>
    idAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?>actions;?> idAB);?> bug->title);?>bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?>bug->resolvedDateAB);?> actions?>
    + id}&type=newbug&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + + @@ -239,60 +244,62 @@ tfoot tr td .table-actions .btn{display:none;}
    idAB;?>bug->severityAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?> idAB);?>bug->severityAB);?> bug->title);?> bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> bug->resolvedDateAB);?>actions?>
    +
    ' id='buildInfo'> +
    +
    +
    + build->basicInfo?> + + + + + + productType != 'normal'):?> + + + + + + + + + + + + + + + + + + + + + + + + + + config->global->flow != 'onlyTest'):?> + + + + + +
    build->product;?>productName;?>
    product->branch;?>
    build->name;?>name;?>
    build->builder;?>builder];?>
    build->date;?>date;?>
    build->scmPath;?>scmPath, $build->scmPath, '_blank')?>
    build->filePath;?>filePath, $build->filePath, '_blank');?>
    build->desc;?>
    desc;?>
    +
    + config->global->flow != 'onlyTest'):?> + fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?> + +
    +
    +
    +
    -
    -
    - config->global->flow != 'onlyTest'):?> -
    - build->desc;?> -
    desc;?>
    -
    - -
    - build->basicInfo?> - - - - - - productType != 'normal'):?> - - - - - - - - - - - - - - - - - - - - - - - - - -
    build->product;?>productName;?>
    product->branch;?>
    build->name;?>name;?>
    build->builder;?>builder];?>
    build->date;?>date;?>
    build->scmPath;?>scmPath, $build->scmPath, '_blank')?>
    build->filePath;?>filePath, $build->filePath, '_blank');?>
    -
    - config->global->flow != 'onlyTest'):?> - fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?> - - -
    -
    config->global->flow != 'onlyTest'):?> From 3ab22b4ac0163b354d445dbbac4a326cedd6094e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Dec 2017 10:35:49 +0800 Subject: [PATCH 40/50] * finish task #3449. --- module/build/view/view.html.php | 50 +++++++++++++------------- module/release/control.php | 15 +++++--- module/release/view/linkbug.html.php | 4 +++ module/release/view/linkstory.html.php | 4 +++ module/release/view/view.html.php | 49 +++++++++++++------------ 5 files changed, 70 insertions(+), 52 deletions(-) diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 43488d4f67..06bca9ff92 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -95,14 +95,14 @@ tfoot tr td .table-actions .btn{display:none;} id}&type=story&link=$link¶m=$param&orderBy=%s";?> - idAB);?> - priAB);?> - story->title);?> - openedByAB);?> - story->estimateAB);?> - statusAB);?> - story->stageAB);?> - actions?> + idAB);?> + priAB);?> + story->title);?> + openedByAB);?> + story->estimateAB);?> + statusAB);?> + story->stageAB);?> + actions?> @@ -155,14 +155,14 @@ tfoot tr td .table-actions .btn{display:none;} id}&type=bug&link=$link¶m=$param&orderBy=%s";?> - idAB);?> - bug->title);?> - bug->status);?> - openedByAB);?> - bug->openedDateAB);?> - bug->resolvedByAB);?> - bug->resolvedDateAB);?> - actions?> + idAB);?> + bug->title);?> + bug->status);?> + openedByAB);?> + bug->openedDateAB);?> + bug->resolvedByAB);?> + bug->resolvedDateAB);?> + actions?> @@ -209,15 +209,15 @@ tfoot tr td .table-actions .btn{display:none;} id}&type=newbug&link=$link¶m=$param&orderBy=%s";?> - idAB);?> - bug->severityAB);?> - bug->title);?> - bug->status);?> - openedByAB);?> - bug->openedDateAB);?> - bug->resolvedByAB);?> - bug->resolvedDateAB);?> - actions?> + idAB);?> + bug->severityAB);?> + bug->title);?> + bug->status);?> + openedByAB);?> + bug->openedDateAB);?> + bug->resolvedByAB);?> + bug->resolvedDateAB);?> + actions?> diff --git a/module/release/control.php b/module/release/control.php index 01a11c5f2e..9a8f99c152 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -126,7 +126,7 @@ class release extends control * @access public * @return void */ - public function view($releaseID, $type = 'story', $link = 'false', $param = '') + public function view($releaseID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc') { if($type == 'story') $this->session->set('storyList', $this->app->getURI(true)); if($type == 'bug' or $type == 'leftBug') $this->session->set('bugList', $this->app->getURI(true)); @@ -137,15 +137,21 @@ class release extends control $release = $this->release->getById((int)$releaseID, true); if(!$release) die(js::error($this->lang->notFound) . js::locate('back')); - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0)->fetchAll('id'); + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0) + ->beginIF($type == 'story')->orderBy($orderBy)->fi() + ->fetchAll('id'); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($release->stories)->andWhere('branch')->eq($release->branch)->fetchPairs('story', 'stage'); foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($release->bugs)->andWhere('deleted')->eq(0)->fetchAll(); + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($release->bugs)->andWhere('deleted')->eq(0) + ->beginIF($type == 'bug')->orderBy($orderBy)->fi() + ->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'linkedBug'); - $leftBugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($release->leftBugs)->andWhere('deleted')->eq(0)->fetchAll(); + $leftBugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($release->leftBugs)->andWhere('deleted')->eq(0) + ->beginIF($type == 'leftBug')->orderBy($orderBy)->fi() + ->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'leftBugs'); $this->commonAction($release->product); @@ -162,6 +168,7 @@ class release extends control $this->view->type = $type; $this->view->link = $link; $this->view->param = $param; + $this->view->orderBy = $orderBy; $this->view->branchName = $release->productType == 'normal' ? '' : $this->loadModel('branch')->getById($release->branch); $this->display(); } diff --git a/module/release/view/linkbug.html.php b/module/release/view/linkbug.html.php index cf1b6467d4..908e02aeb4 100644 --- a/module/release/view/linkbug.html.php +++ b/module/release/view/linkbug.html.php @@ -10,6 +10,10 @@ * @link http://www.zentao.net */ ?> +app->getWebRoot() . "js/"; +include '../../common/view/tablesorter.html.php'; +?>
    bugs : $release->leftBugs; diff --git a/module/release/view/linkstory.html.php b/module/release/view/linkstory.html.php index 38b8c7414e..bcd02262a1 100644 --- a/module/release/view/linkstory.html.php +++ b/module/release/view/linkstory.html.php @@ -10,6 +10,10 @@ * @link http://www.zentao.net */ ?> +app->getWebRoot() . "js/"; +include '../../common/view/tablesorter.html.php'; +?>
    id&browseType=$browseType¶m=$param")?>'> diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 6f6f310b46..618d9bc8a2 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -82,16 +82,17 @@ id");?>" id='linkedStoriesForm'> + id}&type=story&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + @@ -141,16 +142,17 @@ id");?>" id='linkedBugsForm'>
    idAB;?>priAB;?>story->title;?>openedByAB;?>story->estimateAB;?>statusAB;?>story->stageAB;?>actions;?> idAB);?> priAB);?>story->title);?> openedByAB);?> story->estimateAB);?> statusAB);?> story->stageAB);?> actions?>
    + id}&type=bug&link=$link¶m=$param&orderBy=%s";?> - - - - - - - - + + + + + + + + @@ -200,15 +202,16 @@ id&type=leftBug");?>" id='linkedBugsForm'>
    idAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>bug->resolvedByAB;?>bug->resolvedDateAB;?>actions;?> idAB);?>bug->title);?> bug->status);?> openedByAB);?> bug->openedDateAB);?> bug->resolvedByAB);?> bug->resolvedDateAB);?> actions;?>
    + id}&type=leftBug&link=$link¶m=$param&orderBy=%s";?> - - - - - - - + + + + + + + From fce5340d368dec629e8f1c16c7d19257d3b401b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Fri, 15 Dec 2017 11:06:01 +0800 Subject: [PATCH 41/50] * Task #3465 --- module/productplan/control.php | 44 ++- module/productplan/js/view.js | 17 +- module/productplan/view/view.html.php | 12 +- module/story/model.php | 368 +++++++++++++------------- 4 files changed, 249 insertions(+), 192 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 48d00493ea..2a820a8806 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -228,13 +228,39 @@ class productplan extends control $this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story'); $this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug'); + $reSort = false; + if($type == 'story' && strpos($orderBy, 'order') !== false) + { + $orderBy = str_replace('order', 'id', $orderBy); + $reSort = true; + } + /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); $plan = $this->productplan->getByID($planID, true); if(!$plan) die(js::error($this->lang->notFound) . js::locate('back')); $this->commonAction($plan->product, $plan->branch); - $products = $this->product->getPairs(); + $products = $this->product->getPairs(); + + $planStories = $this->loadModel('story')->getPlanStories($planID, 'all', $type == 'story' ? $sort : 'id_desc'); + if($reSort) + { + if(!empty($plan->order)) + { + $stories = array(); + $order = explode(',', $plan->order); + if(strpos($orderBy, 'asc') !== false) $order = array_reverse($order, true); + foreach($order as $id) + { + if(empty($id)) continue; + $stories[$id] = $planStories[$id]; + } + $planStories = $stories; + unset($stories); + } + $orderBy = str_replace('id', 'order', $orderBy); + } $this->loadModel('datatable'); $showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : ''; @@ -242,7 +268,7 @@ class productplan extends control $this->view->title = "PLAN #$plan->id $plan->title/" . $products[$plan->product]; $this->view->position[] = $this->lang->productplan->view; - $this->view->planStories = $this->loadModel('story')->getPlanStories($planID, 'all', $type == 'story' ? $sort : 'id_desc'); + $this->view->planStories = $planStories; $this->view->planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all', $type == 'bug' ? $sort : 'id_desc'); $this->view->products = $products; $this->view->summary = $this->product->summary($this->view->planStories); @@ -277,6 +303,20 @@ class productplan extends control die(html::select($planName, $plans, '', "class='form-control'")); } + /** + * Sort story for productplan. + * + * @param int $planID + * + * @access public + * @return bool + */ + public function ajaxStorySort($planID = 0) + { + if(empty($planID)) return true; + $this->dao->update(TABLE_PRODUCTPLAN)->set('`order`')->eq($this->post->storys)->where('id')->eq((int)$planID)->exec(); + } + /** * Link stories. * diff --git a/module/productplan/js/view.js b/module/productplan/js/view.js index c95692ba4f..5222235cbc 100644 --- a/module/productplan/js/view.js +++ b/module/productplan/js/view.js @@ -41,4 +41,19 @@ $(function() $option.toggleClass('hide', $option.text().toString().toLowerCase().indexOf(val) < 0 && $option.data('key').toString().toLowerCase().indexOf(val) < 0); }); }); -}) + + $('#storyList').on('sort.sortable', function(e, data) + { + var list = ''; + for(i = 0; i < data.list.length; i++) list += $(data.list[i]).attr('data-id') + ','; + console.log(list); + $.post(createLink('productplan', 'ajaxStorySort', 'planID=' + planID), {'storys' : list, 'orderBy' : orderBy}, function() + { + var $target = $(data.element[0]); + $target.hide(); + $target.fadeIn(1000); + order = 'order_asc'; + history.pushState({}, 0, createLink('productplan', 'view', "planID=" + planID + '&type=story&orderBy=' + order)); + }); + }); +}); diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index fa9370e780..59422c92de 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -11,8 +11,10 @@ */ ?> + productplan->confirmUnlinkStory)?> productplan->confirmUnlinkBug)?> +id);?>
    icons['plan']);?> id;?> @@ -102,7 +104,7 @@
    - + createLink('story', 'view', "storyID=$story->id"); $totalEstimate += $story->estimate; ?> - + @@ -349,7 +351,7 @@ @@ -374,7 +376,7 @@
    idAB;?>bug->severityAB;?>bug->title;?>bug->status;?>openedByAB;?>bug->openedDateAB;?>actions;?> idAB);?>bug->severityAB);?> bug->title);?> bug->status);?> openedByAB);?> bug->openedDateAB);?> actions;?>
    actions?>
    - + id));?>
    - + createLink('bug', 'view', "bugID=$bug->id"), sprintf("%03d", $bug->id));?>
    - verify = $story->verify; $this->dao->insert(TABLE_STORYSPEC)->data($data)->exec(); - if($projectID != 0 and $story->status != 'draft') + if($projectID != 0 and $story->status != 'draft') { $lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->orderBy('order_desc')->limit(1)->fetch('order'); $this->dao->insert(TABLE_PROJECTSTORY) @@ -209,7 +209,7 @@ class storyModel extends model $bug->assignedTo = 'closed'; $bug->assignedDate = $now; $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); - + $this->loadModel('action')->create('bug', $bugID, 'ToStory', '', $storyID); $this->action->create('bug', $bugID, 'Closed'); @@ -218,13 +218,13 @@ class storyModel extends model ->where('objectType')->eq('bug') ->andWhere('objectID')->eq($bugID) ->fetchAll(); - if(!empty($files)) - { + if(!empty($files)) + { foreach($files as $file) { $file->objectType = 'story'; - $file->objectID = $storyID; - unset($file->id); + $file->objectID = $storyID; + unset($file->id); $this->dao->insert(TABLE_FILE)->data($file)->exec(); } } @@ -238,7 +238,7 @@ class storyModel extends model /** * Create a batch stories. - * + * * @access public * @return int|bool the id of the created story or false when error. */ @@ -299,7 +299,7 @@ class storyModel extends model $this->dao->insert(TABLE_STORY)->data($data)->autoCheck() ->batchCheck($this->config->story->create->requiredFields, 'notempty') ->exec(); - if(dao::isError()) + if(dao::isError()) { echo js::error(dao::getError()); die(js::reload('parent')); @@ -327,8 +327,8 @@ class storyModel extends model if(rename($realPath, $this->file->savePath . $this->file->getSaveName($file['pathname']))) { - $file['addedBy'] = $this->app->user->account; - $file['addedDate'] = $now; + $file['addedBy'] = $this->app->user->account; + $file['addedDate'] = $now; $file['objectType'] = 'story'; $file['objectID'] = $storyID; if(in_array($file['extension'], $this->config->file->imageExtensions)) @@ -359,7 +359,7 @@ class storyModel extends model /* Remove upload image file and session. */ if(!empty($stories->uploadImage) and $this->session->storyImagesFile) { - $classFile = $this->app->loadClass('zfile'); + $classFile = $this->app->loadClass('zfile'); $file = current($_SESSION['storyImagesFile']); $realPath = dirname($file['realpath']); if(is_dir($realPath)) $classFile->removeDir($realPath); @@ -371,8 +371,8 @@ class storyModel extends model /** * Change a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return array the change of the story. */ @@ -447,8 +447,8 @@ class storyModel extends model /** * Update a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return array the changes of the story. */ @@ -513,7 +513,7 @@ class storyModel extends model /** * Batch update stories. - * + * * @access public * @return array. */ @@ -539,9 +539,9 @@ class storyModel extends model if($data->modules[$storyID] == 'ditto') $data->modules[$storyID] = isset($prev['module']) ? $prev['module'] : 0; if($data->plans[$storyID] == 'ditto') $data->plans[$storyID] = isset($prev['plan']) ? $prev['plan'] : 0; if($data->sources[$storyID] == 'ditto') $data->sources[$storyID] = isset($prev['source']) ? $prev['source'] : ''; - if(isset($data->stages[$storyID]) and ($data->stages[$storyID] == 'ditto')) $data->stages[$storyID] = isset($prev['stage']) ? $prev['stage'] : ''; - if(isset($data->closedBys[$storyID]) and ($data->closedBys[$storyID] == 'ditto')) $data->closedBys[$storyID] = isset($prev['closedBy']) ? $prev['closedBy'] : ''; - if(isset($data->closedReasons[$storyID]) and ($data->closedReasons[$storyID] == 'ditto')) $data->closedReasons[$storyID] = isset($prev['closedReason']) ? $prev['closedReason'] : ''; + if(isset($data->stages[$storyID]) and ($data->stages[$storyID] == 'ditto')) $data->stages[$storyID] = isset($prev['stage']) ? $prev['stage'] : ''; + if(isset($data->closedBys[$storyID]) and ($data->closedBys[$storyID] == 'ditto')) $data->closedBys[$storyID] = isset($prev['closedBy']) ? $prev['closedBy'] : ''; + if(isset($data->closedReasons[$storyID]) and ($data->closedReasons[$storyID] == 'ditto')) $data->closedReasons[$storyID] = isset($prev['closedReason']) ? $prev['closedReason'] : ''; $prev['pri'] = $data->pris[$storyID]; $prev['branch'] = isset($data->branches[$storyID]) ? $data->branches[$storyID] : 0; @@ -611,7 +611,7 @@ class storyModel extends model $this->dao->insert(TABLE_STORYSPEC)->data($data)->exec(); } - if(!dao::isError()) + if(!dao::isError()) { if($story->closedReason == 'done') $this->loadModel('score')->create('story', 'close'); $allChanges[$storyID] = common::createChanges($oldStory, $story); @@ -628,8 +628,8 @@ class storyModel extends model /** * Review a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return bool */ @@ -689,8 +689,8 @@ class storyModel extends model /** * Batch review stories. - * - * @param array $storyIDList + * + * @param array $storyIDList * @access public * @return array */ @@ -733,10 +733,10 @@ class storyModel extends model } /** - * Subdivide story - * - * @param int $storyID - * @param array $stories + * Subdivide story + * + * @param int $storyID + * @param array $stories * @access public * @return int */ @@ -776,8 +776,8 @@ class storyModel extends model /** * Close a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return bool */ @@ -798,7 +798,7 @@ class storyModel extends model ->add('closedBy', $this->app->user->account) ->add('assignedTo', 'closed') ->add('assignedDate', $now) - ->add('status', 'closed') + ->add('status', 'closed') ->removeIF($this->post->closedReason != 'duplicate', 'duplicateStory') ->removeIF($this->post->closedReason != 'subdivided', 'childStories') ->setIF($this->post->closedReason == 'done', 'stage', 'released') @@ -817,7 +817,7 @@ class storyModel extends model /** * Batch close story. - * + * * @access public * @return void */ @@ -867,7 +867,7 @@ class storyModel extends model ->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty') ->where('id')->eq($storyID)->exec(); - if(!dao::isError()) + if(!dao::isError()) { $allChanges[$storyID] = common::createChanges($oldStory, $story); } @@ -912,11 +912,11 @@ class storyModel extends model /** * Batch change the plan of story. - * - * @param array $storyIDList - * @param int $planID + * + * @param array $storyIDList + * @param int $planID * @access public - * @return array + * @return array */ public function batchChangePlan($storyIDList, $planID, $oldPlanID = 0) { @@ -952,9 +952,9 @@ class storyModel extends model /** * Batch change branch. - * - * @param array $storyIDList - * @param int $branchID + * + * @param array $storyIDList + * @param int $branchID * @access public * @return void */ @@ -980,8 +980,8 @@ class storyModel extends model /** * Batch change the stage of story. - * - * @param string $stage + * + * @param string $stage * @access public * @return array */ @@ -1011,7 +1011,7 @@ class storyModel extends model /** * Batch assign to. - * + * * @access public * @return array */ @@ -1041,8 +1041,8 @@ class storyModel extends model /** * Activate a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return bool */ @@ -1069,8 +1069,8 @@ class storyModel extends model /** * Set stage of a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return bool */ @@ -1162,11 +1162,11 @@ class storyModel extends model } /** - * Judge stage according to the devel and test tasks' status. - * + * Judge stage according to the devel and test tasks' status. + * * 1. one doing devel task, all test tasks waiting, set stage as developing. * 2. all devel tasks done, all test tasks waiting, set stage as developed. - * 3. one test task doing, set stage as testing. + * 3. one test task doing, set stage as testing. * 4. all test tasks done, still some devel tasks not done(wait, doing), set stage as testing. * 5. all test tasks done, all devel tasks done, set stage as tested. */ @@ -1175,7 +1175,7 @@ class storyModel extends model $stage = 'projected'; $testTasks = isset($branchTestTasks[$branch]) ? $branchTestTasks[$branch] : 0; $develTasks = isset($branchDevelTasks[$branch]) ? $branchDevelTasks[$branch] : 0; - if($statusList['devel']['doing'] > 0 and $statusList['test']['wait'] == $testTasks) $stage = 'developing'; + if($statusList['devel']['doing'] > 0 and $statusList['test']['wait'] == $testTasks) $stage = 'developing'; if($statusList['devel']['done'] == $develTasks and $develTasks > 0 and $statusList['test']['wait'] == $testTasks) $stage = 'developed'; if($statusList['test']['doing'] > 0) $stage = 'testing'; if(($statusList['devel']['wait'] > 0 or $statusList['devel']['doing'] > 0) and $statusList['test']['done'] == $testTasks and $testTasks > 0) $stage = 'testing'; @@ -1305,7 +1305,7 @@ class storyModel extends model /** * Get stories list of a product. - * + * * @param int $productID * @param array|string $moduleIdList * @param string $status @@ -1337,12 +1337,12 @@ class storyModel extends model /** * Get stories pairs of a product. - * - * @param int $productID - * @param array|string $moduleIdList - * @param string $status - * @param string $order - * @param int $limit + * + * @param int $productID + * @param array|string $moduleIdList + * @param string $status + * @param string $order + * @param int $limit * @access public * @return array */ @@ -1365,11 +1365,11 @@ class storyModel extends model /** * Get stories by assignedTo. - * - * @param int $productID - * @param string $account - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $account + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -1380,11 +1380,11 @@ class storyModel extends model /** * Get stories by openedBy. - * - * @param int $productID - * @param string $account - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $account + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -1395,11 +1395,11 @@ class storyModel extends model /** * Get stories by reviewedBy. - * - * @param int $productID - * @param string $account - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $account + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -1410,11 +1410,11 @@ class storyModel extends model /** * Get stories by closedBy. - * - * @param int $productID - * @param string $account - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $account + * @param string $orderBy + * @param object $pager * @return array */ public function getByClosedBy($productID, $branch, $modules, $account, $orderBy, $pager) @@ -1424,11 +1424,11 @@ class storyModel extends model /** * Get stories by status. - * - * @param int $productID - * @param string $orderBy - * @param object $pager - * @param string $status + * + * @param int $productID + * @param string $orderBy + * @param object $pager + * @param string $status * @access public * @return array */ @@ -1456,12 +1456,12 @@ class storyModel extends model /** * Get stories by a field. - * - * @param int $productID - * @param string $fieldName - * @param mixed $fieldValue - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $fieldName + * @param mixed $fieldValue + * @param string $orderBy + * @param object $pager * @param string $operator equal|include * @access public * @return array @@ -1484,10 +1484,10 @@ class storyModel extends model /** * Get to be closed stories. - * - * @param int $productID - * @param string $orderBy - * @param string $pager + * + * @param int $productID + * @param string $orderBy + * @param string $pager * @access public * @return array */ @@ -1522,7 +1522,7 @@ class storyModel extends model { if($projectID != '') { - $products = $this->loadModel('project')->getProducts($projectID); + $products = $this->loadModel('project')->getProducts($projectID); } else { @@ -1552,7 +1552,7 @@ class storyModel extends model foreach($products as $product) $branches[$product->branch] = $product->branch; unset($branches[0]); $branches = join(',', $branches); - if($branches) $storyQuery .= " AND `branch`" . helper::dbIN("0,$branches"); + if($branches) $storyQuery .= " AND `branch`" . helper::dbIN("0,$branches"); if($this->app->moduleName == 'release' or $this->app->moduleName == 'build') { $storyQuery .= " AND `status` NOT IN ('draft')";// Fix bug #990. @@ -1575,11 +1575,11 @@ class storyModel extends model /** * Get stories by a sql. - * - * @param int $productID - * @param string $sql - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $sql + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -1614,12 +1614,12 @@ class storyModel extends model } return $stories; } - + /** * Get stories list of a project. - * - * @param int $projectID - * @param string $orderBy + * + * @param int $projectID + * @param string $orderBy * @access public * @return array */ @@ -1696,9 +1696,9 @@ class storyModel extends model /** * Get stories pairs of a project. - * - * @param int $projectID - * @param int $productID + * + * @param int $projectID + * @param int $productID * @param array|string $moduleIdList * @param string $type * @access public @@ -1766,11 +1766,11 @@ class storyModel extends model /** * Get stories of a user. - * - * @param string $account - * @param string $type the query type - * @param string $orderBy - * @param object $pager + * + * @param string $account + * @param string $type the query type + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -1788,19 +1788,19 @@ class storyModel extends model ->orderBy($orderBy) ->page($pager) ->fetchAll(); - + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); $productIdList = array(); foreach($stories as $story) $productIdList[$story->product] = $story->product; - + return $this->mergePlanTitle($productIdList, $stories); } /** * Get story pairs of a user. - * - * @param string $account - * @param string $limit + * + * @param string $account + * @param string $limit * @access public * @return array */ @@ -1814,11 +1814,11 @@ class storyModel extends model ->limit($limit) ->fetchAll(); } - + /** * Get doing projects' members of a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return array */ @@ -1835,8 +1835,8 @@ class storyModel extends model /** * Get version of a story. - * - * @param int $storyID + * + * @param int $storyID * @access public * @return int */ @@ -1847,7 +1847,7 @@ class storyModel extends model /** * Get versions of some stories. - * + * * @param array|string story id list * @access public * @return array @@ -1859,8 +1859,8 @@ class storyModel extends model /** * Get zero case. - * - * @param int $productID + * + * @param int $productID * @access public * @return array */ @@ -1879,8 +1879,8 @@ class storyModel extends model /** * Batch get story stage. - * - * @param array $stories + * + * @param array $stories * @access public * @return array */ @@ -1893,8 +1893,8 @@ class storyModel extends model /** * Check need confirm. - * - * @param array $dataList + * + * @param array $dataList * @access public * @return array */ @@ -1922,9 +1922,9 @@ class storyModel extends model } /** - * Format stories - * - * @param array $stories + * Format stories + * + * @param array $stories * @param string $type * @param int $limit * @access public @@ -1963,8 +1963,8 @@ class storyModel extends model /** * Extract accounts from some stories. - * - * @param array $stories + * + * @param array $stories * @access public * @return array */ @@ -1983,8 +1983,8 @@ class storyModel extends model /** * Extract accounts from a story. - * - * @param object $story + * + * @param object $story * @access public * @return array */ @@ -2000,8 +2000,8 @@ class storyModel extends model /** * Merge the default chart settings and the settings of current chart. - * - * @param string $chartType + * + * @param string $chartType * @access public * @return void */ @@ -2019,7 +2019,7 @@ class storyModel extends model } /** - * Get report data of storys per product + * Get report data of storys per product * * @access public * @return array @@ -2073,7 +2073,7 @@ class storyModel extends model } /** - * Get report data of storys per source + * Get report data of storys per source * * @access public * @return array @@ -2090,8 +2090,8 @@ class storyModel extends model } /** - * Get report data of storys per plan - * + * Get report data of storys per plan + * * @access public * @return array */ @@ -2107,8 +2107,8 @@ class storyModel extends model } /** - * Get report data of storys per status - * + * Get report data of storys per status + * * @access public * @return array */ @@ -2123,8 +2123,8 @@ class storyModel extends model } /** - * Get report data of storys per stage - * + * Get report data of storys per stage + * * @access public * @return array */ @@ -2139,8 +2139,8 @@ class storyModel extends model } /** - * Get report data of storys per pri - * + * Get report data of storys per pri + * * @access public * @return array */ @@ -2155,8 +2155,8 @@ class storyModel extends model } /** - * Get report data of storys per estimate - * + * Get report data of storys per estimate + * * @access public * @return array */ @@ -2168,8 +2168,8 @@ class storyModel extends model } /** - * Get report data of storys per openedBy - * + * Get report data of storys per openedBy + * * @access public * @return array */ @@ -2185,8 +2185,8 @@ class storyModel extends model } /** - * Get report data of storys per assignedTo - * + * Get report data of storys per assignedTo + * * @access public * @return array */ @@ -2202,8 +2202,8 @@ class storyModel extends model } /** - * Get report data of storys per closedReason - * + * Get report data of storys per closedReason + * * @access public * @return array */ @@ -2218,8 +2218,8 @@ class storyModel extends model } /** - * Get report data of storys per change - * + * Get report data of storys per change + * * @access public * @return array */ @@ -2231,9 +2231,9 @@ class storyModel extends model } /** - * Get kanban group data. - * - * @param array $stories + * Get kanban group data. + * + * @param array $stories * @access public * @return array */ @@ -2247,9 +2247,9 @@ class storyModel extends model /** * Adjust the action clickable. - * - * @param object $story - * @param string $action + * + * @param object $story + * @param string $action * @access public * @return void */ @@ -2267,9 +2267,9 @@ class storyModel extends model /** * Merge plan title. - * - * @param int|array $productID - * @param array $stories + * + * @param int|array $productID + * @param array $stories * @access public * @return array */ @@ -2458,7 +2458,7 @@ class storyModel extends model /** * Set report condition. - * + * * @access public * @return string */ @@ -2478,7 +2478,7 @@ class storyModel extends model /** * Check force review for user. - * + * * @access public * @return bool */ @@ -2491,10 +2491,10 @@ class storyModel extends model } /** - * Send mail - * - * @param int $storyID - * @param int $actionID + * Send mail + * + * @param int $storyID + * @param int $actionID * @access public * @return void */ From f840fab1b7a843e54ceeeb7c8e7485ec1cf28ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Fri, 15 Dec 2017 11:11:05 +0800 Subject: [PATCH 42/50] * Format code --- module/story/model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 4c419704e7..aee5ab9a20 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -223,7 +223,7 @@ class storyModel extends model foreach($files as $file) { $file->objectType = 'story'; - $file->objectID = $storyID; + $file->objectID = $storyID; unset($file->id); $this->dao->insert(TABLE_FILE)->data($file)->exec(); } @@ -981,7 +981,9 @@ class storyModel extends model /** * Batch change the stage of story. * - * @param string $stage + * @param $storyIDList + * @param $stage + * * @access public * @return array */ From 5d656b0a087db2d04989b937f95f3a39db6f4d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Fri, 15 Dec 2017 13:37:24 +0800 Subject: [PATCH 43/50] * Task#3387 --- module/search/view/buildform.html.php | 37 ++++++++++++++------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index d0973b9a34..0934964a27 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -56,11 +56,11 @@ include '../../common/view/chosen.html.php'; .outer > #querybox {margin: -20px -20px 20px; border-top: none; border-bottom: 1px solid #ddd} #searchform input.date::-webkit-input-placeholder{color: #000000; opacity: 1;} -#searchform input.date::-moz-placeholder{color: #000000; opacity: 1;} +#searchform input.date::-moz-placeholder{color: #000000; opacity: 1;} #searchform input.date:-ms-input-placeholder{color: #000000; opacity: 1;} "; $mailConfig = $this->mail->autoDetect($this->post->fromAddress); $mailConfig->fromAddress = $this->post->fromAddress; $mailConfig->domain = common::getSysURL(); + if($type == 'gmail') $mailConfig->fromAddress = ''; $this->session->set('mailConfig', $mailConfig); die(js::locate(inlink('edit'), 'parent')); diff --git a/module/mail/js/edit.js b/module/mail/js/edit.js index ad537f83eb..5d6d8bd632 100644 --- a/module/mail/js/edit.js +++ b/module/mail/js/edit.js @@ -1,4 +1,5 @@ $(document).ready() { - $('#password').focus(); + $('#fromAddress').focus(); + if($('#fromAddress').val() != '')$('#password').focus(); } diff --git a/module/mail/lang/en.php b/module/mail/lang/en.php index 9309052bba..72797bb7cc 100755 --- a/module/mail/lang/en.php +++ b/module/mail/lang/en.php @@ -10,6 +10,7 @@ $lang->mail->resend = 'Resend'; $lang->mail->browse = 'Email List'; $lang->mail->delete = 'Delete Email'; $lang->mail->ztCloud = 'ZenTao CloudMail'; +$lang->mail->gmail = 'GMAIL'; $lang->mail->sendCloud = 'Notice SendCloud'; $lang->mail->batchDelete = 'Batch Delete'; $lang->mail->sendcloudUser = 'Sync Contact'; diff --git a/module/mail/lang/zh-cn.php b/module/mail/lang/zh-cn.php index 47ea0a204f..2e3795408b 100755 --- a/module/mail/lang/zh-cn.php +++ b/module/mail/lang/zh-cn.php @@ -10,6 +10,7 @@ $lang->mail->resend = '重发'; $lang->mail->browse = '邮件列表'; $lang->mail->delete = '删除邮件'; $lang->mail->ztCloud = '禅道云发信'; +$lang->mail->gmail = 'GMAIL发信'; $lang->mail->sendCloud = 'Notice发信'; $lang->mail->batchDelete = '批量删除'; $lang->mail->sendcloudUser = '同步联系人'; diff --git a/module/mail/view/index.html.php b/module/mail/view/index.html.php index fad3d328a7..2dbfb9e2eb 100755 --- a/module/mail/view/index.html.php +++ b/module/mail/view/index.html.php @@ -24,6 +24,9 @@ include '../../common/view/header.html.php'; app->getClientLang() != 'en' and common::hasPriv('mail', 'ztCloud')):?> mail->ztCloud, '', "class='btn btn-sm w-120px'")?> + app->getClientLang() == 'en'):?> + mail->gmail, '', "class='btn btn-sm w-120px'")?> + mail->smtp, '', "class='btn btn-sm w-120px'")?> From 8a7a4379609d3b3a2f56f9d12c1b0273c820c683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 18 Dec 2017 11:00:29 +0800 Subject: [PATCH 47/50] * Task #3396 and Fix bug --- config/filter.php | 5 +++++ module/git/model.php | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/filter.php b/config/filter.php index ee9d0880b3..66e2c6ce16 100644 --- a/config/filter.php +++ b/config/filter.php @@ -199,3 +199,8 @@ $filter->user->login->get['account'] = 'account'; $filter->user->login->get['lang'] = 'reg::lang'; $filter->user->login->get['password'] = 'reg::any'; $filter->user->edit->get['from'] = 'reg::word'; + +$filter->git->cat->get['repoUrl'] = 'reg::base64'; +$filter->git->diff->get['repoUrl'] = 'reg::base64'; +$filter->svn->cat->get['repoUrl'] = 'reg::base64'; +$filter->svn->diff->get['repoUrl'] = 'reg::base64'; \ No newline at end of file diff --git a/module/git/model.php b/module/git/model.php index 1932bc00b5..46b1d40502 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -759,9 +759,8 @@ class gitModel extends model public function buildURL($methodName, $url, $revision) { $buildedURL = helper::createLink('git', $methodName, "path=&revision=$revision", 'html'); - $buildedURL .= strpos($buildURL, '?') === false ? '?' : '&'; + $buildedURL .= strpos($buildedURL, '?') === false ? '?' : '&'; $buildedURL .= 'repoUrl=' . helper::safe64Encode($url); - return $buildedURL; } } From e6bcc3101c147d17b86031c0408477770a782c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 18 Dec 2017 13:43:52 +0800 Subject: [PATCH 48/50] * Fix bug#1214 --- module/productplan/js/create.js | 7 ++++++- module/project/js/create.js | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js index 99e9bae940..e58173c215 100644 --- a/module/productplan/js/create.js +++ b/module/productplan/js/create.js @@ -40,4 +40,9 @@ $('#begin').on('change', function() { $("#end").val(''); $("input:radio[name='delta']").attr("checked",false); -}); \ No newline at end of file +}); + +$('#end').on('change', function() +{ + $("input:radio[name='delta']").attr("checked", false); +}); diff --git a/module/project/js/create.js b/module/project/js/create.js index 4ecdecef3c..b4f739c7c4 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -19,6 +19,10 @@ $(function() $("#days").val(''); $("input:radio[name='delta']").attr("checked",false); }); + $('#end').on('change', function() + { + $("input:radio[name='delta']").attr("checked", false); + }) }); function showTypeTips() From 507a436704b5383cf5461bf164f0b41c6d2792de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 18 Dec 2017 13:57:20 +0800 Subject: [PATCH 49/50] * Fix bug#1275 --- module/doc/lang/en.php | 1 + module/doc/lang/zh-cn.php | 1 + module/tree/view/browse.html.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 6224beb469..3d17d4127c 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -64,6 +64,7 @@ $lang->doc->manageType = 'Manage Category'; $lang->doc->editType = 'Edit'; $lang->doc->deleteType = 'Delete'; $lang->doc->addType = 'Add'; +$lang->doc->childType = 'Child'; $lang->doc->libName = 'Name'; $lang->doc->libType = 'Category'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index ce1c8c99d3..7af011aef3 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -64,6 +64,7 @@ $lang->doc->manageType = '维护分类'; $lang->doc->editType = '编辑分类'; $lang->doc->deleteType = '删除分类'; $lang->doc->addType = '增加分类'; +$lang->doc->childType = '子分类'; $lang->doc->libName = '文档库名称'; $lang->doc->libType = '文档库类型'; diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index ac0efd610e..64118b6abc 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -182,7 +182,7 @@ $(function() { linkTemplate: '', title: 'tree->child ?>', - template: 'tree->child?>' + template: 'doc->childType : $lang->tree->child)?>' } }, action: function(event) From 44bc56562fd65e93b97c7e11fe5c4db4b14fb6a3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 18 Dec 2017 14:36:24 +0800 Subject: [PATCH 50/50] * finish task #3395. --- module/project/js/common.js | 13 ++++++++----- www/js/my.full.js | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/module/project/js/common.js b/module/project/js/common.js index a9d259dd8b..67ff3bd237 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -163,12 +163,15 @@ function loadBranch(){} /* Auto compute the work days. */ $(function() { - if(typeof(replaceID) != 'undefined') setModal4List('iframe', replaceID, function($list) + if(typeof(replaceID) != 'undefined') { - $list.find('.progress-pie:visible').progressPie(); - var datatable = $list.data('zui.datatable'); - if(datatable) datatable.$datatable.find('.progress-pie:visible').progressPie(); - }); + setModal4List('iframe', replaceID, function($list) + { + $list.find('.progress-pie:visible').progressPie(); + var datatable = $list.data('zui.datatable'); + if(datatable) datatable.$datatable.find('.progress-pie:visible').progressPie(); + }); + } $(".date").bind('dateSelected', function() { computeWorkDays(this.id); diff --git a/www/js/my.full.js b/www/js/my.full.js index 8d59b63e5e..31ed1f085d 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1485,6 +1485,18 @@ function fixedTfootAction(formID) if(typeof(ssoRedirect) != "undefined") pageFooterHeight = 0; function fixTfoot() { + var $table = $form.find('table:last'); + var $tfoot = $table.find('tfoot'); + if($table.hasClass('table-datatable')) + { + $table = $form.find('.datatable-rows'); + $tfoot = $form.find('.datatable-footer tfoot'); + } + + $tbody = $table.find('tbody'), + $inputGroup = $tfoot.find('.table-actions').children('.input-group'), + pageFooterHeight = $('#footer').height(), + tableWidth = $table.width(); hasFixed = $tfoot.hasClass('fixedTfootAction'); offsetHeight = $(window).height() + $(window).scrollTop() - pageFooterHeight/2; @@ -1516,6 +1528,15 @@ function fixedTfootAction(formID) { // Fix table foot when scrolling. fixTfoot(); + + var $table = $form.find('table:last'); + var $tfoot = $table.find('tfoot'); + if($table.hasClass('table-datatable')) + { + $table = $form.find('.datatable-rows'); + $tfoot = $form.find('.datatable-footer tfoot'); + } + $tfoot.addClass('scrolling scrolled'); clearTimeout(scrollCallTask); scrollCallTask = setTimeout(function(){$tfoot.removeClass('scrolling');}, 200)