From 00627dc8359e75b2aa5a70c4efab09f9c32348e2 Mon Sep 17 00:00:00 2001 From: chujilu Date: Fri, 22 Aug 2014 15:24:29 +0800 Subject: [PATCH 1/7] * activate Bug when importbug if bug postponed. --- lib/dao/dao.class.php | 2 +- module/project/model.php | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index c41ea6fa78..53c6f84435 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -242,7 +242,7 @@ class dao /** * The count method, call sql::select() and from(). - * use as $this->dao->count()->from(TABLE_BUG)->where('')->fetch('count'); + * use as $this->dao->select()->from(TABLE_BUG)->where()->count(); * * @access public * @return void diff --git a/module/project/model.php b/module/project/model.php index c6f469d8e8..6336d2b923 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -984,6 +984,30 @@ class projectModel extends model $this->action->create('bug', $key, 'Totask', '', $taskID); $this->dao->update(TABLE_BUG)->set('toTask')->eq($taskID)->where('id')->eq($key)->exec(); + /* activate bug if bug postponed. */ + if($bug->status == 'resolved' && $bug->resolution == 'postponed') + { + $newBug = new stdclass(); + $newBug->lastEditedBy = $this->app->user->account; + $newBug->lastEditedDate = $now; + $newBug->assignedDate = $now; + $newBug->status = 'active'; + $newBug->resolvedDate = '0000-00-00'; + $newBug->resolution = ''; + $newBug->resolvedBy = ''; + $newBug->resolvedBuild = ''; + $newBug->closedBy = ''; + $newBug->closedDate = '0000-00-00'; + $newBug->duplicateBug = '0'; + + $this->dao->update(TABLE_BUG)->data($newBug)->autoCheck()->where('id')->eq($key)->exec(); + $this->dao->update(TABLE_BUG)->set('activatedCount = activatedCount + 1')->where('id')->eq($key)->exec(); + + $actionID = $this->action->create('bug', $key, 'Activated'); + $changes = common::createChanges($bug, $newBug); + $this->action->logHistory($actionID, $changes); + } + if(isset($task->assignedTo) and $task->assignedTo and $task->assignedTo != $bug->assignedTo) { $newBug = new stdClass(); From bf8bbb4608975ec7a2c660cc3c58b50654bb7c5a Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 22 Aug 2014 15:27:49 +0800 Subject: [PATCH 2/7] * ajusted title style of modal. --- www/theme/default/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 7a8c118948..e4334e7bb0 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -463,8 +463,8 @@ body {font-size: 13px; color:#141414;padding-bottom: 40px;} #titlebar > .heading > strong a:hover {color: #1A53FF} #titlebar > .heading > strong > i, #titlebar > .heading > strong > small > i {display: none} #titlebar > .heading > small > i {position: relative; top: 1px; display: none} -#titlebar > .heading > small {font-size: 14px; color: #333;} -#titlebar > .heading > small:before {content: '::'} +#titlebar > .heading > small {font-size: 14px; color: #333; font-weight: normal;} +#titlebar > .heading > small:before {content: '\e6e1'; font-family: ZenIcon; font-weight: normal;} #titlebar .actions {position: absolute; right: 20px; top: 8px;} #titlebar .actions > .btn, #titlebar .actions > .btn-group {margin-left: 8px;} #titlebar .actions > .text {display: inline-block; margin-left: 8px; line-height: 30px} From e5ccae20a5a20bf2e95c8be8cea3e886abe4f6f4 Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 22 Aug 2014 15:35:26 +0800 Subject: [PATCH 3/7] * ajusted style of user/edit. --- module/user/css/edit.css | 1 + 1 file changed, 1 insertion(+) create mode 100644 module/user/css/edit.css diff --git a/module/user/css/edit.css b/module/user/css/edit.css new file mode 100644 index 0000000000..944bc8b2ab --- /dev/null +++ b/module/user/css/edit.css @@ -0,0 +1 @@ +.table caption {border: none; border-bottom: 1px solid #ddd} From a8d518577e7d8baf4c3ca7764e4ddc4fbd3beac1 Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 22 Aug 2014 15:35:50 +0800 Subject: [PATCH 4/7] * ajusted title style of modal. --- www/theme/default/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index e4334e7bb0..f72f24dcbb 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -463,7 +463,7 @@ body {font-size: 13px; color:#141414;padding-bottom: 40px;} #titlebar > .heading > strong a:hover {color: #1A53FF} #titlebar > .heading > strong > i, #titlebar > .heading > strong > small > i {display: none} #titlebar > .heading > small > i {position: relative; top: 1px; display: none} -#titlebar > .heading > small {font-size: 14px; color: #333; font-weight: normal;} +#titlebar > .heading > small {font-size: 14px; color: #333;} #titlebar > .heading > small:before {content: '\e6e1'; font-family: ZenIcon; font-weight: normal;} #titlebar .actions {position: absolute; right: 20px; top: 8px;} #titlebar .actions > .btn, #titlebar .actions > .btn-group {margin-left: 8px;} From b29af641af7cff1fd4d167c65e1a19204995049a Mon Sep 17 00:00:00 2001 From: chujilu Date: Fri, 22 Aug 2014 18:00:53 +0800 Subject: [PATCH 5/7] * finish task #2051 --- module/action/lang/en.php | 5 --- module/action/lang/zh-cn.php | 5 --- module/action/model.php | 56 ++++++++++++++++++++++++++++------ module/build/lang/en.php | 3 ++ module/build/lang/zh-cn.php | 3 ++ module/testtask/lang/en.php | 4 +++ module/testtask/lang/zh-cn.php | 4 +++ 7 files changed, 61 insertions(+), 19 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 16046e5e25..84f70c98e8 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -97,11 +97,6 @@ $lang->action->desc->diff1 = 'changed %s, old i $lang->action->desc->diff2 = 'changed %s, the diff is:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = "changed file's name %s to %s."; -$lang->action->desc->project = new stdclass(); -$lang->action->desc->project->started = '$date, $actor started test task. $objectID。' . "\n"; -$lang->action->desc->project->closed = '$date, $actor closed test task. $objectID。' . "\n"; -$lang->action->desc->project->opened = '$date, $actor created build. $objectID。' . "\n"; - /* The action labels. */ $lang->action->label = new stdclass(); $lang->action->label->created = 'created'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index fa884d68cf..9a1439dc37 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -97,11 +97,6 @@ $lang->action->desc->diff1 = '修改了 %s, $lang->action->desc->diff2 = '修改了 %s,区别为:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n"; -$lang->action->desc->project = new stdclass(); -$lang->action->desc->project->started = '$date, 由 $actor 启动测试任务 $objectID。' . "\n"; -$lang->action->desc->project->closed = '$date, 由 $actor 完成测试任务 $objectID。' . "\n"; -$lang->action->desc->project->opened = '$date, 由 $actor 创建版本 $objectID。' . "\n"; - /* 用来显示动态信息。*/ $lang->action->label = new stdclass(); $lang->action->label->created = '创建'; diff --git a/module/action/model.php b/module/action/model.php index 22a2db3fcd..8b00f09ef8 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -186,10 +186,13 @@ class actionModel extends model { $commiters = $this->loadModel('user')->getCommiters(); $actions = $this->dao->select('*')->from(TABLE_ACTION) + ->beginIF($objectType == 'project') + ->where("objectType IN('project', 'testtask', 'build')") + ->andWhere('project')->eq($objectID) + ->fi() + ->beginIF($objectType != 'project') ->where('objectType')->eq($objectType) ->andWhere('objectID')->eq($objectID) - ->beginIF($objectType == 'project') - ->orWhere("project = $objectID AND ((objectType = 'testtask' AND action IN('started','closed')) OR (objectType = 'build' AND action = 'opened'))") ->fi() ->orderBy('date, id')->fetchAll('id'); $histories = $this->getHistory(array_keys($actions)); @@ -202,9 +205,51 @@ class actionModel extends model $action->comment = $this->file->setImgSize($action->comment, $this->config->action->commonImgSize); $actions[$actionID] = $action; } + + if($objectType == 'project') + { + $this->app->loadLang('build'); + $this->app->loadLang('testtask'); + return $this->processProjectActions($actions); + } + return $actions; } + public function processProjectActions($actions) + { + $newActions = array(); + foreach($actions as $action) + { + if($action->objectType == 'project') + { + $newActions[] = $action; + } + elseif($action->objectType == 'testtask') + { + if($action->action == 'started') + { + $action->action = 'testtaskstarted'; + $newActions[] = $action; + } + elseif($action->action == 'closed') + { + $action->action = 'testtaskclosed'; + $newActions[] = $action; + } + } + elseif($action->objectType == 'build') + { + if($action->action == 'opened') + { + $action->action = 'buildopened'; + $newActions[] = $action; + } + } + } + return $newActions; + } + /** * Get an action record. * @@ -318,13 +363,6 @@ class actionModel extends model $desc = $action->extra ? $this->lang->action->desc->extra : $this->lang->action->desc->common; } - /* if module == 'project' and method == 'view' and objectType in 'testtask, build', try to find special lang */ - if($this->app->getModuleName() == 'project' && $this->app->getMethodName() == 'view') - { - if(($objectType == 'testtask' || $objectType == 'build') && isset($this->lang->action->desc->project->$actionType)) - $desc = $this->lang->action->desc->project->$actionType; - } - if($this->app->getViewType() == 'mhtml') $action->date = date('m-d H:i', strtotime($action->date)); /* Cycle actions, replace vars. */ diff --git a/module/build/lang/en.php b/module/build/lang/en.php index f23ded2ac2..0d6244af80 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -45,3 +45,6 @@ $lang->build->resolvedBugs = 'The total solution of bug%s'; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = 'Software source code repository, such as Subversion or Git'; $lang->build->placeholder->filePath = 'The path of this build package to download'; + +$lang->build->action = new stdclass(); +$lang->build->action->buildopened = '$date, $actor created build. $objectID。' . "\n"; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index d460db18a6..e2bfc28c2f 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -45,3 +45,6 @@ $lang->build->resolvedBugs = '本次共解决Bug%s个'; $lang->build->placeholder = new stdclass(); $lang->build->placeholder->scmPath = ' 软件源代码库,如Subversion、Git库地址'; $lang->build->placeholder->filePath = ' 该版本软件包下载存储地址'; + +$lang->build->action = new stdclass(); +$lang->build->action->buildopened = '$date, 由 $actor 创建版本 $objectID。' . "\n"; diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index c1a8afa874..2a87f8756c 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -103,3 +103,7 @@ $lang->testtask->mail->create->title = "%s created testtask #%s:%s"; $lang->testtask->mail->edit->title = "%s finished testtask #%s:%s"; $lang->testtask->testScope = 'Test scope'; + +$lang->testtask->action = new stdclass(); +$lang->testtask->action->testtaskstarted = '$date, 由 $actor started test task. $objectID。' . "\n"; +$lang->testtask->action->testtaskclosed = '$date, 由 $actor finished test task. $objectID。' . "\n"; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 178d5070e1..ec4361026d 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -103,3 +103,7 @@ $lang->testtask->mail->create->title = "%s创建了测试任务 #%s:%s"; $lang->testtask->mail->edit->title = "%s编辑了测试任务 #%s:%s"; $lang->testtask->testScope = '测试范畴'; + +$lang->testtask->action = new stdclass(); +$lang->testtask->action->testtaskstarted = '$date, 由 $actor 启动测试任务 $objectID。' . "\n"; +$lang->testtask->action->testtaskclosed = '$date, 由 $actor 完成测试任务 $objectID。' . "\n"; From 68312723dfe3905af05c56c87520a2b805f2db3d Mon Sep 17 00:00:00 2001 From: chujilu Date: Fri, 22 Aug 2014 18:21:25 +0800 Subject: [PATCH 6/7] * adjust code --- module/project/view/putoff.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/view/putoff.html.php b/module/project/view/putoff.html.php index 5fa16b81b9..936bd3c543 100644 --- a/module/project/view/putoff.html.php +++ b/module/project/view/putoff.html.php @@ -25,7 +25,7 @@
- +
project->dateRange;?>project->dateRange;?>
begin, "class='form-control form-date' onchange='computeWorkDays()' placeholder='" . $lang->project->begin . "'");?> From c11b5a1d27de0209c124a6bc7d321ce69a0f905b Mon Sep 17 00:00:00 2001 From: chujilu Date: Sun, 24 Aug 2014 09:49:48 +0800 Subject: [PATCH 7/7] * format code --- module/action/model.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/action/model.php b/module/action/model.php index 8b00f09ef8..4fb0498b72 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -216,6 +216,13 @@ class actionModel extends model return $actions; } + /** + * process Project Actions change actionStype + * + * @param array $actions + * @access public + * @return void + */ public function processProjectActions($actions) { $newActions = array();