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/db/update9.5.sql b/db/update9.5.sql new file mode 100644 index 0000000000..41d9aef0af --- /dev/null +++ b/db/update9.5.sql @@ -0,0 +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/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/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/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/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/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..c52e931da7 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(); @@ -2242,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'; @@ -2300,12 +2303,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 +2360,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/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/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);
| report->id;?> | diff --git a/module/story/config.php b/module/story/config.php index 73191c706d..04152e193c 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'; @@ -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/control.php b/module/story/control.php index 5263c5713c..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 */ @@ -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. * @@ -1255,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); } /** @@ -1436,6 +1445,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]; 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/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 b8a97e59d3..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'; @@ -2234,12 +2236,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 +2261,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 +2290,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; diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index d89f8dccfd..3a9fffac93 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -30,7 +30,7 @@
- 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'");?>
|
@@ -72,7 +72,7 @@
story->source?>
story->sourceList, $source, "class='form-control'");?>
- comment?>
+ story->sourceNote?>
|
@@ -95,7 +95,7 @@
||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| story->spec;?> | story->specTemplate) . "'");?> | -|||||||||
| story->verify;?> | 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..85d9b06c77 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -41,8 +41,8 @@ ob_start(); echo "||||||||||
| story->source;?> | -story->sourceList[$story->source] . ' ' . $story->sourceNote;?> | +story->sourceList[$story->source];?> | +||||||||
| story->sourceNote;?> | +sourceNote;?> | |||||||||
| story->status;?> | @@ -350,7 +354,7 @@
|
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->priList, '', "class='hide'");?>
+ task->priList, $task->pri, "class='hide'");?>
task->estimateAB;?>
- task->hour}' autocomplete='off'");?>
+ estimate, "class='form-control' placeholder='{$lang->task->hour}' autocomplete='off'");?>
| ||||||||
| task->afterSubmit;?> | -task->afterChoices, $this->config->global->flow == 'onlyTask' ? 'toTaskList' : 'continueAdding');?> | +task->afterChoices, $this->config->global->flow == 'onlyTask' || !empty($task->id) ? 'toTaskList' : 'continueAdding');?> | ||||||||
| 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 " | '>testcase->precondition;?> | '> testcase->keywords;?> | '> testcase->stage;?> | +'> testcase->review;?> | '> | '> | ' style='overflow:visible'>testcase->stageList, '', "class='form-control chosen' multiple");?> | +'>testcase->reviewList, $needReview, "class='form-control'");?> | 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/create.html.php b/module/testcase/view/create.html.php index 34bd6ec629..0de4f1996e 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -38,7 +38,7 @@ |
testcase->module?>
-
@@ -78,13 +86,13 @@ $status = $this->session->testTaskVersionStatus;
-
+
+ testcase->forceNotReview()):?>
+ testcase->forceNotReview, '', "id='forceNotReview'");?>
+
";
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/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)
{
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%'");
?>
|
diff --git a/module/testtask/control.php b/module/testtask/control.php
index b5fdf24b70..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();
}
@@ -349,9 +354,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 +406,8 @@ class testtask extends control
/**
* Edit a test task.
- *
- * @param int $taskID
+ *
+ * @param int $taskID
* @access public
* @return void
*/
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 25833bf9cf..61ff1bb631 100644
--- a/module/testtask/model.php
+++ b/module/testtask/model.php
@@ -90,14 +90,14 @@ 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
*/
- 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')
{
@@ -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')
@@ -128,17 +128,40 @@ 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');
+
+ $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
@@ -1076,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 42e9065a20..4df556fd65 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->beginAndEnd;?>
+
+ testtask->to;?>
+
+
+ | 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/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/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 @@
';
echo "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/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');?>
|
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 '";
- 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;?> |
$lang->user->ditto)?>
@@ -89,7 +90,8 @@ $minWidth = (count($visibleFields) > 5) ? 'w-150px' : '';
'> |
'> |
'> |
-
+ > user->limitedUserList, 'no');?> |
+
user->verifyPassword?> |
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' : '';
'> 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;?> |
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 @@
| user->commiter;?> |
commiter, "class='form-control' autocomplete='off'");?> |
+ user->limitedUser;?> |
+ user->limitedUserList, $user->limitedUser);?> |
|
| 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'");?> | 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('