From cd23a2dd23d2dec7f0680bdf29927fa1ac3f43e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 23 Oct 2017 14:09:58 +0800 Subject: [PATCH 01/10] * multiTask assignedDate empty value bug --- module/task/model.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 886fce034f..6270bb316a 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -74,10 +74,11 @@ class taskModel extends model if(!empty($teams)) { - $firstMember = reset($teams); - $task->assignedTo = $firstMember->account; - $task->estimate = $estimate; - $task->left = $left; + $firstMember = reset($teams); + $task->assignedTo = $firstMember->account; + $task->assignedDate = helper::today(); + $task->estimate = $estimate; + $task->left = $left; } } From 5801f9c07de9d0e9cf47a72306b598b72466e71f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 Oct 2017 16:36:02 +0800 Subject: [PATCH 02/10] * fix bug for browse list page. --- module/bug/model.php | 13 ++++--- module/bug/view/browse.html.php | 2 +- module/product/view/browse.html.php | 2 +- module/project/view/datatabledata.html.php | 44 ---------------------- module/project/view/task.html.php | 4 +- module/story/model.php | 13 ++++--- module/task/model.php | 11 ++++-- module/testcase/control.php | 1 + module/testcase/model.php | 13 ++++--- module/testcase/view/browse.html.php | 2 +- module/testtask/model.php | 11 ++++-- module/testtask/view/cases.html.php | 2 +- 12 files changed, 45 insertions(+), 73 deletions(-) delete mode 100644 module/project/view/datatabledata.html.php diff --git a/module/bug/model.php b/module/bug/model.php index 33e52442e6..3a34f1802e 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2310,8 +2310,9 @@ class bugModel extends model * @access public * @return void */ - public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array()) + public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable') { + $canView = common::hasPriv('bug', 'view'); $bugLink = inlink('view', "bugID=$bug->id"); $account = $this->app->user->account; $id = $col->id; @@ -2319,15 +2320,17 @@ class bugModel extends model { $class = ''; if($id == 'status') $class .= ' bug-' . $bug->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'assignedTo' && $bug->assignedTo == $account) $class .= ' red'; if($id == 'deadline' && isset($bug->delay)) $class .= ' delayed'; echo ""; - switch ($id) + switch($id) { case 'id': - echo html::a($bugLink, sprintf('%03d', $bug->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($bugLink, sprintf('%03d', $bug->id)) : sprintf('%03d', $bug->id); break; case 'severity': echo ""; @@ -2344,7 +2347,7 @@ class bugModel extends model echo "[{$this->lang->bug->confirmedList[$bug->confirmed]}] "; if($bug->branch)echo "{$branches[$bug->branch]} "; if($modulePairs and $bug->module)echo "{$modulePairs[$bug->module]} "; - echo html::a($bugLink, $bug->title, null, "style='color: $bug->color'"); + echo $canView ? html::a($bugLink, $bug->title, null, "style='color: $bug->color'") : "{$bug->title}"; break; case 'branch': echo $branches[$bug->branch]; diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index a761bba051..4d3af96683 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -193,7 +193,7 @@ js::set('branch', $branch); - $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks);?> + $value) $this->bug->printCell($value, $bug, $users, $builds, $branches, $modulePairs, $projects, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table');?> diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 8bb6c7f7b5..b7929f2910 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -130,7 +130,7 @@ - $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases);?> + $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?> diff --git a/module/project/view/datatabledata.html.php b/module/project/view/datatabledata.html.php deleted file mode 100644 index 31ac138adf..0000000000 --- a/module/project/view/datatabledata.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @package project - * @version $Id$ - * @link http://www.zentao.net - */ -?> -datatable->getSetting('project'); -$widths = $this->datatable->setFixedFieldWidth($setting); -$columns = 0; -extract($widths); -?> - - - $value) - { - if($value->show) - { - $this->datatable->printHead($value, $orderBy, $vars); - $columns++; - } - } - ?> - - - - - $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?> - - children) foreach($task->children as $child):?> - - $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs);?> - - - - diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 2f2022c87c..311b74f614 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -68,12 +68,12 @@ js::set('browseType', $browseType); - $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs);?> + $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?> children)):?> children as $child):?> - $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs);?> + $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?> diff --git a/module/story/model.php b/module/story/model.php index 402cc7fd5c..017dde597f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2247,8 +2247,9 @@ class storyModel extends model * @access public * @return void */ - public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks, $storyBugs, $storyCases) + public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable') { + $canView = common::hasPriv('story', 'view'); $storyLink = helper::createLink('story', 'view', "storyID=$story->id"); $account = $this->app->user->account; $id = $col->id; @@ -2256,7 +2257,8 @@ class storyModel extends model { $class = ''; if($id == 'status') $class .= ' story-' . $story->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'assignedTo' && $story->assignedTo == $account) $class .= ' red'; $title = ''; @@ -2264,10 +2266,11 @@ class storyModel extends model if($id == 'plan') $title = $story->planTitle; echo " - $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType);?> + $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?> diff --git a/module/testtask/model.php b/module/testtask/model.php index 200ec43d55..ad83c3fc21 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1118,8 +1118,9 @@ class testtaskModel extends model * @access public * @return void */ - public function printCell($col, $run, $users, $task, $branches) + public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable') { + $canView = common::hasPriv('testcase', 'view'); $caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"); $account = $this->app->user->account; $id = $col->id; @@ -1127,7 +1128,8 @@ class testtaskModel extends model { $class = ''; if($id == 'status') $class .= $run->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'lastRunResult') $class .= " $run->lastRunResult"; if($id == 'assignedTo' && $run->assignedTo == $account) $class .= ' red'; @@ -1135,7 +1137,8 @@ class testtaskModel extends model switch ($id) { case 'id': - echo html::a($caseLink, sprintf('%03d', $run->case)); + if($mode == 'table') echo " "; + echo $canView ? html::a($caseLink, sprintf('%03d', $run->case)) : sprintf('%03d', $run->case); break; case 'pri': echo ""; @@ -1144,7 +1147,7 @@ class testtaskModel extends model break; case 'title': if($run->branch) echo "{$branches[$run->branch]}"; - echo html::a($caseLink, $run->title); + echo $canView ? html::a($caseLink, $run->title) : $run->title; break; case 'branch': echo $branches[$run->branch]; diff --git a/module/testtask/view/cases.html.php b/module/testtask/view/cases.html.php index 05b6d970a6..e1caa1c4ef 100644 --- a/module/testtask/view/cases.html.php +++ b/module/testtask/view/cases.html.php @@ -71,7 +71,7 @@ var moduleID = ''; - $value) $this->testtask->printCell($value, $run, $users, $task, $branches);?> + $value) $this->testtask->printCell($value, $run, $users, $task, $branches, $useDatatable ? 'datatable' : 'table');?> From 492bf6e956542f888ca176ee114903f2a6fba6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 23 Oct 2017 16:50:48 +0800 Subject: [PATCH 03/10] * Task Bug --- db/update9.5.1.sql | 21 +++++++++-- module/score/control.php | 10 ++++-- module/score/lang/zh-cn.php | 14 +++++++- module/score/model.php | 4 +++ module/score/view/browse.html.php | 50 ++++++--------------------- module/task/css/create.css | 1 + module/task/js/batchcreate.js | 8 +++++ module/task/js/create.js | 10 ++++-- module/task/view/batchcreate.html.php | 10 +++--- module/task/view/create.html.php | 20 ++++------- 10 files changed, 83 insertions(+), 65 deletions(-) diff --git a/db/update9.5.1.sql b/db/update9.5.1.sql index 789f54ab2e..e8021f50e2 100644 --- a/db/update9.5.1.sql +++ b/db/update9.5.1.sql @@ -36,6 +36,23 @@ ALTER TABLE `zt_team` ADD `left` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0' ALTER TABLE `zt_team` ADD `order` TINYINT(3) NOT NULL DEFAULT '0' AFTER `left`; ALTER TABLE `zt_team` CHANGE `days` `days` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'; - ALTER TABLE `zt_team` DROP PRIMARY KEY; -ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`); \ No newline at end of file +ALTER TABLE `zt_team` ADD PRIMARY KEY (`project`, `task`, `account`); + +ALTER TABLE `zt_user` ADD `score` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `deleted`; +ALTER TABLE `zt_user` ADD `score_level` DECIMAL(12,1) NOT NULL DEFAULT '0' AFTER `score`; + +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `userID` int(11) NOT NULL DEFAULT '0', + `account` varchar(30) NOT NULL, + `model` varchar(30) NOT NULL, + `method` varchar(30) NOT NULL, + `score` decimal(12,1) NOT NULL DEFAULT '0.0', + `type` enum('repeat','one') NOT NULL DEFAULT 'repeat', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`model`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/module/score/control.php b/module/score/control.php index 08c3586b4f..4cb167c4ec 100644 --- a/module/score/control.php +++ b/module/score/control.php @@ -16,9 +16,15 @@ class score extends control * @access public * @return mixed */ - public function browse() + public function browse($recTotal = 0, $recPerPage = 100) { - $this->view->title = $this->lang->score->common; + $this->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage); + $scores = $this->score->getScores($pager); + + $this->view->title = $this->lang->score->common; + $this->view->pager = $pager; + $this->view->scores = $scores; $this->display(); } } \ No newline at end of file diff --git a/module/score/lang/zh-cn.php b/module/score/lang/zh-cn.php index 917048ec31..f090ab8c1b 100644 --- a/module/score/lang/zh-cn.php +++ b/module/score/lang/zh-cn.php @@ -2,4 +2,16 @@ $lang->score->common = '积分'; $lang->score->record = '积分记录'; $lang->score->reset = '重置积分'; -$lang->score->reset = '重置积分'; + +$lang->score->id = '编号'; +$lang->score->userID = '用户ID'; +$lang->score->account = '用户'; +$lang->score->model = '模块'; +$lang->score->method = '方式'; +$lang->score->type = '类型'; +$lang->score->score = '分值'; +$lang->score->time = '时间'; + +$lang->score->methods['login'] = '登录'; +$lang->score->methods['admin'] = ''; +$lang->score->methods['tutorial'] = '新手教程'; diff --git a/module/score/model.php b/module/score/model.php index 0f6f2ef07d..c418afc981 100644 --- a/module/score/model.php +++ b/module/score/model.php @@ -10,5 +10,9 @@ */ class scoreModel extends model { + public function getScores($pager) + { + + } } \ No newline at end of file diff --git a/module/score/view/browse.html.php b/module/score/view/browse.html.php index 6845415fc1..82f353c61c 100644 --- a/module/score/view/browse.html.php +++ b/module/score/view/browse.html.php @@ -18,57 +18,27 @@
"; - switch ($id) + switch($id) { case 'id': - echo html::a($storyLink, sprintf('%03d', $story->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($storyLink, sprintf('%03d', $story->id)) : sprintf('%03d', $story->id); break; case 'pri': echo ""; @@ -2277,7 +2280,7 @@ class storyModel extends model case 'title': if($story->branch) echo "{$branches[$story->branch]} "; if($modulePairs and $story->module) echo "{$modulePairs[$story->module]} "; - echo html::a($storyLink, $story->title, null, "style='color: $story->color'"); + echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color'") : "{$story->title}"; break; case 'plan': echo $story->planTitle; diff --git a/module/task/model.php b/module/task/model.php index 6f69dce32d..ca53e028b5 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1807,8 +1807,9 @@ class taskModel extends model * @access public * @return void */ - public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array()) + public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable') { + $canView = common::hasPriv('task', 'view'); $taskLink = helper::createLink('task', 'view', "taskID=$task->id"); $account = $this->app->user->account; $id = $col->id; @@ -1816,15 +1817,17 @@ class taskModel extends model { $class = ''; if($id == 'status') $class .= ' task-' . $task->status; + if($id == 'id') $class .= ' cell-id'; if($id == 'name' or $id == 'story') $class .= ' text-left'; if($id == 'deadline' and isset($task->delay)) $class .= ' delayed'; if($id == 'assignedTo' && $task->assignedTo == $account) $class .= ' red'; echo ""; - switch ($id) + switch($id) { case 'id': - echo html::a($taskLink, sprintf('%03d', $task->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($taskLink, sprintf('%03d', $task->id)) : sprintf('%03d', $task->id); break; case 'pri': echo ""; @@ -1834,7 +1837,7 @@ class taskModel extends model case 'name': if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if($modulePairs and $task->module) echo "" . $modulePairs[$task->module] . ' '; - echo html::a($taskLink, $task->name, null, "style='color: $task->color'"); + echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "$task->name"; if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'"); if(!empty($task->children)) echo '    '; break; diff --git a/module/testcase/control.php b/module/testcase/control.php index bcbadf5123..c6ad633bcb 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -503,6 +503,7 @@ class testcase extends control $caseFails = $this->dao->select('COUNT(*) AS count')->from(TABLE_TESTRESULT)->where('caseResult')->eq('fail')->andwhere('`case`')->eq($caseID) ->beginIF($from == 'testtask')->andwhere('`run`')->eq($taskID)->fi() ->fetch('count'); + $case->caseFails = $caseFails; $this->view->position[] = $this->lang->testcase->common; $this->view->position[] = $this->lang->testcase->view; diff --git a/module/testcase/model.php b/module/testcase/model.php index d8970b9ff6..1d01119a47 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1232,8 +1232,9 @@ class testcaseModel extends model * @access public * @return void */ - public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '') + public function printCell($col, $case, $users, $branches, $modulePairs = array(), $browseType = '', $mode = 'datatable') { + $canView = common::hasPriv('testcase', 'view'); $caseLink = helper::createLink('testcase', 'view', "caseID=$case->id&version=$case->version"); $account = $this->app->user->account; $id = $col->id; @@ -1241,14 +1242,16 @@ class testcaseModel extends model { $class = ''; if($id == 'status') $class .= $case->status; - if($id == 'title') $class .= ' text-left'; + if($id == 'title') $class .= ' text-left'; + if($id == 'id') $class .= ' cell-id'; if($id == 'lastRunResult') $class .= $case->lastRunResult; echo ""; - switch ($id) + switch($id) { case 'id': - echo html::a($caseLink, sprintf('%03d', $case->id)); + if($mode == 'table') echo " "; + echo $canView ? html::a($caseLink, sprintf('%03d', $case->id)) : sprintf('%03d', $case->id); break; case 'pri': echo ""; @@ -1258,7 +1261,7 @@ class testcaseModel extends model case 'title': if($case->branch) echo "{$branches[$case->branch]} "; if($modulePairs and $case->module) echo "{$modulePairs[$case->module]} "; - echo html::a($caseLink, $case->title, null, "style='color: $case->color'"); + echo $canView ? html::a($caseLink, $case->title, null, "style='color: $case->color'") : "$case->title"; break; case 'branch': echo $branches[$case->branch]; diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 44fbe3fda3..a2f5099c74 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -69,7 +69,7 @@ js::set('branch', $branch);
- recTotal}&recPerPage={$pager->recPerPage}"; ?> - - - - - - + + + + + + + - - objectType == 'case' ? 'testcase' : $action->objectType;?> + - - - - - - + - diff --git a/module/task/css/create.css b/module/task/css/create.css index 1e089a7841..21e7dcdaab 100644 --- a/module/task/css/create.css +++ b/module/task/css/create.css @@ -14,3 +14,4 @@ #taskPlanCol, #mailCol {width: 50%} #planAndMailCell.has-mail-col #taskPlanCol {padding-right: 5px;} #planAndMailCell.has-mail-col #taskPlanCol + #mailCol {padding-left: 5px;} +.input-group-addon input[type='checkBox']{} \ No newline at end of file diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 97e0603d71..13ca2c9e8f 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -153,3 +153,11 @@ $(function() if(storyID != 0) setStoryRelated(0); }) + +// if(projectType == 'ops') +// { +// $("#tableBody th").eq(2).addClass('hidden'); +// $("#tableBody tr").each(function() { +// $(this).find('td').eq(2).addClass('hidden'); +// }); +// } diff --git a/module/task/js/create.js b/module/task/js/create.js index b9b90827af..0129013f0b 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -20,11 +20,16 @@ function copyStoryTitle() /* Set the assignedTos field. */ function setOwners(result) { + $("#multipleBox").removeAttr("checked"); + $('.team-group').addClass('hidden'); + $('#assignedTo, #assignedTo_chosen').removeClass('hidden'); if(result == 'affair') { $('#assignedTo').attr('multiple', 'multiple'); $('#assignedTo').chosen('destroy'); $('#assignedTo').chosen(defaultChosenOptions); + $('.affair').hide(); + $('.team-group').addClass('hidden'); $('#selectAllUser').removeClass('hidden'); } else if($('#assignedTo').attr('multiple') == 'multiple') @@ -32,6 +37,7 @@ function setOwners(result) $('#assignedTo').removeAttr('multiple'); $('#assignedTo').chosen('destroy'); $('#assignedTo').chosen(defaultChosenOptions); + $('.affair').show(); $('#selectAllUser').addClass('hidden'); } } @@ -219,8 +225,8 @@ $('[name^=multiple]').change(function() $('#estimate').attr('readonly', false); } }); - -$(".btn[data-toggle='modalTeam']").click(function() +$(".team-group[data-toggle='modalTeam']").css('cursor', 'pointer'); +$(".team-group[data-toggle='modalTeam']").click(function() { $('#modalTeam').modal('show'); adjustSortBtn(); diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index af9b4e682c..ab74f65672 100644 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -34,12 +34,12 @@ $hiddenStory = ((isonlybody() and $storyID) || $this->config->global->flow == 'o if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; ?> -
action->objectType);?> idAB);?>action->objectName;?>action->actor);?>action->date);?>actions;?>score->id;?>score->account;?>score->model;?>score->method;?>score->type;?>score->score;?>score->time;?>
action->objectTypes, $action->objectType, '');?>objectID;?> - objectType == 'user' ? "account={$action->objectName}" : "id={$action->objectID}"; - if($module == 'doclib') - { - echo $action->objectName; - } - else - { - echo html::a($this->createLink($module, $methodName, $params), $action->objectName); - } - ?> - actor];?>date;?> - id", $lang->action->undelete, 'hiddenwin'); - if($type == 'all') common::printLink('action', 'hideOne', "actionid=$action->id", $lang->action->hideOne, 'hiddenwin'); - ?> -
- -
- action->hideAll, inlink('hideAll'), 'hiddenwin');?> -
action->trashTips;?>
-
- +
show();?>
+
- + type != 'ops'):?> @@ -56,6 +56,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1; $lang->task->typeList['ditto'] = $lang->task->ditto; $members['ditto'] = $lang->task->ditto; $modules['ditto'] = $lang->task->ditto; + if($project->type == 'ops') $colspan = $colspan-1; ?> task->batchCreate; $i++):?> - +
idAB;?> '>task->module?>'>task->story;?>'>task->story;?> task->name;?> typeAB;?> '>task->assignedTo;?> style='overflow:visible'>id, $i)'")?> style='overflow: visible'> + type != 'ops'):?> style='overflow: visible'>
@@ -83,7 +84,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
-
task->colorTag}' data-update-text='#name\\[{$i}\\]'");?> @@ -131,6 +132,7 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
+type);?> task->ditto);?> diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index d88374d6e0..bdd3991996 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -39,25 +39,17 @@ task->assignedTo;?> -
-
- assignedTo, "class='form-control chosen'");?> -
+
+ assignedTo, "class='form-control chosen'");?> type == 'ops') :?> -
- -
- -
- -
+ + +
- type != 'ops') :?> - - + config->global->flow != 'onlyTask'):?> From c9805574df39ca0cd7a12254c0afa737d45ba908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 23 Oct 2017 17:15:45 +0800 Subject: [PATCH 04/10] * task children style --- module/project/css/task.css | 5 ++++- module/project/view/task.html.php | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/module/project/css/task.css b/module/project/css/task.css index 050b253d51..92018e1102 100644 --- a/module/project/css/task.css +++ b/module/project/css/task.css @@ -24,4 +24,7 @@ .pl-5px{padding-left:5px;} tbody > tr > td > .btn-icon {margin-right: 2px} -.table-children td{background-color:#fff0f5!important;} \ No newline at end of file +.table-children{border-left:2px solid #ccc;border-right:2px solid #ccc;} +.table-children.table-child-top{border-top:2px solid #ccc;} +.table-children.table-child-bottom{border-bottom:2px solid #ccc;} +.table-children td{background-color:#f0f8ff!important;} diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 311b74f614..db7f63aea1 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -70,13 +70,18 @@ js::set('browseType', $browseType); $value) $this->task->printCell($value, $task, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?> - children)):?> - children as $child):?> - + children)) + { + $childrenNum = count($task->children); + foreach($task->children as $key=>$child) + { + ?> + parent-id;?>' data-id='id?>'> $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?> - - + + From 1508828fc15866ee8903d6c76952654afc488b38 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 23 Oct 2017 17:21:04 +0800 Subject: [PATCH 05/10] * fix bug select all. --- module/bug/view/browse.html.php | 2 +- module/product/view/browse.html.php | 2 +- module/project/view/task.html.php | 2 +- module/testcase/view/browse.html.php | 2 +- module/testtask/view/cases.html.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 4d3af96683..85ea8cc01b 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -175,7 +175,7 @@ js::set('branch', $branch); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; ?> - ' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='bugIDList[]'> +
' id='bugList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='bugIDList[]'> datatable->setFixedFieldWidth($setting); $columns = 0; ?> -
' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='storyIDList[]'> +
' id='storyList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='storyIDList[]'> datatable->setFixedFieldWidth($setting); $columns = 0; ?> -
' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='taskIDList[]'> +
' id='taskList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='taskIDList[]'> $value) diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index a2f5099c74..7a2d74378d 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -51,7 +51,7 @@ js::set('branch', $branch); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; ?> -
' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='caseIDList[]'> +
' id='caseList' data-checkable='true' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='caseIDList[]'> '; $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; ?> -
' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='caseIDList[]'> +
' id='caseList' data-checkable='' data-fixed-left-width='' data-fixed-right-width='' data-custom-menu='true' data-checkbox-name='caseIDList[]'> Date: Mon, 23 Oct 2017 17:32:20 +0800 Subject: [PATCH 06/10] * change children style --- module/project/css/task.css | 2 +- module/project/view/task.html.php | 2 +- module/task/model.php | 19 +++++++++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/module/project/css/task.css b/module/project/css/task.css index 92018e1102..5fdb5c8091 100644 --- a/module/project/css/task.css +++ b/module/project/css/task.css @@ -27,4 +27,4 @@ tbody > tr > td > .btn-icon {margin-right: 2px} .table-children{border-left:2px solid #ccc;border-right:2px solid #ccc;} .table-children.table-child-top{border-top:2px solid #ccc;} .table-children.table-child-bottom{border-bottom:2px solid #ccc;} -.table-children td{background-color:#f0f8ff!important;} +.table-children td{background-color:#fff!important;} diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 78c7a36c79..8b15438e12 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -78,7 +78,7 @@ js::set('browseType', $browseType); { ?> parent-id;?>' data-id='id?>'> - $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table');?> + $value) $this->task->printCell($value, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table', true);?> diff --git a/module/task/model.php b/module/task/model.php index 369279eec0..4e9fce9f80 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1804,14 +1804,19 @@ class taskModel extends model /** * Print cell data. * - * @param object $col - * @param object $task - * @param array $users - * @param string $browseType + * @param $col + * @param $task + * @param $users + * @param $browseType + * @param $branchGroups + * @param array $modulePairs + * @param string $mode + * @param bool $child + * * @access public * @return void */ - public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable') + public function printCell($col, $task, $users, $browseType, $branchGroups, $modulePairs = array(), $mode = 'datatable', $child = false) { $canView = common::hasPriv('task', 'view'); $taskLink = helper::createLink('task', 'view', "taskID=$task->id"); @@ -1830,7 +1835,8 @@ class taskModel extends model switch($id) { case 'id': - if($mode == 'table') echo " "; + if($mode == 'table' && $child == false) echo " "; + if($child) echo '    '; echo $canView ? html::a($taskLink, sprintf('%03d', $task->id)) : sprintf('%03d', $task->id); break; case 'pri': @@ -1841,6 +1847,7 @@ class taskModel extends model case 'name': if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if($modulePairs and $task->module) echo "" . $modulePairs[$task->module] . ' '; + if($child) echo ''.$this->lang->task->childrenAB.' '; echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "$task->name"; if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'"); if(!empty($task->children)) echo '    '; From c0ccf6ff4bc060dc055e5e00c21e80aea4c42f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 23 Oct 2017 17:48:26 +0800 Subject: [PATCH 07/10] * Task style --- module/task/lang/zh-cn.php | 1 - module/task/model.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 5d1087ef11..1c7ad02246 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -103,7 +103,6 @@ $lang->task->transmitTo = '转交给'; $lang->task->children = '子任务'; $lang->task->childrenAB = '子'; $lang->task->parent = '父任务'; -$lang->task->unfinished = '未完成'; $lang->task->lblPri = 'P'; $lang->task->lblHour = '(h)'; diff --git a/module/task/model.php b/module/task/model.php index 4e9fce9f80..8cabec4709 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1848,6 +1848,7 @@ class taskModel extends model if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "" . $branchGroups[$task->product][$task->branch] . ' '; if($modulePairs and $task->module) echo "" . $modulePairs[$task->module] . ' '; if($child) echo ''.$this->lang->task->childrenAB.' '; + if(!empty($task->team)) echo ''.$this->lang->task->multipleAB.' '; echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "$task->name"; if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'"); if(!empty($task->children)) echo '    '; From 4a7c7c74027d73e2b413293ec52fbe176b1ca465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 23 Oct 2017 21:13:35 +0800 Subject: [PATCH 08/10] * Task Status change --- module/task/control.php | 3 +- module/task/model.php | 62 ++++++++++++++++++++++++++++++++++ module/task/view/edit.html.php | 2 ++ 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index 002e5c1db6..c3865d194d 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -233,7 +233,8 @@ class task extends control */ public function commonAction($taskID) { - $this->view->task = $this->loadModel('task')->getByID($taskID); + $task=$this->loadModel('task')->getByID($taskID); + $this->view->task = $task; $this->view->project = $this->project->getById($this->view->task->project); $this->view->members = $this->project->getTeamMemberPairs($this->view->project->id ,'nodeleted'); $this->view->actions = $this->loadModel('action')->getList('task', $taskID); diff --git a/module/task/model.php b/module/task/model.php index 8cabec4709..28da7f60cf 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -278,6 +278,31 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($newTask)->autoCheck()->where('id')->eq($taskID)->exec(); } + /** + * Check that all child status + * + * @param $parentID + * @param $status + * + * @access private + * @return bool + */ + private function parentStatus($parentID,$status='done') + { + if(!$parentID) return true; + $data = new stdClass(); + $children = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->fetchPairs('id', 'status'); + $values = array_values(array_unique($children)); + if(count($values) == 1 && $values[0] == $status) + { + $data->status = $status; + $this->dao->update(TABLE_TASK)->data($data) + ->autoCheck() + ->where('id')->eq($parentID)->exec(); + } + } + + /** * Update a task. * @@ -690,6 +715,23 @@ class taskModel extends model ->check('consumed,left', 'float') ->where('id')->eq((int)$taskID)->exec(); + if($oldTask->parent) + { + switch($task->status) + { + case 'doing': + $status = new stdClass(); + $status->status = 'doing'; + $this->dao->update(TABLE_TASK)->data($status)->autoCheck()->where('id')->eq((int)$oldTask->parent)->exec(); + break; + case 'done': + $this->parentStatus($oldTask->parent,'done'); + break; + } + } + + $this->countTime($oldTask->parent); + if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); } @@ -802,6 +844,7 @@ class taskModel extends model if(!empty($actionID)) $this->action->logHistory($actionID, $changes); if($task->story) $this->loadModel('story')->setStage($task->story); + if($task->status=='done') $this->parentStatus($task->parent,'done'); $this->countTime($task->parent); return $changes; @@ -849,6 +892,9 @@ class taskModel extends model ->check('consumed', 'notempty') ->where('id')->eq((int)$taskID)->exec(); + if($task->status=='done') $this->parentStatus($oldTask->parent,'done'); + $this->countTime($oldTask->parent); + if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); } @@ -898,6 +944,12 @@ class taskModel extends model ->remove('comment')->get(); $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); + $this->parentStatus($oldTask->parent,'closed'); + $this->countTime($oldTask->parent); + + $data = new stdClass(); + $data->status = 'closed'; + $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('parent')->eq($taskID)->exec(); if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); @@ -954,6 +1006,13 @@ class taskModel extends model ->check('left', 'notempty') ->where('id')->eq((int)$taskID)->exec(); + $this->countTime($oldTask->parent); + + $data = new stdClass(); + $data->status = 'doing'; + $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('parent')->eq($taskID)->exec(); + if($oldTask->parent) $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq((int)$oldTask->parent)->exec(); + if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story); if(!dao::isError()) return common::createChanges($oldTask, $task); @@ -1756,6 +1815,9 @@ class taskModel extends model if($action == 'start' and !empty($task->children)) return false; if($action == 'recordestimate' and !empty($task->children)) return false; + if($action == 'finish' and !empty($task->children)) return false; + if($action == 'cancel' and !empty($task->children)) return false; + if($action == 'pause' and !empty($task->children)) return false; if($action == 'batchcreate' and !empty($task->team)) return false; if($action == 'batchcreate' and $task->parent) return false; diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index bf6af02834..015d52aa9b 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -97,10 +97,12 @@ + children)):?> + From 91eb91ecb1b9a41a3823e1cb0679cd2e39c59881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Mon, 23 Oct 2017 21:16:23 +0800 Subject: [PATCH 09/10] * format task model --- module/task/model.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 28da7f60cf..bc3c58ccc9 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -249,10 +249,10 @@ class taskModel extends model * * @param $taskID * - * @access public + * @access private * @return void */ - public function countTime($taskID) + private function countTime($taskID) { if(!$taskID) return true; @@ -287,7 +287,7 @@ class taskModel extends model * @access private * @return bool */ - private function parentStatus($parentID,$status='done') + private function parentStatus($parentID, $status = 'done') { if(!$parentID) return true; $data = new stdClass(); @@ -296,9 +296,7 @@ class taskModel extends model if(count($values) == 1 && $values[0] == $status) { $data->status = $status; - $this->dao->update(TABLE_TASK)->data($data) - ->autoCheck() - ->where('id')->eq($parentID)->exec(); + $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq($parentID)->exec(); } } From a8e3dd25b97012534e23676a620f5827e3f2395c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 24 Oct 2017 08:46:41 +0800 Subject: [PATCH 10/10] * childTask status change --- module/task/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index bc3c58ccc9..6232d3eb6c 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -293,7 +293,7 @@ class taskModel extends model $data = new stdClass(); $children = $this->dao->select('id,status')->from(TABLE_TASK)->where('parent')->eq($parentID)->fetchPairs('id', 'status'); $values = array_values(array_unique($children)); - if(count($values) == 1 && $values[0] == $status) + if((count($values) == 1 && $values[0] == $status) || (count($values) == 2 && in_array('closed', $values) && $status == 'done')) { $data->status = $status; $this->dao->update(TABLE_TASK)->data($data)->autoCheck()->where('id')->eq($parentID)->exec(); @@ -842,7 +842,7 @@ class taskModel extends model if(!empty($actionID)) $this->action->logHistory($actionID, $changes); if($task->story) $this->loadModel('story')->setStage($task->story); - if($task->status=='done') $this->parentStatus($task->parent,'done'); + if($task->status == 'done') $this->parentStatus($task->parent, 'done'); $this->countTime($task->parent); return $changes; @@ -890,7 +890,7 @@ class taskModel extends model ->check('consumed', 'notempty') ->where('id')->eq((int)$taskID)->exec(); - if($task->status=='done') $this->parentStatus($oldTask->parent,'done'); + if($task->status == 'done') $this->parentStatus($oldTask->parent, 'done'); $this->countTime($oldTask->parent); if($oldTask->story) $this->loadModel('story')->setStage($oldTask->story);
task->type;?> task->typeList, $task->type, 'class=form-control');?>
task->status;?> task->statusList, $task->status, 'class=form-control');?>
task->pri;?> task->priList, $task->pri, 'class=form-control');?>