From c8049d270ac2d412049c146c3d8a2d2358e61fbb Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Mon, 11 Sep 2017 15:14:30 +0800 Subject: [PATCH 01/21] * Finish task #3209. --- module/custom/control.php | 9 ++++-- module/custom/lang/en.php | 1 + module/custom/lang/zh-cn.php | 10 +++--- module/custom/lang/zh-tw.php | 1 + module/custom/view/set.html.php | 11 ++++++- module/testcase/config.php | 2 +- module/testcase/control.php | 15 +++++---- module/testcase/lang/en.php | 4 +++ module/testcase/lang/zh-cn.php | 14 +++++--- module/testcase/lang/zh-tw.php | 4 +++ module/testcase/model.php | 39 ++++++++++++----------- module/testcase/view/batchcreate.html.php | 2 ++ module/testcase/view/create.html.php | 3 ++ 13 files changed, 75 insertions(+), 40 deletions(-) diff --git a/module/custom/control.php b/module/custom/control.php index df5c1f6192..534dda7d3d 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -50,8 +50,9 @@ class custom extends control { $this->app->loadConfig($module); $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); - $this->view->needReview = zget($this->config->$module, 'needReview', 1); - $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); + $this->view->needReview = zget($this->config->$module, 'needReview', 1); + $this->view->forceReview = zget($this->config->$module, 'forceReview', ''); + $this->view->forceNotReview = zget($this->config->$module, 'forceNotReview', ''); } if($module == 'task' and $field == 'hours') { @@ -82,7 +83,9 @@ class custom extends control { if(($module == 'story' or $module == 'testcase') and $field == 'review') { - $data = fixer::input('post')->join('forceReview', ',')->get(); + $review = fixer::input('post')->get(); + if($review->needReview) $data = fixer::input('post')->join('forceNotReview', ',')->remove('forceReview')->get(); + if(!$review->needReview) $data = fixer::input('post')->join('forceReview', ',')->remove('forceNotReview')->get(); $this->loadModel('setting')->setItems("system.$module", $data); } elseif($module == 'task' and $field == 'hours') diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index b3959833e4..0110fc718f 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -82,6 +82,7 @@ $lang->custom->notice = new stdclass(); $lang->custom->notice->userRole = 'Key must be no more than 20 characters!'; $lang->custom->notice->canNotAdd = 'This item will be processed, so customized feature is not enabled.'; $lang->custom->notice->forceReview = 'Review is required for %s submitted by certain assignee.'; +$lang->custom->notice->forceNotReview = "Not review is required for %s submitted by certain assignee."; $lang->custom->notice->longlife = 'List "Undone" bugs that are older than hold days from "Longlife" bugs.'; $lang->custom->notice->priListKey = 'Priority list key should be numbers!'; $lang->custom->notice->keyList = 'key should be English or digital!'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 0983985fdf..914abf963f 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -82,6 +82,7 @@ $lang->custom->notice = new stdclass(); $lang->custom->notice->userRole = '键的长度必须小于20个字符!'; $lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能'; $lang->custom->notice->forceReview = "指定人提交的%s必须评审。"; +$lang->custom->notice->forceNotReview = "指定人提交的%s不需要评审。"; $lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。'; $lang->custom->notice->priListKey = '优先级的键应当为数字!'; $lang->custom->notice->keyList = '键值应当为英文或数字'; @@ -90,10 +91,11 @@ $lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主 $lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?"; $lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?"; -$lang->custom->storyReview = '评审流程'; -$lang->custom->forceReview = '强制评审'; -$lang->custom->reviewList[1] = '开启'; -$lang->custom->reviewList[0] = '关闭'; +$lang->custom->storyReview = '评审流程'; +$lang->custom->forceReview = '强制评审'; +$lang->custom->forceNotReview = '不需要评审'; +$lang->custom->reviewList[1] = '开启'; +$lang->custom->reviewList[0] = '关闭'; $lang->custom->deletedList[1] = '列出'; $lang->custom->deletedList[0] = '不列出'; diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php index f90207046e..a2a143e05e 100644 --- a/module/custom/lang/zh-tw.php +++ b/module/custom/lang/zh-tw.php @@ -82,6 +82,7 @@ $lang->custom->notice->userRole = '鍵的長度必須小於20個字 $lang->custom->notice->canNotAdd = '該項參與運算,不提供自定義添加功能'; $lang->custom->notice->forceReview = "指定人提交的%s必須評審。"; $lang->custom->notice->longlife = 'Bug列表頁面的久未處理標籤中,列出設置天數之前未處理的Bug。'; +$lang->custom->notice->forceNotReview = "指定人提交的%s不需要評審。"; $lang->custom->notice->priListKey = '優先順序的鍵應當為數字!'; $lang->custom->notice->keyList = '鍵值應當為英文或數字'; $lang->custom->notice->severityListKey = 'Bug嚴重程度的鍵應當為數字!'; diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index f30a188cba..baafa0006d 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -11,7 +11,7 @@ */ ?> - @@ -76,6 +76,13 @@ EOT; custom->notice->forceReview, $lang->$module->common);?> + + > + custom->forceNotReview;?> + + custom->notice->forceNotReview, $lang->$module->common);?> + + @@ -182,10 +189,12 @@ $(function() if($(this).val() == 0) { $('#forceReview').closest('tr').removeClass('hidden'); + $('#forceNotReview').closest('tr').addClass('hidden'); } else { $('#forceReview').closest('tr').addClass('hidden'); + $('#forceNotReview').closest('tr').removeClass('hidden'); } }) }) diff --git a/module/testcase/config.php b/module/testcase/config.php index 718e546dd0..59010ded91 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -24,7 +24,7 @@ $config->testcase->exportFields = ' lastEditedBy, lastEditedDate, version, linkCase'; $config->testcase->customCreateFields = 'story,stage,pri,keywords'; -$config->testcase->customBatchCreateFields = 'module,stage,story,pri,precondition,keywords'; +$config->testcase->customBatchCreateFields = 'module,stage,story,pri,precondition,keywords,review'; $config->testcase->customBatchEditFields = 'module,story,stage,precondition,status,pri,keywords'; $config->testcase->custom = new stdclass(); diff --git a/module/testcase/control.php b/module/testcase/control.php index 4f4f602061..05d1b5b4a8 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -346,12 +346,12 @@ class testcase extends control $this->display(); } - + /** * Create a batch test case. - * - * @param int $productID - * @param int $moduleID + * + * @param int $productID + * @param int $moduleID * @param int $storyID * @access public * @return void @@ -418,6 +418,7 @@ class testcase extends control $this->view->currentModuleID = $currentModuleID; $this->view->branch = $branch; $this->view->branches = $this->loadModel('branch')->getPairs($productID); + $this->view->needReview = $this->testcase->forceNotReview() == true ? 0 : 1; $this->display(); } @@ -559,7 +560,7 @@ class testcase extends control $case->steps[] = $step; } - $isLibCase = ($case->lib and empty($case->product)); + $isLibCase = ($case->lib and empty($case->product)); if($isLibCase) { $libraries = $this->loadModel('testsuite')->getLibraries(); @@ -602,7 +603,7 @@ class testcase extends control $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch); } - if(!$this->testcase->forceReview()) unset($this->lang->testcase->statusList['wait']); + if($this->testcase->forceNotReview()) unset($this->lang->testcase->statusList['wait']); $position[] = $this->lang->testcase->common; $position[] = $this->lang->testcase->edit; @@ -710,7 +711,7 @@ class testcase extends control } } - if(!$this->testcase->forceReview()) unset($this->lang->testcase->statusList['wait']); + if(!$this->testcase->forceNotReview()) unset($this->lang->testcase->statusList['wait']); /* Judge whether the editedTasks is too large and set session. */ $countInputVars = count($cases) * (count(explode(',', $this->config->testcase->custom->batchEditFields)) + 3); diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index 552719118b..40b409214f 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -36,6 +36,7 @@ $lang->testcase->stage = 'Stage'; $lang->testcase->reviewedBy = 'Reviewed By'; $lang->testcase->reviewedDate = 'Reviewed Date'; $lang->testcase->reviewResult = 'Review Result'; +$lang->testcase->forceNotReview = 'No Review'; $lang->testcase->lastEditedByAB = 'Last Edited By'; $lang->testcase->lastEditedDateAB = 'Last Edited on'; $lang->testcase->lastEditedDate = 'Last Edited on'; @@ -129,6 +130,9 @@ $lang->testcase->confirmBatchDelete = 'Do you want to batch delete thess Test Ca $lang->testcase->ditto = 'Ditto'; $lang->testcase->dittoNotice = 'This Case does not belong to the Product as the previous one!'; +$lang->testcase->reviewList[0] = 'NO'; +$lang->testcase->reviewList[1] = 'YES'; + $lang->testcase->priList[3] = 3; $lang->testcase->priList[1] = 1; $lang->testcase->priList[2] = 2; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 0c5ff186ab..4efb62b322 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -36,6 +36,7 @@ $lang->testcase->stage = '适用阶段'; $lang->testcase->reviewedBy = '由谁评审'; $lang->testcase->reviewedDate = '评审时间'; $lang->testcase->reviewResult = '评审结果'; +$lang->testcase->forceNotReview = '不需要评审'; $lang->testcase->lastEditedByAB = '修改者'; $lang->testcase->lastEditedDateAB = '修改日期'; $lang->testcase->lastEditedDate = '修改日期'; @@ -112,11 +113,11 @@ $lang->testcase->allCases = '所有'; $lang->testcase->needConfirm = '需求变动'; $lang->testcase->bySearch = '搜索'; -$lang->testcase->lblStory = '相关需求'; -$lang->testcase->lblLastEdited = '最后编辑'; -$lang->testcase->lblTypeValue = '类型可选值列表'; -$lang->testcase->lblStageValue = '阶段可选值列表'; -$lang->testcase->lblStatusValue = '状态可选值列表'; +$lang->testcase->lblStory = '相关需求'; +$lang->testcase->lblLastEdited = '最后编辑'; +$lang->testcase->lblTypeValue = '类型可选值列表'; +$lang->testcase->lblStageValue = '阶段可选值列表'; +$lang->testcase->lblStatusValue = '状态可选值列表'; $lang->testcase->legendBasicInfo = '基本信息'; $lang->testcase->legendAttatch = '附件'; @@ -129,6 +130,9 @@ $lang->testcase->confirmBatchDelete = '您确认要批量删除这些测试用 $lang->testcase->ditto = '同上'; $lang->testcase->dittoNotice = '该用例与上一用例不属于同一产品!'; +$lang->testcase->reviewList[0] = '否'; +$lang->testcase->reviewList[1] = '是'; + $lang->testcase->priList[3] = 3; $lang->testcase->priList[1] = 1; $lang->testcase->priList[2] = 2; diff --git a/module/testcase/lang/zh-tw.php b/module/testcase/lang/zh-tw.php index a5a4e46e70..00d7957567 100644 --- a/module/testcase/lang/zh-tw.php +++ b/module/testcase/lang/zh-tw.php @@ -36,6 +36,7 @@ $lang->testcase->stage = '適用階段'; $lang->testcase->reviewedBy = '由誰評審'; $lang->testcase->reviewedDate = '評審時間'; $lang->testcase->reviewResult = '評審結果'; +$lang->testcase->forceNotReview = '不需要評審'; $lang->testcase->lastEditedByAB = '修改者'; $lang->testcase->lastEditedDateAB = '修改日期'; $lang->testcase->lastEditedDate = '修改日期'; @@ -129,6 +130,9 @@ $lang->testcase->confirmBatchDelete = '您確認要批量刪除這些測試用 $lang->testcase->ditto = '同上'; $lang->testcase->dittoNotice = '該用例與上一用例不屬於同一產品!'; +$lang->testcase->reviewList[0] = '否'; +$lang->testcase->reviewList[1] = '是'; + $lang->testcase->priList[3] = 3; $lang->testcase->priList[1] = 1; $lang->testcase->priList[2] = 2; diff --git a/module/testcase/model.php b/module/testcase/model.php index 4b6f1bec70..7958db676f 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -84,11 +84,11 @@ class testcaseModel extends model $case = fixer::input('post') ->add('openedBy', $this->app->user->account) ->add('openedDate', $now) - ->add('status', $this->forceReview() ? 'wait' : 'normal') + ->add('status', $this->forceNotReview() || ($this->config->testcase->needReview && $this->post->forceNotReview) ? 'normal' : 'wait') ->add('version', 1) ->add('fromBug', $bugID) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) - ->remove('steps,expects,files,labels,stepType') + ->remove('steps,expects,files,labels,stepType,forceNotReview') ->setDefault('story', 0) ->join('stage', ',') ->get(); @@ -125,12 +125,12 @@ class testcaseModel extends model return array('status' => 'created', 'id' => $caseID); } } - + /** * Batch create cases. - * - * @param int $productID - * @param int $storyID + * + * @param int $productID + * @param int $storyID * @access public * @return void */ @@ -160,14 +160,14 @@ class testcaseModel extends model $type = $cases->type[$i] == 'ditto' ? $type : $cases->type[$i]; $pri = $cases->pri[$i] == 'ditto' ? $pri : $cases->pri[$i]; $cases->module[$i] = (int)$module; - $cases->story[$i] = (int)$story; + $cases->story[$i] = (int)$story; $cases->type[$i] = $type; $cases->pri[$i] = $pri; } $this->loadModel('story'); $storyVersions = array(); - $forceReview = $this->forceReview(); + $forceNotReview = $this->forceNotReview(); for($i = 0; $i < $batchNum; $i++) { if($cases->type[$i] != '' and $cases->title[$i] != '') @@ -186,7 +186,7 @@ class testcaseModel extends model $data[$i]->keywords = $cases->keywords[$i]; $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; - $data[$i]->status = $forceReview ? 'wait' : 'normal'; + $data[$i]->status = $forceNotReview || ($this->config->testcase->needReview && $cases->needReview[$i]) ? 'normal' : 'wait'; $data[$i]->version = 1; $caseStory = $data[$i]->story; @@ -522,7 +522,7 @@ class testcaseModel extends model $steps = array(); //---------------- Judge steps changed or not.-------------------- */ - + /* Remove the empty setps in post. */ foreach($this->post->steps as $key => $desc) { @@ -558,7 +558,7 @@ class testcaseModel extends model ->join('stage', ',') ->remove('comment,steps,expects,files,labels,stepType') ->get(); - if($this->forceReview() and $stepChanged) $case->status = 'wait'; + if(!$this->forceNotReview() and $stepChanged) $case->status = 'wait'; $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->edit->requiredFields, 'notempty')->where('id')->eq((int)$caseID)->exec(); if(!$this->dao->isError()) { @@ -997,7 +997,7 @@ class testcaseModel extends model $cases[$key] =$caseData; } - $forceReview = $this->forceReview(); + $forceNotReview = $this->forceNotReview(); foreach($cases as $key => $caseData) { $caseID = 0; @@ -1059,7 +1059,7 @@ class testcaseModel extends model { $caseData->lastEditedBy = $this->app->user->account; $caseData->lastEditedDate = $now; - if($stepChanged and $forceReview) $caseData->status = 'wait'; + if($stepChanged and !$forceNotReview) $caseData->status = 'wait'; $this->dao->update(TABLE_CASE)->data($caseData)->where('id')->eq($caseID)->autoCheck()->exec(); if($stepChanged) { @@ -1094,7 +1094,7 @@ class testcaseModel extends model $caseData->openedDate = $now; $caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch; if($caseData->story) $caseData->storyVersion = zget($storyVersionPairs, $caseData->story, 1); - $caseData->status = $forceReview ? 'wait' : 'normal'; + $caseData->status = !$forceNotReview ? 'wait' : 'normal'; $this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec(); if(!dao::isError()) @@ -1393,15 +1393,16 @@ class testcaseModel extends model } /** - * Check whether force review - * + * Check whether force not review + * * @access public * @return bool */ - public function forceReview() + public function forceNotReview() { - if($this->config->testcase->needReview) return true; - if(strpos(",{$this->config->testcase->forceReview},", ",{$this->app->user->account},") !== false) return true; + if(!$this->config->testcase->needReview && strpos(",{$this->config->testcase->forceReview},", ",{$this->app->user->account},") === false) return true; + if($this->config->testcase->needReview && strpos(",{$this->config->testcase->forceNotReview},", ",{$this->app->user->account},")) return true; + return false; } } diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index 774b997c8d..d345608d5b 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -55,6 +55,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; '>testcase->precondition;?> '> testcase->keywords;?> '> testcase->stage;?> + '> testcase->review;?> @@ -83,6 +84,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; '> '> ' style='overflow:visible'>testcase->stageList, '', "class='form-control chosen' multiple");?> + '>testcase->reviewList, $needReview, "class='form-control'");?> diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 34bd6ec629..fec4b76e06 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -88,6 +88,9 @@
+ testcase->forceNotReview()):?> + testcase->forceNotReview, '', "id='forceNotReview'");?> +
From 40a3419f056cda12c0a015fc80ab0de674ed6f69 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Mon, 11 Sep 2017 16:10:50 +0800 Subject: [PATCH 02/21] * Finish task #3223. --- module/testreport/control.php | 1 - module/testreport/lang/en.php | 1 + module/testreport/lang/zh-cn.php | 1 + module/testreport/lang/zh-tw.php | 1 + module/testreport/model.php | 20 +++++++++++++++----- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/module/testreport/control.php b/module/testreport/control.php index b699f63ab2..d988165187 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -183,7 +183,6 @@ class testreport extends control $cases = $this->testreport->getTaskCases($tasks); $bugInfo = $this->testreport->getBugInfo($tasks, $productIdList, $begin, $end, $builds); - $this->view->begin = $begin; $this->view->end = $end; $this->view->members = $this->dao->select('lastRunner')->from(TABLE_TESTRESULT)->where('run')->in(array_keys($tasks))->fetchPairs('lastRunner', 'lastRunner'); diff --git a/module/testreport/lang/en.php b/module/testreport/lang/en.php index 778ce45e56..a73d954e22 100644 --- a/module/testreport/lang/en.php +++ b/module/testreport/lang/en.php @@ -42,6 +42,7 @@ $lang->testreport->legendComment = 'Sum up'; $lang->testreport->legendMore = 'More'; $lang->testreport->bugSeverityGroups = 'Bug Severity Distribution'; +$lang->testreport->bugTypeGroups = 'Bug Type Distribution'; $lang->testreport->bugStatusGroups = 'Bug Status Distribution'; $lang->testreport->bugOpenedByGroups = 'Bug CreatedBy Distribution'; $lang->testreport->bugResolvedByGroups = 'Bug ResolvedBy Distribution'; diff --git a/module/testreport/lang/zh-cn.php b/module/testreport/lang/zh-cn.php index 3609073879..cc38fe3b45 100644 --- a/module/testreport/lang/zh-cn.php +++ b/module/testreport/lang/zh-cn.php @@ -42,6 +42,7 @@ $lang->testreport->legendComment = '总结'; $lang->testreport->legendMore = '更多功能'; $lang->testreport->bugSeverityGroups = 'Bug严重级别分布'; +$lang->testreport->bugTypeGroups = 'Bug类型别分布'; $lang->testreport->bugStatusGroups = 'Bug状态分布'; $lang->testreport->bugOpenedByGroups = 'Bug创建者分布'; $lang->testreport->bugResolvedByGroups = 'Bug解决者分布'; diff --git a/module/testreport/lang/zh-tw.php b/module/testreport/lang/zh-tw.php index a50f9e33e6..abdbe569a0 100644 --- a/module/testreport/lang/zh-tw.php +++ b/module/testreport/lang/zh-tw.php @@ -42,6 +42,7 @@ $lang->testreport->legendComment = '總結'; $lang->testreport->legendMore = '更多功能'; $lang->testreport->bugSeverityGroups = 'Bug嚴重級別分佈'; +$lang->testreport->bugTypeGroups = 'Bug類型別分布'; $lang->testreport->bugStatusGroups = 'Bug狀態分佈'; $lang->testreport->bugOpenedByGroups = 'Bug創建者分佈'; $lang->testreport->bugResolvedByGroups = 'Bug解決者分佈'; diff --git a/module/testreport/model.php b/module/testreport/model.php index 74fe5758bd..af9306e8df 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -187,14 +187,15 @@ class testreportModel extends model public function getBugInfo($tasks, $productIdList, $begin, $end, $builds) { $bugsByTask = $this->dao->select('*')->from(TABLE_BUG)->where('testtask')->in(array_keys($tasks))->andWhere('testtask')->ne(0)->andWhere('deleted')->eq(0)->fetchAll('id'); - $severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = array(); + $severityGroups = $statusGroups = $openedByGroups = $resolvedByGroups = $resolutionGroups = $moduleGroups = $typeGroups = array(); $resolvedBugs = 0; foreach($bugsByTask as $bug) { - $severityGroups[$bug->severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1; - $statusGroups[$bug->status] = isset($statusGroups[$bug->status]) ? $statusGroups[$bug->status] + 1 : 1; - $openedByGroups[$bug->openedBy] = isset($openedByGroups[$bug->openedBy]) ? $openedByGroups[$bug->openedBy] + 1 : 1; - $moduleGroups[$bug->module] = isset($moduleGroups[$bug->module]) ? $moduleGroups[$bug->module] + 1 : 1; + $severityGroups[$bug->severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1; + $typeGroups[$bug->type] = isset($typeGroups[$bug->type]) ? $typeGroups[$bug->type] + 1 : 1; + $statusGroups[$bug->status] = isset($statusGroups[$bug->status]) ? $statusGroups[$bug->status] + 1 : 1; + $openedByGroups[$bug->openedBy] = isset($openedByGroups[$bug->openedBy]) ? $openedByGroups[$bug->openedBy] + 1 : 1; + $moduleGroups[$bug->module] = isset($moduleGroups[$bug->module]) ? $moduleGroups[$bug->module] + 1 : 1; if($bug->resolvedBy) $resolvedByGroups[$bug->resolvedBy] = isset($resolvedByGroups[$bug->resolvedBy]) ? $resolvedByGroups[$bug->resolvedBy] + 1 : 1; if($bug->resolution) $resolutionGroups[$bug->resolution] = isset($resolutionGroups[$bug->resolution]) ? $resolutionGroups[$bug->resolution] + 1 : 1; if($bug->status == 'resolved' or $bug->status == 'closed') $resolvedBugs ++; @@ -226,6 +227,15 @@ class testreportModel extends model } $bugInfo['bugSeverityGroups'] = $data; + $data = array(); + foreach($typeGroups as $type => $count) + { + $data[$type] = new stdclass(); + $data[$type]->name = zget($this->lang->bug->typeList, $type); + $data[$type]->value = $count; + } + $bugInfo['bugTypeGroups'] = $data; + $data = array(); foreach($statusGroups as $status => $count) { From 9eda515927f8dcf074a35642ff962390b10559fd Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 09:49:59 +0800 Subject: [PATCH 03/21] * Finish task #3211. --- module/project/view/edit.html.php | 6 ++--- module/testtask/model.php | 37 ++++++++++++++++++++++++------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index a4f0646121..d9f2b4f990 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -134,15 +134,15 @@ project->desc;?> desc), "rows='6' class='form-control'");?> - + project->acl;?> project->aclList, $project->acl, "onclick='setWhite(this.value);'", 'block'));?> - + acl != 'custom') echo "class='hidden'";?>> project->whitelist;?> whitelist);?> - + diff --git a/module/testtask/model.php b/module/testtask/model.php index 25833bf9cf..a94bab9b27 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -90,10 +90,10 @@ class testtaskModel extends model /** * Get test tasks of a product. - * - * @param int $productID - * @param string $orderBy - * @param object $pager + * + * @param int $productID + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -116,7 +116,7 @@ class testtaskModel extends model } else { - return $this->dao->select("t1.*, t2.name AS productName, t3.name AS projectName, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch") + $testTask = $this->dao->select("t1.*, t2.name AS productName, t3.name AS projectName, t3.acl, t3.whitelist, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch") ->from(TABLE_TESTTASK)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id') @@ -131,14 +131,35 @@ class testtaskModel extends model ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); + + $projectTeam = $this->dao->select('project, account')->from(TABLE_TEAM)->where('account')->eq($this->app->user->account)->fetchAll('project'); + + foreach($testTask as $id => $task) + { + if($this->app->user->admin) break; + if($task->acl == 'open') continue; + if($task->acl == 'private' && array_key_exists($task->project, $projectTeam)) continue; + if($task->acl == 'custom') + { + $whiteListArray = array(); + if(!empty($task->whitelist)) $whiteListArray = explode(',', $task->whitelist); + + $intersect = array_intersect($whiteListArray, $this->app->user->groups); + if(!empty($intersect)) continue; + } + + unset($testTask[$id]); + } + + return $testTask; } } /** * Get test tasks of a project. - * - * @param int $projectID - * @param string $orderBy + * + * @param int $projectID + * @param string $orderBy * @param object $pager * @access public * @return array From 60f3998e0946cd955196907ac022b5a7b25c64e0 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 10:17:43 +0800 Subject: [PATCH 04/21] * Finish task #3203. --- module/product/control.php | 18 +++++++++--------- module/product/model.php | 7 ++++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 167c787b7f..9b2977fade 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -627,13 +627,13 @@ class product extends control /** * All product. - * - * @param int $productID - * @param string $status - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * + * @param int $productID + * @param string $status + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ @@ -662,8 +662,8 @@ class product extends control /** * Doc for compatible. - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ diff --git a/module/product/model.php b/module/product/model.php index 49a62bc57b..2fdc6fc19a 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -241,9 +241,9 @@ class productModel extends model } /** - * Get products by project. - * - * @param int $projectID + * Get products by project. + * + * @param int $projectID * @access public * @return array */ @@ -256,6 +256,7 @@ class productModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t2') ->on('t1.product = t2.id') ->where('t1.project')->eq($projectID) + ->orderBy('t2.order desc') ->fetchPairs(); } From 74c5559c7b932adf61e771d55a9882842f0ff22a Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 10:42:56 +0800 Subject: [PATCH 05/21] * Finish task #3207. --- module/story/config.php | 8 ++++---- module/story/control.php | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/story/config.php b/module/story/config.php index 73191c706d..115e3a0cf6 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -29,12 +29,12 @@ $config->story->editor->activate = array('id' => 'comment', 'tools' => 'simpleTo $config->story->list = new stdclass(); $config->story->list->exportFields = ' - id, product, branch, module, plan, source, title, spec, verify, keywords, + id, product, branch, module, plan, source, sourceNote, title, spec, verify, keywords, pri, estimate, status, stage, taskCountAB, bugCountAB, caseCountAB, - openedBy, openedDate, assignedTo, assignedDate, mailto, - reviewedBy, reviewedDate, + openedBy, openedDate, assignedTo, assignedDate, mailto, + reviewedBy, reviewedDate, closedBy, closedDate, closedReason, - lastEditedBy, lastEditedDate, + lastEditedBy, lastEditedDate, childStories, linkStories, duplicateStory, files'; $config->story->list->customCreateFields = 'source,verify,pri,estimate,mailto,keywords'; diff --git a/module/story/control.php b/module/story/control.php index 5263c5713c..793c8f5726 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1436,6 +1436,7 @@ class story extends control if(isset($storyLang->stageList[$story->stage])) $story->stage = $storyLang->stageList[$story->stage]; if(isset($storyLang->reasonList[$story->closedReason])) $story->closedReason = $storyLang->reasonList[$story->closedReason]; if(isset($storyLang->sourceList[$story->source])) $story->source = $storyLang->sourceList[$story->source]; + if(isset($storyLang->sourceList[$story->sourceNote])) $story->sourceNote = $storyLang->sourceList[$story->sourceNote]; if(isset($users[$story->openedBy])) $story->openedBy = $users[$story->openedBy]; if(isset($users[$story->assignedTo])) $story->assignedTo = $users[$story->assignedTo]; From 16f87e721da55916d79c4146d84b7688f6907584 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 14:02:07 +0800 Subject: [PATCH 06/21] * Finish task #3213. --- db/update9.5.sql | 1 + db/zentao.sql | 1 + module/bug/config.php | 5 +++++ module/bug/lang/en.php | 1 + module/bug/lang/zh-cn.php | 1 + module/bug/lang/zh-tw.php | 1 + module/bug/model.php | 16 ++++++++++------ module/bug/view/view.html.php | 4 ++++ module/common/model.php | 30 +++++++++++++++--------------- module/datatable/model.php | 4 ++-- module/task/control.php | 6 +++--- 11 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 db/update9.5.sql diff --git a/db/update9.5.sql b/db/update9.5.sql new file mode 100644 index 0000000000..cc8564ed48 --- /dev/null +++ b/db/update9.5.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_bug` ADD `activatedDate` datetime NOT NULL AFTER `activatedCount`; diff --git a/db/zentao.sql b/db/zentao.sql index f0ca787360..518462e434 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -68,6 +68,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( `color` char(7) NOT NULL, `confirmed` tinyint(1) NOT NULL default '0', `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, `mailto` text, `openedBy` varchar(30) NOT NULL default '', `openedDate` datetime NOT NULL, diff --git a/module/bug/config.php b/module/bug/config.php index ad1dc49272..5f95ff8482 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -202,6 +202,11 @@ $config->bug->datatable->fieldList['activatedCount']['fixed'] = 'no'; $config->bug->datatable->fieldList['activatedCount']['width'] = '80'; $config->bug->datatable->fieldList['activatedCount']['required'] = 'no'; +$config->bug->datatable->fieldList['activatedDate']['title'] = 'activatedDate'; +$config->bug->datatable->fieldList['activatedDate']['fixed'] = 'no'; +$config->bug->datatable->fieldList['activatedDate']['width'] = '90'; +$config->bug->datatable->fieldList['activatedDate']['required'] = 'no'; + $config->bug->datatable->fieldList['openedBy']['title'] = 'openedByAB'; $config->bug->datatable->fieldList['openedBy']['fixed'] = 'no'; $config->bug->datatable->fieldList['openedBy']['width'] = '80'; diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index bef495c40a..613c15c005 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -32,6 +32,7 @@ $lang->bug->status = 'Status'; $lang->bug->statusAB = 'Status'; $lang->bug->activatedCount = 'Active'; $lang->bug->activatedCountAB = 'Active'; +$lang->bug->activatedDate = 'Active On'; $lang->bug->confirmed = 'Confirmed'; $lang->bug->toTask = 'Convert to Task'; $lang->bug->toStory = 'Convert to Story'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index ffeb250587..bdca46ec46 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -32,6 +32,7 @@ $lang->bug->status = 'Bug状态'; $lang->bug->statusAB = '状态'; $lang->bug->activatedCount = '激活次数'; $lang->bug->activatedCountAB = '激活次数'; +$lang->bug->activatedDate = '激活日期'; $lang->bug->confirmed = '是否确认'; $lang->bug->toTask = '转任务'; $lang->bug->toStory = '转需求'; diff --git a/module/bug/lang/zh-tw.php b/module/bug/lang/zh-tw.php index 0bb076e27a..fbec0b343d 100644 --- a/module/bug/lang/zh-tw.php +++ b/module/bug/lang/zh-tw.php @@ -32,6 +32,7 @@ $lang->bug->status = 'Bug狀態'; $lang->bug->statusAB = '狀態'; $lang->bug->activatedCount = '激活次數'; $lang->bug->activatedCountAB = '激活次數'; +$lang->bug->activatedDate = '激活日期'; $lang->bug->confirmed = '是否確認'; $lang->bug->toTask = '轉任務'; $lang->bug->toStory = '轉需求'; diff --git a/module/bug/model.php b/module/bug/model.php index eb92324173..e3527c97d9 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -976,6 +976,7 @@ class bugModel extends model ->add('toStory', 0) ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) + ->add('activatedDate', $now) ->join('openedBuild', ',') ->remove('comment,files,labels') ->get(); @@ -2300,12 +2301,12 @@ class bugModel extends model /** * Print cell data. - * - * @param object $col - * @param object $bug - * @param array $users - * @param array $builds - * @param array $branches + * + * @param object $col + * @param object $bug + * @param array $users + * @param array $builds + * @param array $branches * @access public * @return void */ @@ -2357,6 +2358,9 @@ class bugModel extends model case 'activatedCount': echo $bug->activatedCount; break; + case 'activatedDate': + echo substr($bug->activatedDate, 5, 11); + break; case 'openedBy': echo zget($users, $bug->openedBy); break; diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index ff4b27ba10..24427f43a6 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -168,6 +168,10 @@ bug->activatedCount;?> activatedCount;?> + + bug->activatedDate;?> + activatedDate;?> + bug->confirmed;?> bug->confirmedList[$bug->confirmed];?> diff --git a/module/common/model.php b/module/common/model.php index d41c0772be..8d627c8c7a 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -13,7 +13,7 @@ class commonModel extends model { /** * The construc method, to do some auto things. - * + * * @access public * @return void */ @@ -35,7 +35,7 @@ class commonModel extends model /** * Set the header info. - * + * * @access public * @return void */ @@ -54,7 +54,7 @@ class commonModel extends model * @return void */ public function setCompany() - { + { $httpHost = $this->server->http_host; if($this->session->company) @@ -118,7 +118,7 @@ class commonModel extends model /** * Load custom lang from db. - * + * * @access public * @return void */ @@ -134,9 +134,9 @@ class commonModel extends model /** * Juage a method of one module is open or not? - * - * @param string $module - * @param string $method + * + * @param string $module + * @param string $method * @access public * @return bool */ @@ -292,7 +292,7 @@ class commonModel extends model /** * Create menu item link - * + * * @param object $menuItemLink * @param boolean $isTutorialMode * @access public @@ -319,8 +319,8 @@ class commonModel extends model /** * Print the main menu. - * - * @param string $moduleName + * + * @param string $moduleName * @static * @access public * @return void @@ -352,7 +352,7 @@ class commonModel extends model /** * Print the search box. - * + * * @static * @access public * @return void @@ -377,7 +377,7 @@ class commonModel extends model $searchObject = $methodName; } if(empty($lang->searchObjects[$searchObject])) - { + { $searchObject = 'bug'; if($config->global->flow == 'onlyStory') $searchObject = 'story'; if($config->global->flow == 'onlyTask') $searchObject = 'task'; @@ -1118,9 +1118,9 @@ class commonModel extends model /** * Check the user has permisson of one method of one module. - * - * @param string $module - * @param string $method + * + * @param string $module + * @param string $method * @static * @access public * @return bool diff --git a/module/datatable/model.php b/module/datatable/model.php index 571da4d9a1..35d9bf5b63 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -40,8 +40,8 @@ class datatableModel extends model /** * Get save setting field. - * - * @param string $module + * + * @param string $module * @access public * @return object */ diff --git a/module/task/control.php b/module/task/control.php index 80a39bd23f..eba37a24f6 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -104,7 +104,7 @@ class task extends control $taskID = $taskID['id']; $actionID = $this->action->create('task', $taskID, 'Opened', ''); $this->task->sendmail($taskID, $actionID); - } + } /* If link from no head then reload*/ if(isonlybody()) @@ -487,8 +487,8 @@ class task extends control /** * View a task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ From 2cf53afcebfe071fb72afc45238b4f3748253f3f Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 14:14:36 +0800 Subject: [PATCH 07/21] * Finish task #3216. --- module/product/model.php | 8 ++++---- module/story/config.php | 5 +++++ module/story/model.php | 17 ++++++++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 2fdc6fc19a..c6c579931d 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -655,11 +655,11 @@ class productModel extends model /** * Get product stats. - * - * @param string $orderBy - * @param int $pager + * + * @param string $orderBy + * @param int $pager * @access public - * @return array + * @return array */ public function getStats($orderBy = 'order_desc', $pager = null, $status = 'noclosed') { diff --git a/module/story/config.php b/module/story/config.php index 115e3a0cf6..04152e193c 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -74,6 +74,11 @@ $config->story->datatable->fieldList['source']['fixed'] = 'no'; $config->story->datatable->fieldList['source']['width'] = '90'; $config->story->datatable->fieldList['source']['required'] = 'no'; +$config->story->datatable->fieldList['sourceNote']['title'] = 'sourceNote'; +$config->story->datatable->fieldList['sourceNote']['fixed'] = 'no'; +$config->story->datatable->fieldList['sourceNote']['width'] = '90'; +$config->story->datatable->fieldList['sourceNote']['required'] = 'no'; + $config->story->datatable->fieldList['status']['title'] = 'statusAB'; $config->story->datatable->fieldList['status']['fixed'] = 'no'; $config->story->datatable->fieldList['status']['width'] = '80'; diff --git a/module/story/model.php b/module/story/model.php index b8a97e59d3..601c73318d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2234,12 +2234,12 @@ class storyModel extends model /** * Print cell data - * - * @param object $col - * @param object $story - * @param array $users - * @param array $branches - * @param array $storyStages + * + * @param object $col + * @param object $story + * @param array $users + * @param array $branches + * @param array $storyStages * @param array $modulePairs * @param array $storyTasks * @param array $storyBugs @@ -2259,7 +2259,7 @@ class storyModel extends model if($id == 'title') $class .= ' text-left'; if($id == 'assignedTo' && $story->assignedTo == $account) $class .= ' red'; - $title = ''; + $title = ''; if($id == 'title') $title = $story->title; if($id == 'plan') $title = $story->planTitle; @@ -2288,6 +2288,9 @@ class storyModel extends model case 'source': echo zget($this->lang->story->sourceList, $story->source, $story->source); break; + case 'sourceNote': + echo $story->sourceNote; + break; case 'status': echo $this->lang->story->statusList[$story->status]; break; From e6c4b189f89b21fba990fb6a8116bceccc77cbca Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 14:52:25 +0800 Subject: [PATCH 08/21] * Finish task #3215. --- module/product/config.php | 6 ++++-- module/product/view/view.html.php | 14 +++++++------- module/story/view/create.html.php | 2 +- module/story/view/edit.html.php | 17 ++++++----------- module/story/view/view.html.php | 6 +++++- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/module/product/config.php b/module/product/config.php index be14f8dbe0..f0b1a036d8 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -23,8 +23,9 @@ $config->product->search['fields']['module'] = $lang->story->module; $config->product->search['fields']['plan'] = $lang->story->plan; $config->product->search['fields']['estimate'] = $lang->story->estimate; -$config->product->search['fields']['source'] = $lang->story->source; -$config->product->search['fields']['fromBug'] = $lang->story->fromBug; +$config->product->search['fields']['source'] = $lang->story->source; +$config->product->search['fields']['sourceNote'] = $lang->story->sourceNote; +$config->product->search['fields']['fromBug'] = $lang->story->fromBug; $config->product->search['fields']['openedBy'] = $lang->story->openedBy; $config->product->search['fields']['reviewedBy'] = $lang->story->reviewedBy; @@ -56,6 +57,7 @@ $config->product->search['params']['plan'] = array('operator' => '=', $config->product->search['params']['estimate'] = array('operator' => '=', 'control' => 'input', 'values' => ''); $config->product->search['params']['source'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->story->sourceList); +$config->product->search['params']['sourceNote'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); $config->product->search['params']['fromBug'] = array('operator' => '=', 'control' => 'input', 'values' => ''); $config->product->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index be79466c5c..c31108b359 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -64,31 +64,31 @@ product->name;?> deleted) echo "class='deleted text-danger'";?>>name;?> - + product->code;?> code;?> - + product->PO;?> PO);?> - + product->QD;?> QD);?> - + product->RD;?> RD);?> - + product->type;?> product->typeList[$product->type];?> - + product->status;?> product->statusList[$product->status];?> - + story->openedBy?> createdBy);?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index d89f8dccfd..b90a82ae0d 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -72,7 +72,7 @@
story->source?> story->sourceList, $source, "class='form-control'");?> - comment?> + story->sourceNote?>
diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 877706cc96..434f9ec4aa 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -108,17 +108,12 @@ story->source;?> - -
-
story->sourceList, $story->source, 'class=form-control');?>
-
-
- comment?> - sourceNote, "class='form-control' autocomplete='off'");?> -
-
-
- + story->sourceList, $story->source, 'class=form-control');?> + + + story->sourceNote;?> + sourceNote, "class='form-control' autocomplete='off'");?> + story->status;?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 6b3de95bd0..99cccbf9ab 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -188,7 +188,11 @@ story->source;?> - story->sourceList[$story->source] . ' ' . $story->sourceNote;?> + story->sourceList[$story->source];?> + + + story->sourceNote;?> + sourceNote;?> story->status;?> From 384208467f8282a204629137c28a31e8f1a56ca5 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 15:26:39 +0800 Subject: [PATCH 09/21] * Finish task #3217. --- module/testtask/control.php | 10 +++++----- module/testtask/view/caseheader.html.php | 2 +- module/testtask/view/groupcase.html.php | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index b5fdf24b70..fd600f5313 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -349,9 +349,9 @@ class testtask extends control /** * Group case. - * - * @param int $taskID - * @param string $groupBy + * + * @param int $taskID + * @param string $groupBy * @access public * @return void */ @@ -401,8 +401,8 @@ class testtask extends control /** * Edit a test task. - * - * @param int $taskID + * + * @param int $taskID * @access public * @return void */ diff --git a/module/testtask/view/caseheader.html.php b/module/testtask/view/caseheader.html.php index 40dcdb0012..11a734dad4 100644 --- a/module/testtask/view/caseheader.html.php +++ b/module/testtask/view/caseheader.html.php @@ -51,7 +51,7 @@ echo "
"; common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'button', 'link'); common::printIcon('testcase', 'export', "productID=$productID&orderBy=`case`_desc&taskID=$task->id", '', 'button', '', '', 'iframe export'); - common::printIcon('testtask', 'report', "productID=$productID&taskID=$task->id&browseType=$browseType&branchID=$task->branch&moduleID=$moduleID"); + common::printIcon('testtask', 'report', "productID=$productID&taskID=$task->id&browseType=$browseType&branchID=$task->branch&moduleID=" + empty($moduleID) ? '' : $moduleID); echo '
'; echo "
"; common::printRPN($this->session->testtaskList, ''); diff --git a/module/testtask/view/groupcase.html.php b/module/testtask/view/groupcase.html.php index 4b6c7db253..3349b3ecd6 100644 --- a/module/testtask/view/groupcase.html.php +++ b/module/testtask/view/groupcase.html.php @@ -29,7 +29,7 @@ testcase->bugsAB;?> testcase->resultsAB;?> testcase->stepNumberAB;?> - actions;?> + actions;?> @@ -54,6 +54,7 @@ results) ? html::a($this->createLink('testtask', 'results', "runID={$run->id}&caseID={$run->case}"), $run->results, '', "class='iframe'") : $run->results;?> stepNumber;?> + id&caseID=$run->case&version=$run->caseVersion", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");?> case", '', 'list');?> case", '', 'list', '', 'hiddenwin');?> From c10a3cb7b514aaa815e7014ee73dc1818359ebff Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 12 Sep 2017 16:08:41 +0800 Subject: [PATCH 10/21] * Finish task #3226. --- module/task/config.php | 2 +- module/task/control.php | 21 +++++++++++++++++++++ module/task/model.php | 12 ++++++------ 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/module/task/config.php b/module/task/config.php index fe51a001a9..b5bbbc3481 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -30,7 +30,7 @@ $config->task->editor->cancel = array('id' => 'comment', 'tools' => 'simpleToo $config->task->editor->pause = array('id' => 'comment', 'tools' => 'simpleTools'); $config->task->exportFields = ' - id, project, module, story, + id, project, module, progess, story, name, desc, type, pri,estStarted, realStarted, deadline, status,estimate, consumed, left, mailto, diff --git a/module/task/control.php b/module/task/control.php index eba37a24f6..c6d1475565 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1150,6 +1150,27 @@ class task extends control $tasks = $this->dao->select('*')->from(TABLE_TASK)->alias('t1')->where($this->session->taskQueryCondition) ->beginIF($this->post->exportType == 'selected')->andWhere('t1.id')->in($this->cookie->checkedItem)->fi() ->orderBy($orderBy)->fetchAll('id'); + + foreach($tasks as $key => $task) + { + /* Compute task progess. */ + if($task->consumed == 0 and $task->left == 0) + { + $task->progess = 0; + } + elseif($task->consumed != 0 and $task->left == 0) + { + $task->progess = 100; + } + else + { + $task->progess = round($task->consumed / ($task->consumed + $task->left), 2) * 100; + } + + $task->progess .= '%'; + + $tasks[$key] = $task; + } } else { diff --git a/module/task/model.php b/module/task/model.php index 72f1752d83..e2fa5cc836 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1215,25 +1215,25 @@ class taskModel extends model /** * Process a task, judge it's status. - * - * @param object $task + * + * @param object $task * @access private * @return object */ public function processTask($task) { $today = helper::today(); - + /* Delayed or not?. */ if($task->status !== 'done' and $task->status !== 'cancel' and $task->status != 'closed') { if($task->deadline != '0000-00-00') { $delay = helper::diffDate($today, $task->deadline); - if($delay > 0) $task->delay = $delay; - } + if($delay > 0) $task->delay = $delay; + } } - + /* Story changed or not. */ $task->needConfirm = false; if($task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion) $task->needConfirm = true; From 479a1b1ea86a662c032dad979888238e8aee79e0 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Wed, 13 Sep 2017 09:39:11 +0800 Subject: [PATCH 11/21] * Finish task #3218. --- module/custom/control.php | 2 +- module/report/control.php | 4 ++-- module/report/js/bugassign.js | 4 ++++ module/report/js/bugcreate.js | 5 +++++ module/report/js/productsummary.js | 5 +++++ module/report/js/projectdeviation.js | 5 +++++ module/report/js/workload.js | 5 +++++ module/report/view/projectdeviation.html.php | 2 +- 8 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 module/report/js/bugassign.js diff --git a/module/custom/control.php b/module/custom/control.php index 534dda7d3d..bede50f426 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -120,7 +120,7 @@ class custom extends control /* Fix bug #942. */ if($field == 'priList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->priListKey)); if($module == 'bug' and $field == 'severityList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->severityListKey)); - if(!empty($key) and !validater::checkCode($key)) die(js::alert($this->lang->custom->notice->keyList)); + if(!empty($key) and $key != 'n/a' and !validater::checkCode($key)) die(js::alert($this->lang->custom->notice->keyList)); /* the length of role is 20, check it when save. */ if($module == 'user' and $field == 'roleList' and strlen($key) > 20) die(js::alert($this->lang->custom->notice->userRole)); diff --git a/module/report/control.php b/module/report/control.php index 022a508393..3b39da197c 100644 --- a/module/report/control.php +++ b/module/report/control.php @@ -21,10 +21,10 @@ class report extends control { $this->locate(inlink('productSummary')); } - + /** * Project deviation report. - * + * * @access public * @return void */ diff --git a/module/report/js/bugassign.js b/module/report/js/bugassign.js new file mode 100644 index 0000000000..510a3b4eb0 --- /dev/null +++ b/module/report/js/bugassign.js @@ -0,0 +1,4 @@ +$(document).ready(function() +{ + setTimeout(function(){fixedTheadOfList('#bugAssign')}, 100); +}); diff --git a/module/report/js/bugcreate.js b/module/report/js/bugcreate.js index fccbc767b8..bbf5e55562 100644 --- a/module/report/js/bugcreate.js +++ b/module/report/js/bugcreate.js @@ -1,3 +1,8 @@ +$(document).ready(function() +{ + setTimeout(function(){fixedTheadOfList('#bug')}, 100); +}); + function changeParams(obj) { var begin = $('.main .row').find('#begin').val(); diff --git a/module/report/js/productsummary.js b/module/report/js/productsummary.js index 26199a6d7f..6b503853c5 100644 --- a/module/report/js/productsummary.js +++ b/module/report/js/productsummary.js @@ -1,3 +1,8 @@ +$(document).ready(function() +{ + setTimeout(function(){fixedTheadOfList('#product')}, 100); +}); + $('#conditions input:checkbox').change(function() { var conditions = ''; diff --git a/module/report/js/projectdeviation.js b/module/report/js/projectdeviation.js index 3147afac24..b792d27729 100644 --- a/module/report/js/projectdeviation.js +++ b/module/report/js/projectdeviation.js @@ -1,3 +1,8 @@ +$(document).ready(function() +{ + setTimeout(function(){fixedTheadOfList('#projectList')}, 100); +}); + function changeDate(begin, end) { if(begin.indexOf('-') != -1) diff --git a/module/report/js/workload.js b/module/report/js/workload.js index c9613f590c..2a2d960b64 100644 --- a/module/report/js/workload.js +++ b/module/report/js/workload.js @@ -1,3 +1,8 @@ +$(document).ready(function() +{ + setTimeout(function(){fixedTheadOfList('#workload')}, 100); +}); + function changeParams(obj) { var begin = $('.main .row').find('#begin').val(); diff --git a/module/report/view/projectdeviation.html.php b/module/report/view/projectdeviation.html.php index 13a667a438..fec42b85ec 100644 --- a/module/report/view/projectdeviation.html.php +++ b/module/report/view/projectdeviation.html.php @@ -21,7 +21,7 @@ report->to;?>
- +
From f1efc0e51e8dc8fcfc37a8ac706e1b7a17887f29 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Wed, 13 Sep 2017 16:28:56 +0800 Subject: [PATCH 12/21] * Finish task #3219. --- module/bug/control.php | 13 +++++++++---- module/bug/js/common.js | 2 +- module/bug/view/create.html.php | 10 +++++----- module/story/control.php | 6 +++++- module/story/view/create.html.php | 2 +- module/task/control.php | 1 + module/task/js/create.js | 2 +- module/task/view/create.html.php | 11 ++++++----- 8 files changed, 29 insertions(+), 18 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 4b7b5632d0..3694f79dba 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -264,6 +264,8 @@ class bug extends control $keywords = ''; $severity = 3; $type = 'codeerror'; + $pri = ''; + $color = ''; /* Parse the extras. */ $extras = str_replace(array(',', ' '), array('&', ''), $extras); @@ -273,7 +275,7 @@ class bug extends control if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version));// If not set runID but set caseID, get the result info by resultID and case info. /* If bugID setted, use this bug as template. */ - if(isset($bugID)) + if(isset($bugID)) { $bug = $this->bug->getById($bugID); extract((array)$bug); @@ -286,6 +288,7 @@ class bug extends control $type = $bug->type; $assignedTo = $bug->assignedTo; $deadline = $bug->deadline; + $color = $bug->color; } /* If projectID is setted, get builds and stories of this project. */ @@ -302,13 +305,13 @@ class bug extends control /* Set team members of the latest project as assignedTo list. */ $latestProject = $this->product->getLatestProject($productID); - if(!empty($latestProject)) + if(!empty($latestProject)) { $projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted'); } else { - $projectMembers = $this->view->users; + $projectMembers = $this->view->users; } /* Set custom. */ @@ -336,6 +339,7 @@ class bug extends control $this->view->version = $version; $this->view->testtask = $testtask; $this->view->bugTitle = $title; + $this->view->pri = $pri; $this->view->steps = htmlspecialchars($steps); $this->view->os = $os; $this->view->browser = $browser; @@ -348,6 +352,7 @@ class bug extends control $this->view->type = $type; $this->view->branch = $branch; $this->view->branches = $branches; + $this->view->color = $color; $this->display(); } @@ -1443,7 +1448,7 @@ class bug extends control if(isset($bugLang->statusList[$bug->status])) $bug->status = $bugLang->statusList[$bug->status]; if(isset($bugLang->confirmedList[$bug->confirmed])) $bug->confirmed = $bugLang->confirmedList[$bug->confirmed]; if(isset($bugLang->resolutionList[$bug->resolution])) $bug->resolution = $bugLang->resolutionList[$bug->resolution]; - + if(isset($users[$bug->openedBy])) $bug->openedBy = $users[$bug->openedBy]; if(isset($users[$bug->assignedTo])) $bug->assignedTo = $users[$bug->assignedTo]; if(isset($users[$bug->resolvedBy])) $bug->resolvedBy = $users[$bug->resolvedBy]; diff --git a/module/bug/js/common.js b/module/bug/js/common.js index fdd680d538..e8dc98b4bf 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -12,7 +12,7 @@ $(function() oldStoryID = $('#story').val() || 0; oldProjectID = 0; oldOpenedBuild = ''; - oldTaskID = 0; + oldTaskID = $('#oldTaskID').val() || 0; if(!assignedto) setAssignedTo(moduleID, productID); notice(); } diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 337126c021..aac784b4ad 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -149,7 +149,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
- +
@@ -198,14 +198,14 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate); } ?> - bug->priList, '', "class='form-control minw-80px'");?> + bug->priList, $pri, "class='form-control minw-80px'");?> @@ -214,7 +214,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
-
+ diff --git a/module/story/control.php b/module/story/control.php index 793c8f5726..192504e807 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -116,12 +116,15 @@ class story extends control $verify = ''; $keywords = ''; $mailto = ''; + $color = ''; if($storyID > 0) { $story = $this->story->getByID($storyID); $planID = $story->plan; $source = $story->source; + $sourceNote = $story->sourceNote; + $color = $story->color; $pri = $story->pri; $productID = $story->product; $moduleID = $story->module; @@ -169,6 +172,7 @@ class story extends control $this->view->planID = $planID; $this->view->source = $source; $this->view->sourceNote = $sourceNote; + $this->view->color = $color; $this->view->pri = $pri; $this->view->branch = $branch; $this->view->branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array(); @@ -185,7 +189,7 @@ class story extends control $this->display(); } - + /** * Create a batch stories. * diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index b90a82ae0d..0d7b5c2980 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -95,7 +95,7 @@
- +
diff --git a/module/task/control.php b/module/task/control.php index c6d1475565..997f42859a 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -56,6 +56,7 @@ class task extends control $task->estStarted = ''; $task->deadline = ''; $task->mailto = ''; + $task->color = ''; if($taskID > 0) { $task = $this->task->getByID($taskID); diff --git a/module/task/js/create.js b/module/task/js/create.js index ca4275a57e..15e1321932 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -88,7 +88,7 @@ function setAfter() } else { - $('input[value="continueAdding"]').attr('checked', 'checked'); + if(!toTaskList) $('input[value="continueAdding"]').attr('checked', 'checked'); $('input[value="continueAdding"]').attr('disabled', false); } } diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 405ca81702..29e3ac66b8 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -14,6 +14,7 @@ +config->global->flow == 'onlyTask' || !empty($task->id));?>
@@ -63,7 +64,7 @@
- + name, "class='form-control' autocomplete='off'");?> config->global->flow != 'onlyTask'):?> task->copyStoryTitle;?> @@ -90,14 +91,14 @@
task->pri;?> - task->priList, '', "class='form-control'");?> + task->priList, $task->pri, "class='form-control'");?>
@@ -108,7 +109,7 @@
task->estimateAB;?> - task->hour}' autocomplete='off'");?> + estimate, "class='form-control' placeholder='{$lang->task->hour}' autocomplete='off'");?>
@@ -165,7 +166,7 @@
config->global->flow == 'onlyTask' ? "class='hidden'" : '';?>> - + From 239f0130fd79b519ff8a12ebaacef0ca4e37d83b Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Wed, 13 Sep 2017 17:06:00 +0800 Subject: [PATCH 13/21] * Finish task #3220. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index e2fa5cc836..74205b959c 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -51,7 +51,7 @@ class taskModel extends model /* Check duplicate task. */ if($task->type != 'affair') { - $result = $this->loadModel('common')->removeDuplicate('task', $task, "project=$projectID"); + $result = $this->loadModel('common')->removeDuplicate('task', $task, "project=$projectID and story=$task->story"); if($result['stop']) { $tasksID[$assignedTo] = array('status' => 'exists', 'id' => $result['duplicate']); From 33d1d0b2d0ba350c3b6bcd24ef4dd491f9ca46a3 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Wed, 13 Sep 2017 17:22:36 +0800 Subject: [PATCH 14/21] * Finish task #3221. --- module/story/css/create.css | 1 + module/story/view/create.html.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/css/create.css b/module/story/css/create.css index 0fbf857d0f..7e27395c0f 100644 --- a/module/story/css/create.css +++ b/module/story/css/create.css @@ -18,5 +18,6 @@ select {border:1px solid #ccc} .colorpicker.input-group-btn > .btn {border-right: none} +#branch_chosen.chosen-container .chosen-drop {min-width: 280px; border-top: 1px solid #ddd!important} #branch {border-left-width: 0px} #mailtoGroup .chosen-container-single a {border-left-width: 0px} diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 0d7b5c2980..22400d33a2 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -30,7 +30,7 @@ - + - + diff --git a/module/task/control.php b/module/task/control.php index 997f42859a..d30168efcf 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -168,9 +168,9 @@ class task extends control /** * Batch create task. - * - * @param int $projectID - * @param int $storyID + * + * @param int $projectID + * @param int $storyID * @access public * @return void */ diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 932bf12594..08f5aaa5ab 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -38,7 +38,14 @@ function copyStoryTitle(num) startPosition = storyTitle.indexOf(':') + 1; endPosition = storyTitle.lastIndexOf('['); storyTitle = storyTitle.substr(startPosition, endPosition - startPosition); + $('#name\\[' + num + '\\]').val(storyTitle); + $('#estimate\\[' + num + '\\]').val($('#storyEstimate' + num).val()); + $('#desc\\[' + num + '\\]').val($('#storyDesc' + num).val()); + + var storyPri = $('#storyPri' + num).val(); + if(storyPri == 0) $('#pri' + num ).val('3'); + if(storyPri != 0) $('#pri' + num ).val(storyPri); } /* Set the story module. */ @@ -47,11 +54,15 @@ function setStoryRelated(num) var storyID = $('#story' + num).val(); if(storyID) { - var link = createLink('story', 'ajaxGetModule', 'storyID=' + storyID); - $.get(link, function(moduleID) + var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID); + $.getJSON(link, function(storyInfo) { - $('#module' + num).val(parseInt(moduleID)); + $('#module' + num).val(parseInt(storyInfo.moduleID)); $('#module' + num).trigger("chosen:updated"); + + $('#storyEstimate' + num).val(storyInfo.estimate); + $('#storyPri' + num).val(storyInfo.pri); + $('#storyDesc' + num).val(storyInfo.spec); }); } } diff --git a/module/task/js/create.js b/module/task/js/create.js index 15e1321932..4057a21e75 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -40,10 +40,10 @@ function setStoryModule() var storyID = $('#story').val(); if(storyID) { - var link = createLink('story', 'ajaxGetModule', 'storyID=' + storyID); - $.get(link, function(moduleID) + var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID); + $.getJSON(link, function(storyInfo) { - $('#module').val(moduleID); + $('#module').val(storyInfo.moduleID); $("#module").trigger("chosen:updated"); }); } diff --git a/module/task/model.php b/module/task/model.php index 74205b959c..3e4294abd6 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -98,8 +98,8 @@ class taskModel extends model /** * Create a batch task. - * - * @param int $projectID + * + * @param int $projectID * @access public * @return void */ @@ -131,7 +131,7 @@ class taskModel extends model for($i = 0; $i < $batchNum; $i++) { $story = $tasks->story[$i] == 'ditto' ? $story : $tasks->story[$i]; - $module = $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i]; + $module = $tasks->module[$i] == 'ditto' ? $module : $tasks->module[$i]; $type = $tasks->type[$i] == 'ditto' ? $type : $tasks->type[$i]; $assignedTo = $tasks->assignedTo[$i] == 'ditto' ? $assignedTo: $tasks->assignedTo[$i]; @@ -176,7 +176,7 @@ class taskModel extends model $taskID = $this->dao->lastInsertID(); if($tasks->story[$i] != false) $this->story->setStage($tasks->story[$i]); $actionID = $this->action->create('task', $taskID, 'Opened', ''); - + $mails[$i] = new stdclass(); $mails[$i]->taskID = $taskID; $mails[$i]->actionID = $actionID; diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 7606501067..778732a8ce 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -80,6 +80,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; + diff --git a/module/testcase/control.php b/module/testcase/control.php index 05d1b5b4a8..ff5e4773c5 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -265,6 +265,7 @@ class testcase extends control $precondition = ''; $keywords = ''; $steps = array(); + $color = ''; /* If testcaseID large than 0, use this testcase as template. */ if($testcaseID > 0) @@ -279,8 +280,9 @@ class testcase extends control $precondition = $testcase->precondition; $keywords = $testcase->keywords; $steps = $testcase->steps; + $color = $testcase->color; } - + /* If bugID large than 0, use this bug as template. */ if($bugID > 0) { @@ -292,7 +294,7 @@ class testcase extends control $keywords = $bug->keywords; $steps = $this->testcase->createStepsFromBug($bug->steps); } - + /* Padding the steps to the default steps count. */ if(count($steps) < $this->config->testcase->defaultSteps) { @@ -332,6 +334,7 @@ class testcase extends control $this->view->currentModuleID = $currentModuleID ? $currentModuleID : (isset($story->module) ? $story->module : 0); $this->view->stories = $stories; $this->view->caseTitle = $caseTitle; + $this->view->color = $color; $this->view->type = $type; $this->view->stage = $stage; $this->view->pri = $pri; diff --git a/module/testcase/model.php b/module/testcase/model.php index 7958db676f..d677682bb0 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -73,7 +73,7 @@ class testcaseModel extends model /** * Create a case. - * + * * @param int $bugID * @access public * @return void @@ -1224,11 +1224,11 @@ class testcaseModel extends model /** * Print cell data - * - * @param object $col - * @param object $case - * @param array $users - * @param array $branches + * + * @param object $col + * @param object $case + * @param array $users + * @param array $branches * @access public * @return void */ diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index fec4b76e06..0de4f1996e 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -38,7 +38,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index b3d5c35d2b..fc4192bd38 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -68,9 +68,9 @@ { ob_start(); echo "
"; - common::printCommentIcon('doc'); - common::printIcon('doc', 'edit', $params); - common::printIcon('doc', 'delete', $params, '', 'button', '', 'hiddenwin'); + common::printCommentIcon('doc', $doc); + common::printIcon('doc', 'edit', $params, $doc); + common::printIcon('doc', 'delete', $params, $doc, 'button', '', 'hiddenwin'); echo '
'; echo "
"; common::printRPN($browseLink, $preAndNext); diff --git a/module/my/view/profile.html.php b/module/my/view/profile.html.php index 65d9a20ae0..666e0c54bd 100644 --- a/module/my/view/profile.html.php +++ b/module/my/view/profile.html.php @@ -54,6 +54,10 @@
+ + + + diff --git a/module/product/model.php b/module/product/model.php index c6c579931d..e98e20a91f 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -830,6 +830,8 @@ class productModel extends model { $action = strtolower($action); + if(!common::limitedUser($product)) return false; + if($action == 'close') return $product->status != 'closed'; return true; diff --git a/module/product/view/browsedata.html.php b/module/product/view/browsedata.html.php index 58a86d1727..fe73a5445a 100644 --- a/module/product/view/browsedata.html.php +++ b/module/product/view/browsedata.html.php @@ -85,7 +85,7 @@ ?> - + diff --git a/module/project/view/managemembers.html.php b/module/project/view/managemembers.html.php index 14e9340a06..58a1112c82 100644 --- a/module/project/view/managemembers.html.php +++ b/module/project/view/managemembers.html.php @@ -41,11 +41,12 @@ + - + account])) continue;?> account]);?> @@ -58,6 +59,7 @@ + @@ -73,6 +75,7 @@ + @@ -89,6 +92,7 @@ + @@ -105,6 +109,7 @@ + @@ -113,7 +118,7 @@ - @@ -131,6 +136,7 @@ + diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index fadb5d57c3..cf81b8a1ba 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -104,21 +104,21 @@ createLink('story', 'tasks', "storyID=$story->id&projectID=$project->id"); $storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0); - ?> + ?> diff --git a/module/project/view/taskheader.html.php b/module/project/view/taskheader.html.php index 685fd877ab..21227f499c 100644 --- a/module/project/view/taskheader.html.php +++ b/module/project/view/taskheader.html.php @@ -123,8 +123,8 @@
createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')) : '#'; + $misc = common::hasPriv('task', 'create', $project) ? "class='btn btn-primary'" : "class='btn btn-primary disabled'"; + $link = common::hasPriv('task', 'create', $project) ? $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')) : '#'; echo html::a($link, "" . $lang->task->create, '', $misc); ?> diff --git a/module/project/view/team.html.php b/module/project/view/team.html.php index 96fae08b99..f8e7464106 100644 --- a/module/project/view/team.html.php +++ b/module/project/view/team.html.php @@ -27,7 +27,7 @@ } else { - common::printLink('project', 'managemembers', "projectID=$project->id", $lang->project->manageMembers, '', "class='btn btn-primary manage-team-btn'"); + if($app->user->limitedUser === 'no') common::printLink('project', 'managemembers', "projectID=$project->id", $lang->project->manageMembers, '', "class='btn btn-primary manage-team-btn'"); } ?>
@@ -41,6 +41,7 @@
+ @@ -60,9 +61,10 @@ + - diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php index e24aec46b0..d565654f6e 100644 --- a/module/project/view/testtask.html.php +++ b/module/project/view/testtask.html.php @@ -50,12 +50,12 @@ diff --git a/module/testtask/model.php b/module/testtask/model.php index 104de76185..61ff1bb631 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1099,6 +1099,8 @@ class testtaskModel extends model { $action = strtolower($action); + if(!common::limitedUser($testtask)) return false; + if($action == 'start') return $testtask->status == 'wait'; if($action == 'block') return ($testtask->status == 'doing' || $testtask->status == 'wait'); if($action == 'activate') return ($testtask->status == 'blocked' || $testtask->status == 'done'); diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index 0bdeeb7a3f..4df556fd65 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -86,13 +86,13 @@ $status = $this->session->testTaskVersionStatus; + $lang->user->ditto)?> @@ -89,7 +90,8 @@ $minWidth = (count($visibleFields) > 5) ? 'w-150px' : ''; - + + diff --git a/module/user/view/batchedit.html.php b/module/user/view/batchedit.html.php index ee2624613e..c3a89db2ed 100644 --- a/module/user/view/batchedit.html.php +++ b/module/user/view/batchedit.html.php @@ -51,6 +51,7 @@ $minWidth = (count($visibleFields) > 7) ? 'w-120px' : ''; + $lang->user->ditto) + $depts;?> @@ -80,6 +81,7 @@ $minWidth = (count($visibleFields) > 7) ? 'w-120px' : ''; + diff --git a/module/user/view/create.html.php b/module/user/view/create.html.php index 95d34dd32f..db58bf376d 100644 --- a/module/user/view/create.html.php +++ b/module/user/view/create.html.php @@ -61,6 +61,11 @@ + + + + + diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php index 4a03320217..30f6be8ccd 100644 --- a/module/user/view/edit.html.php +++ b/module/user/view/edit.html.php @@ -71,6 +71,8 @@ + +
report->id;?>
bug->steps;?> @@ -250,7 +250,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate); bug->task?> - +
task->afterSubmit;?>task->afterChoices, $this->config->global->flow == 'onlyTask' ? 'toTaskList' : 'continueAdding');?>task->afterChoices, $this->config->global->flow == 'onlyTask' || !empty($task->id) ? 'toTaskList' : 'continueAdding');?>
- type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:120px'");?> + type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control chosen' style='width:120px'");?>
From 844ee7452f1aa1045ab5fa812bd58675e5f50cdd Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Thu, 14 Sep 2017 11:07:28 +0800 Subject: [PATCH 15/21] * Finish task #3224. --- module/story/control.php | 33 +++++++++++++++------------ module/story/view/create.html.php | 4 ++-- module/task/control.php | 6 ++--- module/task/js/batchcreate.js | 17 +++++++++++--- module/task/js/create.js | 6 ++--- module/task/model.php | 8 +++---- module/task/view/batchcreate.html.php | 1 + module/testcase/control.php | 7 ++++-- module/testcase/model.php | 12 +++++----- module/testcase/view/create.html.php | 4 ++-- 10 files changed, 59 insertions(+), 39 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 192504e807..9bf05c02f1 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -29,14 +29,14 @@ class story extends control /** * Create a story. - * - * @param int $productID - * @param int $branch - * @param int $moduleID - * @param int $storyID - * @param int $projectID - * @param int $bugID - * @param int $planID + * + * @param int $productID + * @param int $branch + * @param int $moduleID + * @param int $storyID + * @param int $projectID + * @param int $bugID + * @param int $planID * @access public * @return void */ @@ -1259,15 +1259,20 @@ class story extends control /** * AJAX: get module of a story. - * - * @param int $storyID + * + * @param int $storyID * @access public - * @return string + * @return string */ - public function ajaxGetModule($storyID) + public function ajaxGetInfo($storyID) { - $story = $this->story->getByID($storyID); - echo $story->module; + $story = $this->story->getByID($storyID); + + $storyInfo['moduleID'] = $story->module; + $storyInfo['estimate'] = $story->estimate; + $storyInfo['pri'] = $story->pri; + $storyInfo['spec'] = $story->spec; + echo json_encode($storyInfo); } /** diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 22400d33a2..3a9fffac93 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -141,11 +141,11 @@
story->spec;?> story->specTemplate) . "'");?>
story->verify;?>
testcase->module?> -
- + testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview'");?> From 26010c31672eed8c164a1eddf6bdb4a52c8778af Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Thu, 14 Sep 2017 14:37:32 +0800 Subject: [PATCH 16/21] * Finish task #3202. --- module/doc/control.php | 10 ++-- module/install/control.php | 7 +++ module/install/lang/en.php | 14 ++++++ module/install/lang/zh-cn.php | 14 ++++++ module/install/lang/zh-tw.php | 14 ++++++ module/install/model.php | 79 +++++++++++++++++++++++++++++- module/install/view/step1.html.php | 59 +++++++++++++++++++++- 7 files changed, 189 insertions(+), 8 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 9cb976bd6e..b443f82c54 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -13,7 +13,7 @@ class doc extends control { /** * Construct function, load user, tree, action auto. - * + * * @access public * @return void */ @@ -223,7 +223,7 @@ class doc extends control } die(js::locate($this->createLink($this->moduleName, 'browse', "libID=$libID"), 'parent.parent')); } - + $lib = $this->doc->getLibByID($libID); if(!empty($lib->product)) $this->view->product = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->eq($lib->product)->fetch(); if(!empty($lib->project)) $this->view->project = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->eq($lib->project)->fetch(); @@ -259,7 +259,7 @@ class doc extends control die(js::locate($this->createLink('doc', 'browse'), 'parent')); } } - + /** * Create a doc. * @@ -382,8 +382,8 @@ class doc extends control /** * View a doc. - * - * @param int $docID + * + * @param int $docID * @access public * @return void */ diff --git a/module/install/control.php b/module/install/control.php index 7bb3235fa6..2ca92fe337 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -70,6 +70,13 @@ class install extends control $this->view->pdoResult = $this->install->checkPDO(); $this->view->pdoMySQLResult = $this->install->checkPDOMySQL(); $this->view->jsonResult = $this->install->checkJSON(); + $this->view->opensslResult = $this->install->checkOpenssl(); + $this->view->mbstringResult = $this->install->checkMbstring(); + $this->view->zlibResult = $this->install->checkZlib(); + $this->view->curlResult = $this->install->checkCurl(); + $this->view->filterResult = $this->install->checkFilter(); + $this->view->gdResult = $this->install->checkGD(); + $this->view->iconvResult = $this->install->checkIconv(); $this->view->tmpRootInfo = $this->install->getTmpRoot(); $this->view->tmpRootResult = $this->install->checkTmpRoot(); $this->view->dataRootInfo = $this->install->getDataRoot(); diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 4148b13218..78305d7c53 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -62,6 +62,20 @@ $lang->install->pdoMySQL = 'PDO_MySQL'; $lang->install->pdoMySQLFail = 'Edit PHP ini file to load PDO_MySQL extsion.'; $lang->install->json = 'JSON Extension'; $lang->install->jsonFail = 'Edit the php.ini file to load JSON extension.'; +$lang->install->openssl = 'OPENSSL Extension'; +$lang->install->opensslFail = 'Edit the php.ini file to load openssl extension.'; +$lang->install->mbstring = 'MBSTRING Extension'; +$lang->install->mbstringFail = 'Edit the php.ini file to load mbstring extension.'; +$lang->install->zlib = 'ZLIB Extension'; +$lang->install->zlibFail = 'Edit the php.ini file to load zlib extension.'; +$lang->install->curl = 'CURL Extension'; +$lang->install->curlFail = 'Edit the php.ini file to load curl extension.'; +$lang->install->filter = 'FILTER Extension'; +$lang->install->filterFail = 'Edit the php.ini file to load filter extension.'; +$lang->install->gd = 'GD Extension'; +$lang->install->gdFail = 'Edit the php.ini file to load gd extension.'; +$lang->install->iconv = 'ICONV Extension'; +$lang->install->iconvFail = 'Edit the php.ini file to load iconv extension.'; $lang->install->tmpRoot = 'Temp File Directory'; $lang->install->dataRoot = 'Uploaded File Directory'; $lang->install->session = 'Session Save Path'; diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 7d3d16fa78..3eaf707f63 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -62,6 +62,20 @@ $lang->install->pdoMySQL = 'PDO_MySQL扩展'; $lang->install->pdoMySQLFail = '修改PHP配置文件,加载pdo_mysql扩展。'; $lang->install->json = 'JSON扩展'; $lang->install->jsonFail = '修改PHP配置文件,加载JSON扩展。'; +$lang->install->openssl = 'OPENSSL扩展'; +$lang->install->opensslFail = '修改PHP配置文件,加载OPENSSL扩展。'; +$lang->install->mbstring = 'MBSTRING扩展'; +$lang->install->mbstringFail = '修改PHP配置文件,加载MBSTRING扩展。'; +$lang->install->zlib = 'ZLIB扩展'; +$lang->install->zlibFail = '修改PHP配置文件,加载ZLIB扩展。'; +$lang->install->curl = 'CURL扩展'; +$lang->install->curlFail = '修改PHP配置文件,加载CURL扩展。'; +$lang->install->filter = 'FILTER扩展'; +$lang->install->filterFail = '修改PHP配置文件,加载FILTER扩展。'; +$lang->install->gd = 'GD扩展'; +$lang->install->gdFail = '修改PHP配置文件,加载GD扩展。'; +$lang->install->iconv = 'ICONV扩展'; +$lang->install->iconvFail = '修改PHP配置文件,加载ICONV扩展。'; $lang->install->tmpRoot = '临时文件目录'; $lang->install->dataRoot = '上传文件目录'; $lang->install->session = 'Session存储目录'; diff --git a/module/install/lang/zh-tw.php b/module/install/lang/zh-tw.php index 7f059367b6..4a8e772cd7 100644 --- a/module/install/lang/zh-tw.php +++ b/module/install/lang/zh-tw.php @@ -62,6 +62,20 @@ $lang->install->pdoMySQL = 'PDO_MySQL擴展'; $lang->install->pdoMySQLFail = '修改PHP配置檔案,加載pdo_mysql擴展。'; $lang->install->json = 'JSON擴展'; $lang->install->jsonFail = '修改PHP配置檔案,加載JSON擴展。'; +$lang->install->openssl = 'OPENSSL擴展'; +$lang->install->opensslFail = '修改PHP配置檔案,加載OPENSSL擴展。'; +$lang->install->mbstring = 'MBSTRING擴展'; +$lang->install->mbstringFail = '修改PHP配置檔案,加載MBSTRING擴展。'; +$lang->install->zlib = 'ZLIB擴展'; +$lang->install->zlibFail = '修改PHP配置檔案,加載ZLIB擴展。'; +$lang->install->curl = 'CURL擴展'; +$lang->install->curlFail = '修改PHP配置檔案,加載CURL擴展。'; +$lang->install->filter = 'FILTER擴展'; +$lang->install->filterFail = '修改PHP配置檔案,加載FILTER擴展。'; +$lang->install->gd = 'GD擴展'; +$lang->install->gdFail = '修改PHP配置檔案,加載GD擴展。'; +$lang->install->iconv = 'ICONV擴展'; +$lang->install->iconvFail = '修改PHP配置檔案,加載ICONV擴展。'; $lang->install->tmpRoot = '臨時檔案目錄'; $lang->install->dataRoot = '上傳檔案目錄'; $lang->install->session = 'Session存儲目錄'; diff --git a/module/install/model.php b/module/install/model.php index 682ceb9c97..e388fe6d68 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -90,7 +90,7 @@ class installModel extends model /** * Check json extension. - * + * * @access public * @return string ok|fail */ @@ -99,6 +99,83 @@ class installModel extends model return $result = extension_loaded('json') ? 'ok' : 'fail'; } + /** + * Check openssl extension. + * + * @access public + * @return string ok|fail + */ + public function checkOpenssl() + { + return $result = extension_loaded('openssl') ? 'ok' : 'fail'; + } + + /** + * Check mbstring extension. + * + * @access public + * @return string ok|fail + */ + public function checkMbstring() + { + return $result = extension_loaded('mbstring') ? 'ok' : 'fail'; + } + + /** + * Check zlib extension. + * + * @access public + * @return string ok|fail + */ + public function checkZlib() + { + return $result = extension_loaded('zlib') ? 'ok' : 'fail'; + } + + /** + * Check curl extension. + * + * @access public + * @return string ok|fail + */ + public function checkCurl() + { + return $result = extension_loaded('curl') ? 'ok' : 'fail'; + } + + /** + * Check filter extension. + * + * @access public + * @return string ok|fail + */ + public function checkFilter() + { + return $result = extension_loaded('filter') ? 'ok' : 'fail'; + } + + /** + * Check gd extension. + * + * @access public + * @return string ok|fail + */ + public function checkGD() + { + return $result = extension_loaded('gd') ? 'ok' : 'fail'; + } + + /** + * Check iconv extension. + * + * @access public + * @return string ok|fail + */ + public function checkIconv() + { + return $result = extension_loaded('iconv') ? 'ok' : 'fail'; + } + /** * Get tempRoot info. * diff --git a/module/install/view/step1.html.php b/module/install/view/step1.html.php index 735e3dbc29..87d6e9dd49 100644 --- a/module/install/view/step1.html.php +++ b/module/install/view/step1.html.php @@ -47,6 +47,48 @@
install->$jsonResult;?> install->jsonFail;?>
install->openssl;?>install->loaded) : printf($lang->install->unloaded);?>install->$opensslResult;?>install->opensslFail;?>
install->mbstring;?>install->loaded) : printf($lang->install->unloaded);?>install->$mbstringResult;?>install->mbstringFail;?>
install->zlib;?>install->loaded) : printf($lang->install->unloaded);?>install->$zlibResult;?>install->zlibFail;?>
install->curl;?>install->loaded) : printf($lang->install->unloaded);?>install->$curlResult;?>install->curlFail;?>
install->filter;?>install->loaded) : printf($lang->install->unloaded);?>install->$filterResult;?>install->filterFail;?>
install->gd;?>install->loaded) : printf($lang->install->unloaded);?>install->$gdResult;?>install->gdFail;?>
install->iconv;?>install->loaded) : printf($lang->install->unloaded);?>install->$iconvResult;?>install->iconvFail;?>
install->tmpRoot;?> @@ -110,7 +152,20 @@ From 2dfce57503d8f749b557e7142f064c357f36450d Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Thu, 14 Sep 2017 15:21:51 +0800 Subject: [PATCH 17/21] * Finish task #3214. --- module/extension/lang/en.php | 3 +++ module/extension/lang/zh-cn.php | 3 +++ module/extension/lang/zh-tw.php | 3 +++ module/extension/view/obtain.html.php | 9 ++++++--- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/module/extension/lang/en.php b/module/extension/lang/en.php index cfed75c605..bf7d9a63fc 100644 --- a/module/extension/lang/en.php +++ b/module/extension/lang/en.php @@ -55,6 +55,9 @@ $lang->extension->publicList[1] = 'Auto'; $lang->extension->compatibleList[0] = 'Unknown'; $lang->extension->compatibleList[1] = 'Compatible'; +$lang->extension->obtainOfficial[0] = 'Third party'; +$lang->extension->obtainOfficial[1] = 'Official'; + $lang->extension->byDownloads = 'Downloads'; $lang->extension->byAddedTime = 'Latest Added'; $lang->extension->byUpdatedTime = 'Latest Update'; diff --git a/module/extension/lang/zh-cn.php b/module/extension/lang/zh-cn.php index c345b4f8be..b182beefb5 100644 --- a/module/extension/lang/zh-cn.php +++ b/module/extension/lang/zh-cn.php @@ -55,6 +55,9 @@ $lang->extension->publicList[1] = '直接下载'; $lang->extension->compatibleList[0] = '未知'; $lang->extension->compatibleList[1] = '兼容'; +$lang->extension->obtainOfficial[0] = '第三方'; +$lang->extension->obtainOfficial[1] = '官方'; + $lang->extension->byDownloads = '最多下载'; $lang->extension->byAddedTime = '最新添加'; $lang->extension->byUpdatedTime = '最近更新'; diff --git a/module/extension/lang/zh-tw.php b/module/extension/lang/zh-tw.php index a46ce94094..d4a863996c 100644 --- a/module/extension/lang/zh-tw.php +++ b/module/extension/lang/zh-tw.php @@ -55,6 +55,9 @@ $lang->extension->publicList[1] = '直接下載'; $lang->extension->compatibleList[0] = '未知'; $lang->extension->compatibleList[1] = '兼容'; +$lang->extension->obtainOfficial[0] = '第三方'; +$lang->extension->obtainOfficial[1] = '官方'; + $lang->extension->byDownloads = '最多下載'; $lang->extension->byAddedTime = '最新添加'; $lang->extension->byUpdatedTime = '最近更新'; diff --git a/module/extension/view/obtain.html.php b/module/extension/view/obtain.html.php index f399f7ad60..705ff316d1 100644 --- a/module/extension/view/obtain.html.php +++ b/module/extension/view/obtain.html.php @@ -38,7 +38,7 @@
- currentRelease; $latestRelease = isset($extension->latestRelease) ? $extension->latestRelease : ''; ?> @@ -51,7 +51,10 @@ printf($lang->extension->latest, $latestRelease->viewLink, $latestRelease->releaseVersion, $latestRelease->zentaoCompatible); }?> -
name . "($currentRelease->releaseVersion)";?>
+
+ name . "($currentRelease->releaseVersion)";?> + '>extension->obtainOfficial[$extension->offcial];?> +
abstract;?> @@ -62,7 +65,7 @@ echo "{$lang->extension->author}: {$extension->author} "; echo "{$lang->extension->downloads}: {$extension->downloads} "; echo "{$lang->extension->compatible}: {$lang->extension->compatibleList[$currentRelease->compatible]} "; - + echo " {$lang->extension->depends}: "; if(!empty($currentRelease->depends)) { From d343eebc93b633fd7efb5b0a02dd0f90428d9416 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Fri, 15 Sep 2017 09:35:40 +0800 Subject: [PATCH 18/21] * Finish task #3222. --- config/filter.php | 1 - module/testtask/control.php | 25 +++++++++++++++---------- module/testtask/js/browse.js | 26 ++++++++++++++++++++++++++ module/testtask/lang/en.php | 3 +++ module/testtask/lang/zh-cn.php | 3 +++ module/testtask/lang/zh-tw.php | 3 +++ module/testtask/model.php | 4 +++- module/testtask/view/browse.html.php | 18 +++++++++++++----- 8 files changed, 66 insertions(+), 17 deletions(-) diff --git a/config/filter.php b/config/filter.php index 868577e010..99e4c601cd 100644 --- a/config/filter.php +++ b/config/filter.php @@ -158,7 +158,6 @@ $filter->todo->export->cookie['checkedItem'] = 'reg::checked'; $filter->user->login->cookie['keepLogin'] = 'equal::on'; - $filter->block->default->get['hash'] = 'reg::md5'; $filter->block->main->get['blockid'] = 'code'; $filter->block->main->get['blockTitle'] = 'reg::any'; diff --git a/module/testtask/control.php b/module/testtask/control.php index fd600f5313..2859cf64c0 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -39,18 +39,18 @@ class testtask extends control } /** - * Browse test tasks. - * - * @param int $productID - * @param string $type - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * Browse test tasks. + * + * @param int $productID + * @param string $type + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ - public function browse($productID = 0, $branch = '', $type = 'local,wait', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $branch = '', $type = 'local,wait', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $beginTime = 0, $endTime = 0) { /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true)); @@ -59,6 +59,9 @@ class testtask extends control $this->session->set('testTaskVersionScope', $scopeAndStatus[0]); $this->session->set('testTaskVersionStatus', $scopeAndStatus[1]); + $beginTime = $beginTime ? date('Y-m-d', strtotime($beginTime)) : ''; + $endTime = $endTime ? date('Y-m-d', strtotime($endTime)) : ''; + /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); if($branch === '') $branch = (int)$this->cookie->preBranch; @@ -77,10 +80,12 @@ class testtask extends control $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; $this->view->orderBy = $orderBy; - $this->view->tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus); + $this->view->tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime); $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->pager = $pager; $this->view->branch = $branch; + $this->view->beginTime = $beginTime; + $this->view->endTime = $endTime; $this->display(); } diff --git a/module/testtask/js/browse.js b/module/testtask/js/browse.js index a83e3be0cb..cb53ac254d 100644 --- a/module/testtask/js/browse.js +++ b/module/testtask/js/browse.js @@ -6,3 +6,29 @@ $(document).ready(function() $('#modulemenu > .nav > li[data-id=' + status + ']').addClass('active'); } }); + +function changeDate(begin, end, condition) +{ + if(begin.indexOf('-') != -1) + { + var beginarray = begin.split("-"); + var begin = ''; + for(i=0 ; i < beginarray.length ; i++) + { + begin = begin + beginarray[i]; + } + } + if(end.indexOf('-') != -1) + { + var endarray = end.split("-"); + var end = ''; + for(i=0 ; i < endarray.length ; i++) + { + end = end + endarray[i]; + } + } + + condition = condition + '&beginTime=' + begin + '&endTime=' + end; + link = createLink('testtask', 'browse', condition); + location.href=link; +} diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 7c5f2d630c..1ea4461b91 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -69,6 +69,9 @@ $lang->testtask->lastRunner = 'Last Runner'; $lang->testtask->lastRunDate = 'Last RunDate'; $lang->testtask->date = 'Date'; +$lang->testtask->beginAndEnd = 'Date'; +$lang->testtask->to = 'To'; + $lang->testtask->legendDesc = 'Desc'; $lang->testtask->legendReport = 'Report'; $lang->testtask->legendBasicInfo = 'Basic Info'; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index a48b65fced..956a6e97d4 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -69,6 +69,9 @@ $lang->testtask->lastRunner = '最后执行人'; $lang->testtask->lastRunDate = '最后执行时间'; $lang->testtask->date = '测试时间'; +$lang->testtask->beginAndEnd = '起止时间'; +$lang->testtask->to = '至'; + $lang->testtask->legendDesc = '版本描述'; $lang->testtask->legendReport = '测试总结'; $lang->testtask->legendBasicInfo = '基本信息'; diff --git a/module/testtask/lang/zh-tw.php b/module/testtask/lang/zh-tw.php index 148e8f68ce..542cb14a2c 100644 --- a/module/testtask/lang/zh-tw.php +++ b/module/testtask/lang/zh-tw.php @@ -69,6 +69,9 @@ $lang->testtask->lastRunner = '最後執行人'; $lang->testtask->lastRunDate = '最後執行時間'; $lang->testtask->date = '測試時間'; +$lang->testtask->beginAndEnd = '起止時間'; +$lang->testtask->to = '至'; + $lang->testtask->legendDesc = '版本描述'; $lang->testtask->legendReport = '測試總結'; $lang->testtask->legendBasicInfo = '基本信息'; diff --git a/module/testtask/model.php b/module/testtask/model.php index a94bab9b27..104de76185 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -97,7 +97,7 @@ class testtaskModel extends model * @access public * @return array */ - public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array()) + public function getProductTasks($productID, $branch = 0, $orderBy = 'id_desc', $pager = null, $scopeAndStatus = array(), $beginTime = 0, $endTime = 0) { if($this->config->global->flow == 'onlyTest') { @@ -128,6 +128,8 @@ class testtaskModel extends model ->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in(array('blocked','doing','wait','done'))->fi() ->beginIF($scopeAndStatus[1] != 'totalStatus')->andWhere('t1.status')->eq($scopeAndStatus[1])->fi() ->beginIF($branch)->andWhere("if(t4.branch, t4.branch, t5.branch) = '$branch'")->fi() + ->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi() + ->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index 42e9065a20..0bdeeb7a3f 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -11,10 +11,11 @@ */ ?> + testtask->confirmDelete)?> config->global->flow);?> -session->testTaskVersionScope; +session->testTaskVersionScope; $status = $this->session->testTaskVersionStatus; ?> @@ -26,21 +27,28 @@ $status = $this->session->testTaskVersionStatus; testtask->all;?> -
  • testtask->wait);?>
  • testtask->testing);?>
  • testtask->blocked);?>
  • testtask->done);?>
  • testtask->totalStatus);?>
  • +
  • + recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID"?> +
    + testtask->beginAndEnd;?> +
    + testtask->to;?> +
    +
    +
  • -
    From 41a2fc9a8f2a66a245195a9eb5444c4adc957db7 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 19 Sep 2017 13:56:39 +0800 Subject: [PATCH 19/21] * Finish task #3210. --- db/update9.5.sql | 2 + lib/base/front/front.class.php | 2 +- module/bug/model.php | 2 + module/bug/view/browsedata.html.php | 2 +- module/bug/view/view.html.php | 12 +-- module/build/model.php | 15 +++ module/build/view/view.html.php | 8 +- module/common/model.php | 109 +++++++++++++++------ module/doc/model.php | 15 +++ module/doc/view/browse.html.php | 4 +- module/doc/view/showfiles.html.php | 4 +- module/doc/view/view.html.php | 6 +- module/my/view/profile.html.php | 4 + module/product/model.php | 2 + module/product/view/browsedata.html.php | 2 +- module/product/view/view.html.php | 4 +- module/productplan/control.php | 12 +-- module/productplan/model.php | 21 +++- module/productplan/view/browse.html.php | 4 +- module/productplan/view/view.html.php | 6 +- module/project/control.php | 25 ++--- module/project/lang/en.php | 4 + module/project/lang/zh-cn.php | 6 +- module/project/lang/zh-tw.php | 6 +- module/project/model.php | 38 +++++-- module/project/view/bug.html.php | 2 +- module/project/view/build.html.php | 10 +- module/project/view/linkstory.html.php | 2 +- module/project/view/managemembers.html.php | 10 +- module/project/view/story.html.php | 16 +-- module/project/view/task.html.php | 10 +- module/project/view/taskdata.html.php | 2 +- module/project/view/taskheader.html.php | 8 +- module/project/view/team.html.php | 8 +- module/project/view/testtask.html.php | 10 +- module/project/view/view.html.php | 4 +- module/release/model.php | 15 +++ module/release/view/browse.html.php | 6 +- module/release/view/view.html.php | 6 +- module/story/lang/en.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/lang/zh-tw.php | 1 + module/story/model.php | 40 ++++---- module/story/view/view.html.php | 24 ++--- module/task/model.php | 2 + module/task/view/view.html.php | 8 +- module/testcase/model.php | 2 + module/testcase/view/browsedata.html.php | 6 +- module/testcase/view/view.html.php | 18 ++-- module/testsuite/model.php | 15 +++ module/testsuite/view/browse.html.php | 6 +- module/testsuite/view/view.html.php | 6 +- module/testtask/model.php | 2 + module/testtask/view/browse.html.php | 10 +- module/testtask/view/casesdata.html.php | 6 +- module/testtask/view/view.html.php | 4 +- module/user/config.php | 4 +- module/user/lang/zh-cn.php | 17 ++-- module/user/model.php | 11 ++- module/user/view/batchcreate.html.php | 4 +- module/user/view/batchedit.html.php | 2 + module/user/view/create.html.php | 5 + module/user/view/edit.html.php | 6 +- 63 files changed, 418 insertions(+), 207 deletions(-) diff --git a/db/update9.5.sql b/db/update9.5.sql index cc8564ed48..41d9aef0af 100644 --- a/db/update9.5.sql +++ b/db/update9.5.sql @@ -1 +1,3 @@ ALTER TABLE `zt_bug` ADD `activatedDate` datetime NOT NULL AFTER `activatedCount`; +ALTER TABLE `zt_user` ADD `limitedUser` varchar(8) NOT NULL default 'no' AFTER `role`; +ALTER TABLE `zt_team` ADD `limitedUser` varchar(8) NOT NULL default 'no' AFTER `role`; diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index a7afcbbfb5..4200dcb6a8 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -112,7 +112,7 @@ class baseHTML if(empty($title)) $title = $href; $newline = $newline ? "\n" : ''; - + return "$title$newline"; } diff --git a/module/bug/model.php b/module/bug/model.php index e3527c97d9..c52e931da7 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2243,6 +2243,8 @@ class bugModel extends model { $action = strtolower($action); + if(!common::limitedUser($object)) return false; + if($action == 'confirmbug') return $object->status == 'active' and $object->confirmed == 0; if($action == 'resolve') return $object->status == 'active'; if($action == 'close') return $object->status == 'resolved'; diff --git a/module/bug/view/browsedata.html.php b/module/bug/view/browsedata.html.php index 39d2aaca3d..46c59e165b 100644 --- a/module/bug/view/browsedata.html.php +++ b/module/bug/view/browsedata.html.php @@ -100,7 +100,7 @@ id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); - common::printIcon('bug', 'assignTo', $params, '', 'list', '', '', 'iframe', true); + common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'edit', $params, $bug, 'list'); diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 24427f43a6..971a665670 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -31,20 +31,20 @@ ob_start(); echo "
    "; common::printIcon('bug', 'confirmBug', $params, $bug, 'button', 'search', '', 'iframe', true); - common::printIcon('bug', 'assignTo', $params, '', 'button', '', '', 'iframe', true); + common::printIcon('bug', 'assignTo', $params, $bug, 'button', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'button', '', '', 'iframe showinonlybody', true); common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true); common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true); if($this->config->global->flow != 'onlyTest') common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']); - common::printIcon('bug', 'createCase', $convertParams, '', 'button', 'sitemap'); + common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap'); echo '
    '; echo "
    "; - common::printIcon('bug', 'edit', $params); - common::printCommentIcon('bug'); - common::printIcon('bug', 'create', $copyParams, '', 'button', 'copy'); - common::printIcon('bug', 'delete', $params, '', 'button', '', 'hiddenwin'); + common::printIcon('bug', 'edit', $params, $bug); + common::printCommentIcon('bug', $bug); + common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy'); + common::printIcon('bug', 'delete', $params, $bug, 'button', '', 'hiddenwin'); echo '
    '; echo "
    "; diff --git a/module/build/model.php b/module/build/model.php index 7215c274c8..f6d1cb1999 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -407,4 +407,19 @@ class buildModel extends model $this->loadModel('action')->create('bug', $unlinkBugID, 'unlinkedfrombuild', '', $buildID); } } + + /** + * Judge an action is clickable or not. + * + * @param object $project + * @param string $action + * @access public + * @return bool + */ + public static function isClickable($build, $action) + { + if(!common::limitedUser($build)) return false; + + return true; + } } diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index c0a4059f57..469bec757f 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -46,8 +46,8 @@ tfoot tr td .table-actions .btn{display:none;} echo '
    '; } echo "
    "; - common::printIcon('build', 'edit', "buildID=$build->id"); - common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); + common::printIcon('build', 'edit', "buildID=$build->id", $build); + common::printIcon('build', 'delete', "buildID=$build->id", $build, 'button', '', 'hiddenwin'); echo '
    '; } echo common::printRPN($browseLink); @@ -69,8 +69,8 @@ tfoot tr td .table-actions .btn{display:none;} $browseLink = $this->session->buildList ? $this->session->buildList : $this->createLink('product', 'build', "productID=$build->product"); if(!$build->deleted) { - common::printIcon('build', 'edit', "buildID=$build->id"); - common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); + common::printIcon('build', 'edit', "buildID=$build->id", $build); + common::printIcon('build', 'delete', "buildID=$build->id", $build, 'button', '', 'hiddenwin'); } echo common::printRPN($browseLink); ?> diff --git a/module/common/model.php b/module/common/model.php index 8d627c8c7a..aa28cb7b24 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -598,9 +598,9 @@ class commonModel extends model * @access public * @return bool */ - public static function printLink($module, $method, $vars = '', $label, $target = '', $misc = '', $newline = true, $onlyBody = false) + public static function printLink($module, $method, $vars = '', $label, $target = '', $misc = '', $newline = true, $onlyBody = false, $object = null) { - if(!commonModel::hasPriv($module, $method)) return false; + if(!commonModel::hasPriv($module, $method, $object)) return false; echo html::a(helper::createLink($module, $method, $vars, '', $onlyBody), $label, $target, $misc, $newline); return true; } @@ -625,29 +625,29 @@ class commonModel extends model * @access public * @return void */ - public static function printCommentIcon($module) + public static function printCommentIcon($module, $object = null) { if(isonlybody()) return false; global $lang; - if(!commonModel::hasPriv($module, 'edit')) return false; + if(!commonModel::hasPriv($module, 'edit', $object)) return false; echo html::a('#commentBox', '', '', "title='$lang->comment' onclick='setComment()' class='btn'"); } /** * Build icon button. - * - * @param string $module - * @param string $method - * @param string $vars - * @param object $object - * @param string $type button|list - * @param string $icon - * @param string $target - * @param string $extraClass - * @param bool $onlyBody - * @param string $misc + * + * @param string $module + * @param string $method + * @param string $vars + * @param object $object + * @param string $type button|list + * @param string $icon + * @param string $target + * @param string $extraClass + * @param bool $onlyBody + * @param string $misc * @static * @access public * @return void @@ -736,17 +736,17 @@ class commonModel extends model /** * Print link icon. - * - * @param string $module - * @param string $method - * @param string $vars - * @param object $object - * @param string $type button|list - * @param string $icon - * @param string $target - * @param string $extraClass - * @param bool $onlyBody - * @param string $misc + * + * @param string $module + * @param string $method + * @param string $vars + * @param object $object + * @param string $type button|list + * @param string $icon + * @param string $target + * @param string $extraClass + * @param bool $onlyBody + * @param string $misc * @static * @access public * @return void @@ -758,9 +758,9 @@ class commonModel extends model /** * Print backLink and preLink and nextLink. - * - * @param string $backLink - * @param object $preAndNext + * + * @param string $backLink + * @param object $preAndNext * @access public * @return void */ @@ -1125,7 +1125,7 @@ class commonModel extends model * @access public * @return bool */ - public static function hasPriv($module, $method) + public static function hasPriv($module, $method, $object = null) { global $app, $lang; @@ -1140,6 +1140,8 @@ class commonModel extends model if(isset($rights[$module][$method])) { + if(!commonModel::limitedUser($object, $module, $method)) return false; + if(empty($acls['views'])) return true; $menu = isset($lang->menugroup->$module) ? $lang->menugroup->$module : $module; $menu = strtolower($menu); @@ -1148,8 +1150,55 @@ class commonModel extends model if($module == 'company' and $method == 'dynamic') return true; if($module == 'action' and $method == 'editcomment') return true; if(!isset($acls['views'][$menu])) return false; + return true; } + + return false; + } + + public static function limitedUser($object, $module = null, $method = null) + { + global $app; + + if(!empty($app->user->admin) || $app->user->account == 'guest') return true; + + // limited project + $limitedProject = false; + if(!empty($module) && $module == 'task' && !empty($object->project) || + !empty($module) && $module == 'task' && !empty($object->id)) + { + $objectID = ''; + if(!empty($object->id)) $objectID = $object->id; + if(!empty($object->id) && !empty($object->project)) $objectID = $object->project; + + $sessionKey = $app->user->account . 'project' . $objectID; + if(!empty($_SESSION[$sessionKey]) && $_SESSION[$sessionKey] == $objectID) + { + $limitedProject = true; + } + } + + if(!empty($app->user->limitedUser) && $app->user->limitedUser === 'no' && !$limitedProject) return true; + + if(!is_null($method) && strpos($method, 'batch') === 0) return false; + if(!is_null($method) && strpos($method, 'link') === 0) return false; + if(!is_null($method) && strpos($method, 'create') === 0) return false; + if(!is_null($method) && strpos($method, 'import') === 0) return false; + + if(is_null($object)) return true; + + if(!empty($object->openedBy) && $object->openedBy == $app->user->account || + !empty($object->addedBy) && $object->addedBy == $app->user->account || + !empty($object->assignedTo) && $object->assignedTo == $app->user->account || + !empty($object->finishedBy) && $object->finishedBy == $app->user->account || + !empty($object->canceledBy) && $object->canceledBy == $app->user->account || + !empty($object->closedBy) && $object->closedBy == $app->user->account || + !empty($object->lastEditedBy) && $object->lastEditedBy == $app->user->account) + { + return true; + } + return false; } diff --git a/module/doc/model.php b/module/doc/model.php index b28231f121..36745064fa 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1158,4 +1158,19 @@ class docModel extends model return $teams; } + + /** + * Judge an action is clickable or not. + *- + * @param object $product- + * @param string $action- + * @access public + * @return void + */ + public static function isClickable($doc, $action) + { + if(!common::limitedUser($doc)) return false; + + return true; + } } diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 4fb764ba47..18df8a5cae 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -93,8 +93,8 @@ var browseType = '';
    editedDate, 5, 11);?> id}", '', 'list'); - if(common::hasPriv('doc', 'delete')) + common::printIcon('doc', 'edit', "doc={$doc->id}", $doc, 'list'); + if(common::hasPriv('doc', 'delete', $doc)) { $deleteURL = $this->createLink('doc', 'delete', "docID=$doc->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"docList\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->doc->delete}'"); diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index 16f5133739..2a024e0daf 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -76,8 +76,8 @@ addedDate) ? substr($file->addedDate, 0, 10) : '';?> id", $lang->doc->download, "data-toggle='modal'"); - common::printLink('file', 'delete', "fileID=$file->id", $lang->delete, 'hiddenwin'); + common::printLink('file', 'download', "fileID=$file->id", $lang->doc->download, "data-toggle='modal'", '', true, false, $file); + common::printLink('file', 'delete', "fileID=$file->id", $lang->delete, 'hiddenwin', '', true, false, $file); ?>
    group->priv;?> name . ' '; ?>
    user->limitedUser;?>user->limitedUserList[$user->limitedUser];?>
    user->commiter;?> commiter;?> - id}"; common::printIcon('story', 'change', $vars, $story, 'list', 'random'); common::printIcon('story', 'review', $vars, $story, 'list', 'review'); diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index c31108b359..ac5c808e5f 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -29,8 +29,8 @@ common::printIcon('product', 'close', "productID=$product->id", $product, 'button', '', '', 'iframe text-danger', true); echo "
    "; - common::printIcon('product', 'edit', $params); - common::printIcon('product', 'delete', $params, '', 'button', '', 'hiddenwin'); + common::printIcon('product', 'edit', $params, $product); + common::printIcon('product', 'delete', $params, $product, 'button', '', 'hiddenwin'); echo '
    '; common::printRPN($browseLink); diff --git a/module/productplan/control.php b/module/productplan/control.php index 2f92ea24cf..40b9ebc602 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -203,10 +203,10 @@ class productplan extends control /** * View plan. - * - * @param int $planID - * @param string $type - * @param string $orderBy + * + * @param int $planID + * @param string $type + * @param string $orderBy * @access public * @return void */ @@ -264,8 +264,8 @@ class productplan extends control /** * Link stories. - * - * @param int $planID + * + * @param int $planID * @access public * @return void */ diff --git a/module/productplan/model.php b/module/productplan/model.php index 1f127c6a4b..31631c9369 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -292,9 +292,9 @@ class productplanModel extends model } /** - * Unlink bug. - * - * @param int $bugID + * Unlink bug. + * + * @param int $bugID * @access public * @return void */ @@ -304,4 +304,19 @@ class productplanModel extends model $this->dao->update(TABLE_BUG)->set('plan')->eq(0)->where('id')->eq((int)$bugID)->exec(); $this->loadModel('action')->create('bug', $bugID, 'unlinkedfromplan', '', $planID); } + + /** + * Judge an action is clickable or not. + *- + * @param object $product- + * @param string $action- + * @access public + * @return void + */ + public static function isClickable($productPlan, $action) + { + if(!common::limitedUser($productPlan)) return false; + + return true; + } } diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 08357d84be..33b940c84d 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -72,9 +72,9 @@ id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn-icon' title='{$lang->productplan->linkStory}'"); 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"), '', '', "class='btn-icon' title='{$lang->productplan->linkBug}'"); - common::printIcon('productplan', 'edit', "planID=$plan->id", '', 'list'); + common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list'); - if(common::hasPriv('productplan', 'delete')) + if(common::hasPriv('productplan', 'delete', $plan)) { $deleteURL = $this->createLink('productplan', 'delete', "planID=$plan->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"productplan\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->productplan->delete}'"); diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 64d3a55f1d..409baeefa6 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -30,13 +30,13 @@ { ob_start(); echo "
    "; - common::printIcon('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=0&bugID=0&planID=$plan->id", '', 'button', 'plus'); + 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'"); echo '
    '; echo "
    "; - common::printIcon('productplan', 'edit', "planID=$plan->id"); - common::printIcon('productplan', 'delete', "planID=$plan->id", '', 'button', '', 'hiddenwin'); + common::printIcon('productplan', 'edit', "planID=$plan->id", $plan); + common::printIcon('productplan', 'delete', "planID=$plan->id", $plan, 'button', '', 'hiddenwin'); echo '
    '; $actionLinks = ob_get_contents(); ob_end_clean(); diff --git a/module/project/control.php b/module/project/control.php index 7e342dd956..e9cda0e0f1 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -126,6 +126,8 @@ class project extends control $this->loadModel('task'); $this->loadModel('datatable'); + $this->project->getLimitedProject(); + /* Set browse type. */ $browseType = strtolower($status); if($this->config->global->flow == 'onlyTask' and $browseType == 'byproduct') $param = 0; @@ -608,6 +610,7 @@ class project extends control $this->view->users = $users; $this->view->pager = $pager; $this->view->branchGroups = $branchGroups; + $this->view->limitedUser = $this->app->user->limitedUser == 'yes' ? true : false; $this->display(); } @@ -1932,15 +1935,15 @@ class project extends control } /** - * All project. - * - * @param string $status - * @param int $projectID - * @param string $orderBy - * @param int $productID - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * All project. + * + * @param string $status + * @param int $projectID + * @param string $orderBy + * @param int $productID + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ @@ -1974,8 +1977,8 @@ class project extends control /** * Doc for compatible. - * - * @param int $projectID + * + * @param int $projectID * @access public * @return void */ diff --git a/module/project/lang/en.php b/module/project/lang/en.php index e4b0628afb..449372822c 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -79,6 +79,10 @@ $lang->team->hours = 'Hour/Day'; $lang->team->days = 'Workdays'; $lang->team->totalHours = 'Total'; +$lang->team->limitedUser = 'limited User'; +$lang->team->limitedUserList['no'] = 'No'; +$lang->team->limitedUserList['yes'] = 'Yes'; + $lang->project->basicInfo = 'Basic Info'; $lang->project->otherInfo = 'Other Info'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 2ec73ee143..832032b3a9 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -78,7 +78,11 @@ $lang->team->join = '加盟日'; $lang->team->hours = '可用工时/天'; $lang->team->days = '可用工日'; $lang->team->totalHours = '总计'; - + +$lang->team->limitedUser = '受限用户'; +$lang->team->limitedUserList['no'] = '否'; +$lang->team->limitedUserList['yes'] = '是'; + $lang->project->basicInfo = '基本信息'; $lang->project->otherInfo = '其他信息'; diff --git a/module/project/lang/zh-tw.php b/module/project/lang/zh-tw.php index 70face33d6..cd6b3baf38 100644 --- a/module/project/lang/zh-tw.php +++ b/module/project/lang/zh-tw.php @@ -78,7 +78,11 @@ $lang->team->join = '加盟日'; $lang->team->hours = '可用工時/天'; $lang->team->days = '可用工日'; $lang->team->totalHours = '總計'; - + +$lang->team->limitedUser = '受限用戶'; +$lang->team->limitedUserList['no'] = '否'; +$lang->team->limitedUserList['yes'] = '是'; + $lang->project->basicInfo = '基本信息'; $lang->project->otherInfo = '其他信息'; diff --git a/module/project/model.php b/module/project/model.php index 42bd04c951..8cdf7cba71 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -574,6 +574,7 @@ class projectModel extends model $firstProject = $projects[0]; $pairs[$firstProject->id] = $firstProject->name; } + return $pairs; } @@ -1453,8 +1454,8 @@ class projectModel extends model /** * Manage team members. - * - * @param int $projectID + * + * @param int $projectID * @access public * @return void */ @@ -1469,9 +1470,10 @@ class projectModel extends model if(empty($account)) continue; $member = new stdclass(); - $member->role = $roles[$key]; - $member->days = $days[$key]; - $member->hours = $hours[$key]; + $member->role = $roles[$key]; + $member->days = $days[$key]; + $member->hours = $hours[$key]; + $member->limitedUser = $limitedUser[$key]; $mode = $modes[$key]; if($mode == 'update') @@ -1749,6 +1751,8 @@ class projectModel extends model { $action = strtolower($action); + if(!common::limitedUser($project, 'project')) return false; + if($action == 'start') return $project->status == 'wait'; if($action == 'close') return $project->status != 'done'; if($action == 'suspend') return $project->status == 'wait' or $project->status == 'doing'; @@ -1771,7 +1775,7 @@ class projectModel extends model { $link = ''; if($module == 'task' and ($method == 'view' || $method == 'edit' || $method == 'batchedit')) - { + { $module = 'project'; $method = 'task'; } @@ -1865,9 +1869,29 @@ class projectModel extends model return round($estimate); } + /** + * Check the privilege. + * + * @param object $project + * @access public + * @return bool + */ + public function getLimitedProject() + { + /* If is admin, return true. */ + if($this->app->user->admin) return true; + + /* Get all teams of all projects and group by projects, save it as static. */ + $teams = $this->dao->select('project, limitedUser')->from(TABLE_TEAM)->where('account')->eq($this->app->user->account)->fetchAll('project'); + foreach($teams as $projectID => $object) + { + if($object->limitedUser == 'yes') $this->session->set($this->app->user->account . 'project' . $object->project, $object->project); + } + } + /** * Fix order. - * + * * @access public * @return void */ diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 621123ea58..7c9f974f12 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -56,7 +56,7 @@ id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); - common::printIcon('bug', 'assignTo', $params, '', 'list', '', '', 'iframe', true); + common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'edit', $params, $bug, 'list'); diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index c7c0ee7818..b49659195f 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -49,16 +49,16 @@
    date?> builder]?> - createLink('build', 'view', "buildID=$build->id&type=story&link=true"), "", '', "class='btn-icon' title='{$lang->build->linkStory}'"); } - common::printIcon('testtask', 'create', "product=$build->product&project=$project->id&build=$build->id", '', 'list', 'bullhorn'); + common::printIcon('testtask', 'create', "product=$build->product&project=$project->id&build=$build->id", $build, 'list', 'bullhorn'); $lang->project->bug = $lang->project->viewBug; - common::printIcon('project', 'bug', "project=$project->id&orderBy=status&build=$build->id", '', 'list'); - common::printIcon('build', 'edit', "buildID=$build->id", '', 'list'); - if(common::hasPriv('build', 'delete')) + common::printIcon('project', 'bug', "project=$project->id&orderBy=status&build=$build->id", $build, 'list'); + common::printIcon('build', 'edit', "buildID=$build->id", $build, 'list'); + if(common::hasPriv('build', 'delete', $build)) { $deleteURL = $this->createLink('build', 'delete', "buildID=$build->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"buildList\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->build->delete}'"); diff --git a/module/project/view/linkstory.html.php b/module/project/view/linkstory.html.php index 1f43cf6df0..05d0653d84 100644 --- a/module/project/view/linkstory.html.php +++ b/module/project/view/linkstory.html.php @@ -58,7 +58,7 @@ product][$story->branch])) echo $branchGroups[$story->product][$story->branch];?> openedBy];?>openedBy, $story->openedBy);?> estimate;?>
    team->role;?> team->days;?> team->hours;?>team->limitedUser;?> actions;?> delete;?>
    team->limitedUserList, $member->limitedUser);?>
    team->limitedUserList, 'no');?>
    team->limitedUserList, 'no');?>
    team->limitedUserList, 'no');?>
    +
    team->limitedUserList, $member->realname ? $member->limitedUser : 'no');?>
    - createLink('story', 'bugs', "storyID=$story->id&projectID=$project->id"); $storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0); ?> - createLink('story', 'cases', "storyID=$story->id&projectID=$project->id"); $storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0); ?> - id}&story={$story->id}&moduleID={$story->module}"; $lang->task->create = $lang->project->wbs; @@ -129,16 +129,16 @@ } else { - common::printIcon('task', 'create', $param, '', 'list', 'plus-border', '', 'btn-task-create'); + if(!$limitedUser) common::printIcon('task', 'create', $param, $story, 'list', 'plus-border', '', 'btn-task-create'); } $lang->task->batchCreate = $lang->project->batchWBS; - common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", '', 'list', 'plus-sign'); + if(!$limitedUser) common::printIcon('task', 'batchCreate', "projectID={$project->id}&story={$story->id}", $story, 'list', 'plus-sign'); $lang->testcase->batchCreate = $lang->testcase->create; - if($productID) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap'); + if($productID && !$limitedUser) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'list', 'sitemap'); - if(common::hasPriv('project', 'unlinkStory')) + if(common::hasPriv('project', 'unlinkStory') && !$limitedUser) { $unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", '', '', "class='btn-icon' title='{$lang->project->unlinkStory}'"); diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 32fa210107..68533a4616 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -55,11 +55,11 @@ js::set('browseType', $browseType);
    id", $task, 'list', '', '', 'iframe', true); common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true); - common::printIcon('task', 'edit', "taskID=$task->id", '', 'list'); + common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list'); ?>
    team->days;?> team->hours;?> team->totalHours;?>team->limitedUser;?> actions;?>
    days . $lang->project->day;?> hours . $lang->project->workHour;?> project->workHour;?>team->limitedUserList[$member->limitedUser];?> createLink('project', 'unlinkMember', "projectID=$project->id&account=$member->account&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"memberList\",confirmUnlinkMember)", '', '', "class='btn-icon' title='{$lang->project->unlinkMember}'"); @@ -74,7 +76,7 @@
    +
    team->totalHours . ':' . "$totalHours{$lang->project->workHour}";?>
    testtask->statusList[$task->status];?> id", '', 'list', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list', 'link'); - common::printIcon('testtask', 'edit', "taskID=$task->id", '', 'list'); - common::printIcon('testreport', 'create', "objectID=$task->id&objectType=testtask", '', 'list','flag'); + common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); + common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); + common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); + common::printIcon('testreport', 'create', "objectID=$task->id&objectType=testtask", $task, 'list','flag'); - if(common::hasPriv('testtask', 'delete')) + if(common::hasPriv('testtask', 'delete', $task)) { $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->testtask->delete}'"); diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index fd98bd41df..388c7a333e 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -35,8 +35,8 @@ echo ''; echo "
    "; - common::printIcon('project', 'edit', $params); - common::printIcon('project', 'delete', $params, '', 'button', '', 'hiddenwin'); + common::printIcon('project', 'edit', $params, $project); + common::printIcon('project', 'delete', $params, $project, 'button', '', 'hiddenwin'); echo '
    '; common::printRPN($browseLink); diff --git a/module/release/model.php b/module/release/model.php index d7fdf1153d..728a02ae97 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -319,4 +319,19 @@ class releaseModel extends model $this->dao->update(TABLE_RELEASE)->set('status')->eq($status)->where('id')->eq($releaseID)->exec(); return dao::isError(); } + + /** + * Judge an action is clickable or not. + *- + * @param object $product- + * @param string $action- + * @access public + * @return void + */ + public static function isClickable($release, $action) + { + if(!common::limitedUser($release)) return false; + + return true; + } } diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index 1e346bfd4f..4aa6700a97 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -53,13 +53,13 @@ id&type=story&link=true"), ' ', '', "class='btn-icon' title='{$lang->release->linkStory}'"); if(common::hasPriv('release', 'linkBug') and $this->config->global->flow != 'onlyStory') echo html::a(inlink('view', "releaseID=$release->id&type=bug&link=true"), ' ', '', "class='btn-icon' title='{$lang->release->linkBug}'"); - if(common::hasPriv('release', 'changeStatus')) + if(common::hasPriv('release', 'changeStatus', $release)) { $changedStatus = $release->status == 'normal' ? 'terminate' : 'normal'; echo html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), ' ', 'hiddenwin', "class='btn-icon' title='{$lang->release->changeStatusList[$changedStatus]}'"); } - common::printIcon('release', 'edit', "release=$release->id", '', 'list'); - if(common::hasPriv('release', 'delete')) + common::printIcon('release', 'edit', "release=$release->id", $release, 'list'); + if(common::hasPriv('release', 'delete', $release)) { $deleteURL = $this->createLink('release', 'delete', "releaseID=$release->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"releaseList\",confirmDelete)", '', '', "class='btn-icon' title='{$lang->release->delete}'"); diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 55ce0def71..4a2359fabb 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -29,7 +29,7 @@ ob_start(); echo "
    "; - if(common::hasPriv('release', 'changeStatus')) + if(common::hasPriv('release', 'changeStatus', $release)) { $changedStatus = $release->status == 'normal' ? 'terminate' : 'normal'; echo html::a(inlink('changeStatus', "releaseID=$release->id&type=$changedStatus"), ' ' . $lang->release->changeStatusList[$changedStatus], 'hiddenwin', "class='btn'"); @@ -39,8 +39,8 @@ echo '
    '; echo "
    "; - common::printIcon('release', 'edit', "releaseID=$release->id"); - common::printIcon('release', 'delete', "releaseID=$release->id", '', 'button', '', 'hiddenwin'); + common::printIcon('release', 'edit', "releaseID=$release->id", $release); + common::printIcon('release', 'delete', "releaseID=$release->id", $release, 'button', '', 'hiddenwin'); echo '
    '; echo "
    "; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 7c70ef37d0..0311f26085 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -90,6 +90,7 @@ $lang->story->keywords = 'Keywords'; $lang->story->newStory = 'Continue adding Story.'; $lang->story->colorTag = 'Color Tag'; $lang->story->files = 'Files'; +$lang->story->copy = "Duplicate a Story"; $lang->story->ditto = 'Ditto'; $lang->story->dittoNotice = 'This Story does not belong to the same Product as the last Story does!'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 7410cc1dfb..e260cbdde6 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -90,6 +90,7 @@ $lang->story->keywords = '关键词'; $lang->story->newStory = '继续添加需求'; $lang->story->colorTag = '颜色标签'; $lang->story->files = '附件'; +$lang->story->copy = "复制需求"; $lang->story->ditto = '同上'; $lang->story->dittoNotice = '该需求与上一需求不属于同一产品!'; diff --git a/module/story/lang/zh-tw.php b/module/story/lang/zh-tw.php index e2bb29bed1..f439ea47f6 100644 --- a/module/story/lang/zh-tw.php +++ b/module/story/lang/zh-tw.php @@ -90,6 +90,7 @@ $lang->story->keywords = '關鍵詞'; $lang->story->newStory = '繼續添加需求'; $lang->story->colorTag = '顏色標籤'; $lang->story->files = '附件'; +$lang->story->copy = "復制需求"; $lang->story->ditto = '同上'; $lang->story->dittoNotice = '該需求與上一需求不屬於同一產品!'; diff --git a/module/story/model.php b/module/story/model.php index 601c73318d..645cbc5dd0 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1456,19 +1456,19 @@ class storyModel extends model /** * Get stories through search. - * + * * @access public - * @param int $productID - * @param int $queryID - * @param string $orderBy - * @param object $pager - * @param string $projectID + * @param int $productID + * @param int $queryID + * @param string $orderBy + * @param object $pager + * @param string $projectID * @access public * @return array */ public function getBySearch($productID, $queryID, $orderBy, $pager = null, $projectID = '', $branch = 0) { - if($projectID != '') + if($projectID != '') { $products = $this->loadModel('project')->getProducts($projectID); } @@ -1668,11 +1668,11 @@ class storyModel extends model /** * Get stories list of a plan. - * - * @param int $planID - * @param string $status - * @param string $orderBy - * @param object $pager + * + * @param int $planID + * @param string $status + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -1683,19 +1683,19 @@ class storyModel extends model ->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi() ->andWhere('deleted')->eq(0) ->orderBy($orderBy)->page($pager)->fetchAll('id'); - + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); - + return $stories; } /** * Get stories pairs of a plan. - * - * @param int $planID - * @param string $status - * @param string $orderBy - * @param object $pager + * + * @param int $planID + * @param string $status + * @param string $orderBy + * @param object $pager * @access public * @return array */ @@ -2186,6 +2186,8 @@ class storyModel extends model { $action = strtolower($action); + if(!common::limitedUser($story)) return false; + if($action == 'change') return $story->status != 'closed'; if($action == 'review') return $story->status == 'draft' or $story->status == 'changed'; if($action == 'close') return $story->status != 'closed'; diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 99cccbf9ab..85d9b06c77 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -41,8 +41,8 @@ ob_start(); echo "
    "; - common::printIcon('story', 'change', "storyID=$story->id", $story); - common::printIcon('story', 'review', "storyID=$story->id", $story); + common::printIcon('story', 'change', "storyID=$story->id", $story); + common::printIcon('story', 'review', "storyID=$story->id", $story); if($story->status != 'closed' and !isonlybody()) { @@ -51,8 +51,8 @@ if(common::hasPriv('story', 'batchCreate')) echo html::a($link, " " . $lang->story->subdivide, '', $misc); } - common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe text-danger', true); - common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe text-success', true); + common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe text-danger', true); + common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe text-success', true); if($this->config->global->flow != 'onlyStory' and !isonlybody() and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate'))) { @@ -64,7 +64,7 @@ echo "
    "; } - if($from == 'project') common::printIcon('task', 'create', "project=$param&storyID=$story->id&moduleID=$story->module", '', 'button', 'smile'); + if($from == 'project') common::printIcon('task', 'create', "project=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', 'smile'); echo '
    '; echo "
    "; - common::printIcon('story', 'edit', "storyID=$story->id"); - common::printCommentIcon('story'); - common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'button', 'copy'); - common::printIcon('story', 'delete', "storyID=$story->id", '', 'button', '', 'hiddenwin'); + common::printIcon('story', 'edit', "storyID=$story->id", $story); + common::printCommentIcon('story', $story); + common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'button', 'copy'); + common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', '', 'hiddenwin'); echo '
    '; echo "
    "; @@ -354,7 +354,7 @@
      linkStories) ; + $linkStories = explode(',', $story->linkStories) ; foreach($linkStories as $linkStoryID) { if(isset($story->extraStories[$linkStoryID])) echo '
    • ' . html::a(inlink('view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '
    • '; @@ -368,7 +368,7 @@
      childStories) ; + $childStories = explode(',', $story->childStories) ; foreach($childStories as $childStoryID) { if(isset($story->extraStories[$childStoryID])) echo '
    • ' . html::a(inlink('view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '
    • '; diff --git a/module/task/model.php b/module/task/model.php index 3e4294abd6..d61af2cf2c 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1593,6 +1593,8 @@ class taskModel extends model { $action = strtolower($action); + if(!common::limitedUser($task, 'task')) return false; + if($action == 'assignto') return $task->status != 'closed' and $task->status != 'cancel'; if($action == 'start') return $task->status == 'wait'; if($action == 'restart') return $task->status == 'pause'; diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 1d47c06c8a..e7cec9645a 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -43,10 +43,10 @@ echo ''; echo "
      "; - common::printIcon('task', 'edit', "taskID=$task->id"); - common::printCommentIcon('task'); - common::printIcon('task', 'create', "productID=0&storyID=0&moduleID=0&taskID=$task->id", '', 'button', 'copy'); - common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", '', 'button', '', 'hiddenwin'); + common::printIcon('task', 'edit', "taskID=$task->id", $task); + common::printCommentIcon('task', $task); + common::printIcon('task', 'create', "productID=0&storyID=0&moduleID=0&taskID=$task->id", $task, 'button', 'copy'); + common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", $task, 'button', '', 'hiddenwin'); echo '
      '; echo "
      "; diff --git a/module/testcase/model.php b/module/testcase/model.php index d677682bb0..1912604acc 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -932,6 +932,8 @@ class testcaseModel extends model { $action = strtolower($action); + if(!common::limitedUser($case)) return false; + if($action == 'createbug') return $case->caseFails > 0; if($action == 'review') return $case->status == 'wait'; diff --git a/module/testcase/view/browsedata.html.php b/module/testcase/view/browsedata.html.php index 30c6d5733e..121fbd0548 100644 --- a/module/testcase/view/browsedata.html.php +++ b/module/testcase/view/browsedata.html.php @@ -77,13 +77,13 @@
    stepNumber;?> id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'"); + common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); + common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'"); if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe'); common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); - if(common::hasPriv('testcase', 'delete')) + if(common::hasPriv('testcase', 'delete', $case)) { $deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '', '', "title='{$lang->testcase->delete}' class='btn-icon'"); diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 9ab3491bbd..8dfc0b1984 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -45,22 +45,22 @@ echo "
    "; if(!$isLibCase) { - common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", '', 'button', '', '', 'runCase', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", '', 'button', '', '', 'results', false, "data-width='95%'"); + common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", $case, 'button', '', '', 'runCase', false, "data-width='95%'"); + common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'results', false, "data-width='95%'"); - if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe', '', "data-width='90%'"); + if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", $case, 'button', 'bug', '', 'iframe', '', "data-width='90%'"); } if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe'); echo '
    '; echo "
    "; - common::printIcon('testcase', 'edit',"caseID=$case->id"); - common::printCommentIcon('testcase'); - if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", '', 'button', 'copy'); - if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id"), "", '', "class='btn' title='{$lang->testcase->copy}'"); - common::printIcon('testcase', 'delete', "caseID=$case->id", '', 'button', '', 'hiddenwin'); + common::printIcon('testcase', 'edit',"caseID=$case->id", $case); + common::printCommentIcon('testcase', $case); + if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'button', 'copy'); + if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id", $case), "", '', "class='btn' title='{$lang->testcase->copy}'"); + common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', '', 'hiddenwin'); echo '
    '; - + echo "
    "; common::printRPN($browseLink, $preAndNext, inlink('view', "caseID=%s&version=0&testtask=$from&taskID=$taskID")); echo '
    '; diff --git a/module/testsuite/model.php b/module/testsuite/model.php index f2a1f288d7..090da3af16 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -804,4 +804,19 @@ class testsuiteModel extends model } } } + + /** + * Judge an action is clickable or not. + *- + * @param object $product- + * @param string $action- + * @access public + * @return void + */ + public static function isClickable($testsuite, $action) + { + if(!common::limitedUser($testsuite)) return false; + + return true; + } } diff --git a/module/testsuite/view/browse.html.php b/module/testsuite/view/browse.html.php index 5ee5104c39..5de87fc912 100644 --- a/module/testsuite/view/browse.html.php +++ b/module/testsuite/view/browse.html.php @@ -45,10 +45,10 @@
    addedDate;?> id", '', 'list', 'link'); - common::printIcon('testsuite', 'edit', "suiteID=$suite->id", '', 'list'); + common::printIcon('testsuite', 'linkCase', "suiteID=$suite->id", $suite, 'list', 'link'); + common::printIcon('testsuite', 'edit', "suiteID=$suite->id", $suite, 'list'); - if(common::hasPriv('testsuite', 'delete')) + if(common::hasPriv('testsuite', 'delete', $suite)) { $deleteURL = $this->createLink('testsuite', 'delete', "suiteID=$suite->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"suiteList\",confirmDelete)", '', '', "title='{$lang->testsuite->delete}' class='btn-icon'"); diff --git a/module/testsuite/view/view.html.php b/module/testsuite/view/view.html.php index 03dba03eb8..64043ae6a5 100644 --- a/module/testsuite/view/view.html.php +++ b/module/testsuite/view/view.html.php @@ -105,13 +105,13 @@ stepNumber;?> createLink('testsuite', 'unlinkCase', "suiteID=$suite->id&caseID=$case->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '', '', "title='{$lang->testsuite->unlinkCase}' class='btn-icon'"); } - common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'"); + common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $suite, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); + common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $suite, 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'"); ?>
    testtask->statusList[$task->status];?> id", 'play', 'list', 'sitemap'); + common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'file','','iframe',true); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list', 'link'); - common::printIcon('testtask', 'edit', "taskID=$task->id", '', 'list','','','iframe',true); - common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", '', 'list','flag'); + common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); + common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list','','','iframe',true); + common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag'); - if(common::hasPriv('testtask', 'delete')) + if(common::hasPriv('testtask', 'delete', $task)) { $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "title='{$lang->testtask->delete}' class='btn-icon'"); diff --git a/module/testtask/view/casesdata.html.php b/module/testtask/view/casesdata.html.php index 4ece30abcb..a172a05b70 100644 --- a/module/testtask/view/casesdata.html.php +++ b/module/testtask/view/casesdata.html.php @@ -61,10 +61,10 @@ stepNumber;?> id", '', 'list', '', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "id=$run->id", '', 'list', '', '', 'iframe', '', "data-width='90%'"); + common::printIcon('testtask', 'runCase', "id=$run->id", $run, 'list', '', '', 'runCase iframe', false, "data-width='95%'"); + common::printIcon('testtask', 'results', "id=$run->id", $run, 'list', '', '', 'iframe', '', "data-width='90%'"); - if(common::hasPriv('testtask', 'unlinkCase')) + if(common::hasPriv('testtask', 'unlinkCase', $run)) { $unlinkURL = $this->createLink('testtask', 'unlinkCase', "caseID=$run->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"caseList\",confirmUnlink)", '', '', "title='{$lang->testtask->unlinkCase}' class='btn-icon'"); diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 1e40dfd314..5cce7d152b 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -38,8 +38,8 @@ echo ''; echo "
    "; - common::printIcon('testtask', 'edit', "taskID=$task->id"); - common::printIcon('testtask', 'delete', "taskID=$task->id", '', 'button', '', 'hiddenwin'); + common::printIcon('testtask', 'edit', "taskID=$task->id", $task); + common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'button', '', 'hiddenwin'); echo '
    '; echo "
    "; diff --git a/module/user/config.php b/module/user/config.php index b4211a351f..47ab768e3e 100644 --- a/module/user/config.php +++ b/module/user/config.php @@ -6,8 +6,8 @@ $config->user->edit = new stdclass(); $config->user->create->requiredFields = 'account,realname,password,password1,password2'; $config->user->edit->requiredFields = 'account,realname'; -$config->user->customBatchCreateFields = 'dept,email,gender,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode'; -$config->user->customBatchEditFields = 'dept,email,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode'; +$config->user->customBatchCreateFields = 'dept,email,gender,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode,limitedUser'; +$config->user->customBatchEditFields = 'dept,email,commiter,join,skype,qq,yahoo,gtalk,wangwang,mobile,phone,address,zipcode,limitedUser'; $config->user->custom = new stdclass(); $config->user->custom->batchCreateFields = 'dept,email,gender'; diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index 6c0fee5f61..f9a04cff6e 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -97,6 +97,10 @@ $lang->user->lockWarning = "您还有%s次尝试机会。"; $lang->user->loginLocked = "密码尝试次数太多,请联系管理员解锁,或%s分钟后重试。"; $lang->user->weakPassword = "您的密码强度小于系统设定。"; +$lang->user->limitedUser = '受限用户'; +$lang->user->limitedUserList['no'] = '否'; +$lang->user->limitedUserList['yes'] = '是'; + $lang->user->roleList[''] = ''; $lang->user->roleList['dev'] = '研发'; $lang->user->roleList['qa'] = '测试'; @@ -128,12 +132,13 @@ $lang->user->tpl->content = '内容'; $lang->user->tpl->public = '是否公开'; $lang->user->placeholder = new stdclass(); -$lang->user->placeholder->account = '英文、数字和下划线的组合,三位以上'; -$lang->user->placeholder->password1 = '六位以上'; -$lang->user->placeholder->role = '职位影响内容和用户列表的顺序。'; -$lang->user->placeholder->group = '分组决定用户的权限列表。'; -$lang->user->placeholder->commiter = '版本控制系统(subversion)中的帐号'; -$lang->user->placeholder->verify = '需要输入你的密码加以验证'; +$lang->user->placeholder->account = '英文、数字和下划线的组合,三位以上'; +$lang->user->placeholder->password1 = '六位以上'; +$lang->user->placeholder->role = '职位影响内容和用户列表的顺序。'; +$lang->user->placeholder->group = '分组决定用户的权限列表。'; +$lang->user->placeholder->commiter = '版本控制系统(subversion)中的帐号'; +$lang->user->placeholder->verify = '需要输入你的密码加以验证'; +$lang->user->placeholder->limitedUser = '只能编辑与自己相关的内容。'; $lang->user->placeholder->passwordStrength[1] = '6位以上,包含大小写字母,数字。'; $lang->user->placeholder->passwordStrength[2] = '10位以上,包含大小写字母,数字,特殊字符。'; diff --git a/module/user/model.php b/module/user/model.php index 8e2f464ebb..1f2ed14d4a 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -200,7 +200,7 @@ class userModel extends model /** * Create a user. - * + * * @access public * @return void */ @@ -298,6 +298,8 @@ class userModel extends model $data[$i]->address = $users->address[$i]; $data[$i]->zipcode = $users->zipcode[$i]; + $data[$i]->limitedUser = $users->limitedUser[$i]; + /* Change for append field, such as feedback.*/ if(!empty($this->config->user->batchAppendFields)) { @@ -465,6 +467,7 @@ class userModel extends model $users[$id]['phone'] = $data->phone[$id]; $users[$id]['address'] = $data->address[$id]; $users[$id]['zipcode'] = $data->zipcode[$id]; + $users[$id]['limitedUser'] = $data->limitedUser[$id]; $users[$id]['dept'] = $data->dept[$id] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $data->dept[$id]; $users[$id]['role'] = $data->role[$id] == 'ditto' ? (isset($prev['role']) ? $prev['role'] : 0) : $data->role[$id]; @@ -518,7 +521,7 @@ class userModel extends model public function updatePassword($userID) { if(!$this->checkPassword()) return; - + $user = fixer::input('post') ->setIF($this->post->password1 != false, 'password', md5($this->post->password1)) ->remove('account, password1, password2, originalPassword') @@ -581,7 +584,7 @@ class userModel extends model } return !dao::isError(); } - + /** * Identify a user. * @@ -593,7 +596,7 @@ class userModel extends model public function identify($account, $password) { if(!$account or !$password) return false; - + /* Get the user first. If $password length is 32, don't add the password condition. */ $record = $this->dao->select('*')->from(TABLE_USER) ->where('account')->eq($account) diff --git a/module/user/view/batchcreate.html.php b/module/user/view/batchcreate.html.php index 9989a3a032..1a06e6e8ca 100644 --- a/module/user/view/batchcreate.html.php +++ b/module/user/view/batchcreate.html.php @@ -55,6 +55,7 @@ $minWidth = (count($visibleFields) > 5) ? 'w-150px' : '';
    '> user->phone;?> '> user->address;?> '> user->zipcode;?>'> user->limitedUser;?>
    '> '> '>
    > user->limitedUserList, 'no');?>
    user->verifyPassword?>'> user->phone;?> '> user->address;?> '> user->zipcode;?>'> user->limitedUser;?>
    '> id]", $user->phone, "class='form-control' autocomplete='off'");?> '> id]", $user->address, "class='form-control' autocomplete='off'");?> '> id]", $user->zipcode, "class='form-control' autocomplete='off'");?>> id]", $lang->user->limitedUserList, $user->limitedUser);?>
    user->placeholder->group?>
    user->limitedUser;?>user->limitedUserList, 'no');?>user->placeholder->limitedUser?>
    user->email;?>
    user->commiter;?> commiter, "class='form-control' autocomplete='off'");?>user->limitedUser;?>user->limitedUserList, $user->limitedUser);?>
    @@ -80,13 +82,13 @@ - + - + From da796c772c64dd318aa52cbdc420a25707afade1 Mon Sep 17 00:00:00 2001 From: pengjiangxiu Date: Tue, 19 Sep 2017 15:01:39 +0800 Subject: [PATCH 20/21] * Finish task #3209. --- module/testcase/control.php | 16 ++++++++-------- module/testcase/model.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index ff5e4773c5..b7c35fdd3d 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -42,14 +42,14 @@ class testcase extends control /** * Browse cases. - * - * @param int $productID - * @param string $browseType - * @param int $param - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID + * + * @param int $productID + * @param string $browseType + * @param int $param + * @param string $orderBy + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID * @access public * @return void */ diff --git a/module/testcase/model.php b/module/testcase/model.php index 1912604acc..f96e07516b 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -84,7 +84,7 @@ class testcaseModel extends model $case = fixer::input('post') ->add('openedBy', $this->app->user->account) ->add('openedDate', $now) - ->add('status', $this->forceNotReview() || ($this->config->testcase->needReview && $this->post->forceNotReview) ? 'normal' : 'wait') + ->add('status', $this->forceNotReview() || $this->post->forceNotReview ? 'normal' : 'wait') ->add('version', 1) ->add('fromBug', $bugID) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) @@ -186,7 +186,7 @@ class testcaseModel extends model $data[$i]->keywords = $cases->keywords[$i]; $data[$i]->openedBy = $this->app->user->account; $data[$i]->openedDate = $now; - $data[$i]->status = $forceNotReview || ($this->config->testcase->needReview && $cases->needReview[$i]) ? 'normal' : 'wait'; + $data[$i]->status = $forceNotReview || $cases->needReview[$i] == 0 ? 'normal' : 'wait'; $data[$i]->version = 1; $caseStory = $data[$i]->story; From cb35c2a35899c6167f640606bad29bf3d60eb9b7 Mon Sep 17 00:00:00 2001 From: Catouse Date: Wed, 20 Sep 2017 11:16:24 +0800 Subject: [PATCH 21/21] * update chosen. --- www/js/jquery/chosen/min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/jquery/chosen/min.js b/www/js/jquery/chosen/min.js index 2d5b8718f4..88a997a542 100644 --- a/www/js/jquery/chosen/min.js +++ b/www/js/jquery/chosen/min.js @@ -8,4 +8,4 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ -(function(){var t,e,s,i,r,o={}.hasOwnProperty,h=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},n={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}};i=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var s,i,r,o,h,n;for(s=this.parsed.length,this.parsed.push({array_index:s,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),h=e.childNodes,n=[],r=0,o=h.length;o>r;r++)i=h[r],n.push(this.add_option(i,s,e.disabled));return n},e.prototype.add_option=function(e,s,i){return"OPTION"===e.nodeName.toUpperCase()?(""!==e.text?(null!=s&&(this.parsed[s].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,title:e.title,html:e.innerHTML,selected:e.selected,disabled:i===!0?i:e.disabled,group_array_index:s,classes:e.className,style:e.style.cssText,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/," ")})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},e.prototype.escapeExpression=function(t){var e,s;return null==t||t===!1?"":/[\&\<\>\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},s=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(s,function(t){return e[t]||"&"})):t},e}(),i.select_to_array=function(t){var e,s,r,o,h;for(s=new i,h=t.childNodes,r=0,o=h.length;o>r;r++)e=h[r],s.add_node(e);return s.parsed},e=function(){function e(s,i){this.form_field=s,this.options=null!=i?i:{},e.browser_is_supported()&&(this.lang=n[this.options.lang||(t.zui.clientLang?t.zui.clientLang():"zh_cn")],this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return e.prototype.set_default_values=function(){var t=this;return this.click_test_action=function(e){return t.test_active_click(e)},this.activate_action=function(e){return t.activate_field(e)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.drop_direction=this.options.drop_direction||"auto",this.middle_highlight=this.options.middle_highlight,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||this.lang.no_results_text||e.default_no_result_text},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(t){var e=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return e.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(t){var e=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return e.blur_test()},100))},e.prototype.results_option_build=function(t){var e,s,i,r,o;for(e="",o=this.results_data,i=0,r=o.length;r>i;i++)s=o[i],e+=s.group?this.result_add_group(s):this.result_add_option(s),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(s.text));return e},e.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.style.cssText=t.style,s.title=t.title,s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.search_text,this.outerHTML(s)):""},e.prototype.result_add_group=function(t){var e;return(t.search_match||t.group_match)&&t.active_options>0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},e.prototype.reset_single_select_options=function(){var t,e,s,i,r;for(i=this.results_data,r=[],e=0,s=i.length;s>e;e++)t=i[e],t.selected?r.push(t.selected=!1):r.push(void 0);return r},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(t){return this.results_showing?this.winnow_results(1):this.results_show()},e.prototype.winnow_results=function(t){var e,s,i,r,o,h,n,l,c,a,_,u,d;for(this.no_results_clear(),o=0,n=this.get_search_text(),e=n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),r=this.search_contains?"":"^",i=new RegExp(r+e,"i"),a=new RegExp(e,"i"),d=this.results_data,_=0,u=d.length;u>_;_++)s=d[_],s.search_match=!1,h=null,this.include_option_in_results(s)&&(s.group&&(s.group_match=!1,s.active_options=0),null!=s.group_array_index&&this.results_data[s.group_array_index]&&(h=this.results_data[s.group_array_index],0===h.active_options&&h.search_match&&(o+=1),h.active_options+=1),(!s.group||this.group_search)&&(s.search_text=s.group?s.label:s.html,s.search_keys_match=this.search_string_match(s.search_keys,i),s.search_text_match=this.search_string_match(s.search_text,i),s.search_match=s.search_text_match||s.search_keys_match,s.search_match&&!s.group&&(o+=1),s.search_match?(s.search_text_match&&s.search_text.length?(l=s.search_text.search(a),c=s.search_text.substr(0,l+n.length)+""+s.search_text.substr(l+n.length),s.search_text=c.substr(0,l)+""+c.substr(l)):s.search_keys_match&&s.search_keys.length&&(l=s.search_keys.search(a),c=s.search_keys.substr(0,l+n.length)+""+s.search_keys.substr(l+n.length),s.search_text+='  '+c.substr(0,l)+""+c.substr(l)+""),null!=h&&(h.group_match=!0)):null!=s.group_array_index&&this.results_data[s.group_array_index].search_match&&(s.search_match=!0)));return this.result_clear_highlight(),1>o&&n.length?(this.update_results_content(""),this.no_results(n)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var s,i,r,o;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(i=t.replace(/\[|\]/g,"").split(" "),i.length))for(r=0,o=i.length;o>r;r++)if(s=i[r],e.test(s))return!0},e.prototype.choices_count=function(){var t,e,s,i;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,i=this.form_field.options,e=0,s=i.length;s>e;e++)t=i[e],t.selected&&""!=t.value&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(t){return t.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},e.prototype.keyup_checker=function(t){var e,s;switch(e=null!=(s=t.which)?s:t.keyCode,this.search_field_scale(),e){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return this.is_multiple&&!this.display_selected_options&&t.selected?!1:!this.display_disabled_options&&t.disabled?!1:t.empty?!1:!0},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){return this.touch_started?this.search_results_mouseup(t):void 0},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var r,o;r=t(this),o=r.data("chosen"),"destroy"===i&&o?o.destroy():o||r.data("chosen",new s(this,i))}):this}}),s=function(e){function s(){return r=s.__super__.constructor.apply(this,arguments)}return h(s,e),s.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},s.prototype.set_up_html=function(){var e,s;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var i=this.form_field.getAttribute("data-css-class");return i&&e.push(i),s={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
    ",s),this.is_multiple?this.container.html('
      '):this.container.html(''+this.default_text+'
        '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},s.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},s.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},s.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},s.prototype.container_mousedown=function(e){return this.is_disabled||(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},s.prototype.container_mouseup=function(t){return"ABBR"!==t.target.nodeName||this.is_disabled?void 0:this.results_reset(t)},s.prototype.search_results_mousewheel=function(t){var e;return t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e?(t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())):void 0},s.prototype.blur_test=function(t){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},s.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},s.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},s.prototype.test_active_click=function(e){var s;return s=t(e.target).closest(".chosen-container"),s.length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},s.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},s.prototype.result_do_highlight=function(t,e){var s,i,r,o,h,n,l=-1;t.length&&(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),n=this.result_highlight.outerHeight(),h=this.search_results.scrollTop(),o=r+h,i=this.result_highlight.position().top+this.search_results.scrollTop(),s=i+n,this.middle_highlight&&(e||"always"===this.middle_highlight||s>=o||h>i)?l=Math.min(i-n,Math.max(0,i-(r-n)/2)):s>=o?l=s-r>0?s-r:0:h>i&&(l=i),l>-1&&this.search_results.scrollTop(l))},s.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},s.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count())return this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(1);var e=this.drop_direction;if("auto"===e){var s=this.container.find(".chosen-drop"),i=this.container.offset();i.top+s.outerHeight()+30>t(window).height()+t(window).scrollTop()&&(e="up")}return this.container.toggleClass("chosen-up","up"===e),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this})},s.prototype.update_results_content=function(t){return this.search_results.html(t)},s.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},s.prototype.set_tab_index=function(t){var e;return this.form_field.tabIndex?(e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e):void 0},s.prototype.set_label_behavior=function(){var e=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()}):void 0},s.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},s.prototype.search_results_mouseup=function(e){var s;return s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),s.length?(this.result_highlight=s,this.result_select(e),this.search_field.focus()):void 0},s.prototype.search_results_mouseover=function(e){var s;return s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),s?this.result_do_highlight(s):void 0},s.prototype.search_results_mouseout=function(e){return t(e.target).hasClass("active-result")?this.result_clear_highlight():void 0},s.prototype.choice_build=function(e){var s,i,r=this;return s=t("
      • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?s.addClass("search-choice-disabled"):(i=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),i.bind("click.chosen",function(t){return r.choice_destroy_link_click(t)}),s.append(i)),this.search_container.before(s)},s.prototype.choice_destroy_link_click=function(e){return e.preventDefault(),e.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(t(e.target))},s.prototype.choice_destroy=function(t){return this.result_deselect(t[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()):void 0},s.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},s.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},s.prototype.result_select=function(t){var e,s;return this.result_highlight?(e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(s.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},s.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").attr("title",t).text(t)},s.prototype.result_deselect=function(t){var e;return e=this.results_data[t],this.form_field.options[e.options_index].disabled?!1:(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},s.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},s.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
        ").text(t.trim(this.search_field.val())).html()},s.prototype.winnow_results_set_highlight=function(t){var e,s;return s=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=s.length?s.first():this.search_results.find(".active-result").first(),null!=e?this.result_do_highlight(e,t):void 0},s.prototype.no_results=function(e){var s;return s=t('
      • '+this.results_none_found+' ""
      • '),s.find("span").first().html(e),this.search_results.append(s),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},s.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},s.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},s.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},s.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},s.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},s.prototype.keydown_checker=function(t){var e,s;switch(e=null!=(s=t.which)?s:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},s.prototype.search_field_scale=function(){var e,s,i,r,o,h,n,l,c;if(this.is_multiple){for(i=0,n=0,o="position:absolute; left: -1000px; top: -1000px; display:none;",h=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=h.length;c>l;l++)r=h[l],o+=r+":"+this.search_field.css(r)+";";return e=t("
        ",{style:o}),e.text(this.search_field.val()),t("body").append(e),n=e.width()+25,e.remove(),s=this.container.outerWidth(),n>s-10&&(n=s-10),this.search_field.css({width:n+"px"})}},s}(e)}).call(this); \ No newline at end of file +(function(){var t,e,s,i,r,o={}.hasOwnProperty,h=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},n={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}};i=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var s,i,r,o,h,n;for(s=this.parsed.length,this.parsed.push({array_index:s,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),h=e.childNodes,n=[],r=0,o=h.length;r\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},s=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(s,function(t){return e[t]||"&"})):t},e}(),i.select_to_array=function(t){var e,s,r,o,h;for(s=new i,h=t.childNodes,r=0,o=h.length;r0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},e.prototype.reset_single_select_options=function(){var t,e,s,i,r;for(i=this.results_data,r=[],e=0,s=i.length;e"+s.search_text.substr(l+n.length),s.search_text=c.substr(0,l)+""+c.substr(l)):s.search_keys_match&&s.search_keys.length&&(l=s.search_keys.search(a),c=s.search_keys.substr(0,l+n.length)+""+s.search_keys.substr(l+n.length),s.search_text+='  '+c.substr(0,l)+""+c.substr(l)+""),null!=h&&(h.group_match=!0)):null!=s.group_array_index&&this.results_data[s.group_array_index].search_match&&(s.search_match=!0)));return this.result_clear_highlight(),o<1&&n.length?(this.update_results_content(""),this.no_results(n)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var s,i,r,o;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(i=t.replace(/\[|\]/g,"").split(" "),i.length))for(r=0,o=i.length;r0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var r,o;r=t(this),o=r.data("chosen"),"destroy"===i&&o?o.destroy():o||r.data("chosen",new s(this,i))}):this}}),s=function(e){function s(){return r=s.__super__.constructor.apply(this,arguments)}return h(s,e),s.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},s.prototype.set_up_html=function(){var e,s;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var i=this.form_field.getAttribute("data-css-class");return i&&e.push(i),s={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
        ",s),this.is_multiple?this.container.html('
          '):this.container.html('
          '+this.default_text+'
            '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},s.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},s.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},s.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},s.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},s.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},s.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},s.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},s.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},s.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},s.prototype.test_active_click=function(e){var s;return s=t(e.target).closest(".chosen-container"),s.length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},s.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},s.prototype.result_do_highlight=function(t,e){var s,i,r,o,h,n,l=-1;t.length&&(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),n=this.result_highlight.outerHeight(),h=this.search_results.scrollTop(),o=r+h,i=this.result_highlight.position().top+this.search_results.scrollTop(),s=i+n,this.middle_highlight&&(e||"always"===this.middle_highlight||s>=o||i=o?l=s-r>0?s-r:0:i-1&&this.search_results.scrollTop(l))},s.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},s.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count())return this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(1);var e=this.drop_direction;if("auto"===e){var s=this.container.find(".chosen-drop"),i=this.container.offset();i.top+s.outerHeight()+30>t(window).height()+t(window).scrollTop()&&(e="up")}return this.container.toggleClass("chosen-up","up"===e),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this})},s.prototype.update_results_content=function(t){return this.search_results.html(t)},s.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},s.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},s.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},s.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},s.prototype.search_results_mouseup=function(e){var s;s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),s.length&&(this.result_highlight=s,this.result_select(e))},s.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},s.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},s.prototype.choice_build=function(e){var s,i,r=this;return s=t("
          • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?s.addClass("search-choice-disabled"):(i=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),i.bind("click.chosen",function(t){return r.choice_destroy_link_click(t)}),s.append(i)),this.search_container.before(s)},s.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},s.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},s.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field)return this.results_hide()},s.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},s.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(s.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},s.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").attr("title",t).text(t)},s.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},s.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},s.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
            ").text(t.trim(this.search_field.val())).html()},s.prototype.winnow_results_set_highlight=function(t){var e,s;if(s=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=s.length?s.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},s.prototype.no_results=function(e){var s;return s=t('
          • '+this.results_none_found+' ""
          • '),s.find("span").first().html(e),this.search_results.append(s),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},s.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},s.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},s.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},s.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},s.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},s.prototype.keydown_checker=function(t){var e,s;switch(e=null!=(s=t.which)?s:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},s.prototype.search_field_scale=function(){var e,s,i,r,o,h,n,l,c;if(this.is_multiple){for(i=0,n=0,o="position:absolute; left: -1000px; top: -1000px; display:none;",h=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=h.length;l",{style:o}),e.text(this.search_field.val()),t("body").append(e),n=e.width()+25,e.remove(),s=this.container.outerWidth(),n>s-10&&(n=s-10),this.search_field.css({width:n+"px"})}},s}(e)}).call(this);
            skype, "class='form-control' autocomplete='off'");?> user->qq;?> qq, "class='form-control' autocomplete='off'");?>
            user->yahoo;?> yahoo, "class='form-control' autocomplete='off'");?> user->gtalk;?> gtalk, "class='form-control' autocomplete='off'");?>
            user->wangwang;?> wangwang, "class='form-control' autocomplete='off'");?>