From 0edae7664d1e6136c623670affa3cf89cc4fc0c6 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Thu, 25 Nov 2021 15:42:18 +0800 Subject: [PATCH 01/26] *Finish task #45148. --- module/project/lang/zh-cn.php | 4 ++-- module/project/view/view.html.php | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 4c83291870..540943168e 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -108,8 +108,8 @@ $lang->project->surplus = '剩余'; $lang->project->progress = '进度'; $lang->project->dateRange = '起止日期'; $lang->project->to = '至'; -$lang->project->realEnd = '实际完成日期'; -$lang->project->realBegan = '实际开始日期'; +$lang->project->realEnd = '实际完成'; +$lang->project->realBegan = '实际开始'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; $lang->project->bycard = '卡片'; diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 9d938a30fd..5d6f23f277 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -178,25 +178,39 @@ project->begin;?> begin;?> - execution->totalEstimate;?> - totalEstimate . $lang->execution->workHour;?> + project->realBegan;?> + realBegan == 0000-00-00):;?> + + + realBegan;?> + project->end;?> end;?> - execution->totalConsumed;?> - totalConsumed . $lang->execution->workHour;?> + project->realEnd;?> + realEnd == 0000-00-00):;?> + + + realEnd;?> + + execution->totalEstimate;?> + totalEstimate . $lang->execution->workHour;?> execution->totalDays;?> days;?> - execution->totalLeft;?> - totalLeft . $lang->execution->workHour;?> + execution->totalConsumed;?> + totalConsumed . $lang->execution->workHour;?> execution->totalHours;?> totalHours . $lang->execution->workHour;?> + + execution->totalLeft;?> + totalLeft . $lang->execution->workHour;?> + From 2f41e85fda811b2e29064adb77be6b1fb5bb8c3f Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Fri, 26 Nov 2021 08:30:55 +0800 Subject: [PATCH 02/26] *Finish task #sprint/168_zhengrunyu_45148. --- module/execution/model.php | 1 - module/execution/view/close.html.php | 8 ++++++++ module/execution/view/start.html.php | 8 ++++++++ module/execution/view/view.html.php | 4 ++-- module/project/view/close.html.php | 8 ++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index b9bfe0d9f1..9bd30cb925 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -700,7 +700,6 @@ class executionModel extends model $now = helper::now(); $execution = fixer::input('post') - ->add('realBegan', helper::today()) ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) diff --git a/module/execution/view/close.html.php b/module/execution/view/close.html.php index cd2f0062bf..e2933e2dfa 100644 --- a/module/execution/view/close.html.php +++ b/module/execution/view/close.html.php @@ -30,6 +30,14 @@ printExtendFields($execution, 'table');?> + + execution->realEnd;?> + +
+ realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date'");?> +
+ + comment;?> diff --git a/module/execution/view/start.html.php b/module/execution/view/start.html.php index b45485f913..7b96b36706 100644 --- a/module/execution/view/start.html.php +++ b/module/execution/view/start.html.php @@ -26,6 +26,14 @@ printExtendFields($execution, 'table', 'columns=2');?> + + + + diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 8a22dd6221..3f1476587d 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -239,7 +239,7 @@ - realBegan == 0000-00-00): ?> + realBegan == '0000-00-00'): ?> @@ -249,7 +249,7 @@ - realEnd == 0000-00-00): ?> + realEnd == '0000-00-00'): ?> diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 9cdb9c957e..4f0060bbd3 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -30,6 +30,14 @@ printExtendFields($project, 'table');?> + + + + From 07363c68ffc6eaac1c97f99f51988595358890d0 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Fri, 26 Nov 2021 09:01:56 +0800 Subject: [PATCH 03/26] *Finish task #45148. --- module/execution/view/view.html.php | 12 ++---------- module/project/view/view.html.php | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 3f1476587d..4b1a0b8932 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -239,21 +239,13 @@ - realBegan == '0000-00-00'): ?> - - - - + - realEnd == '0000-00-00'): ?> - - - - + diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 5d6f23f277..9972d2dec9 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -179,21 +179,13 @@ - realBegan == 0000-00-00):;?> - - - - + - realEnd == 0000-00-00):;?> - - - - + From 9dac5358e393208b8842ce3a1a23f62edce7cde3 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Fri, 26 Nov 2021 15:20:17 +0800 Subject: [PATCH 04/26] *Finish task #45148. --- module/execution/lang/en.php | 4 ++++ module/execution/lang/zh-cn.php | 5 +++++ module/execution/model.php | 31 ++++++++++++++++++++++++++-- module/execution/view/close.html.php | 2 +- module/execution/view/start.html.php | 2 +- module/project/lang/en.php | 3 +++ module/project/lang/zh-cn.php | 3 +++ module/project/model.php | 13 ++++++++++++ module/project/view/close.html.php | 2 +- 9 files changed, 60 insertions(+), 5 deletions(-) diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 5ff823d2c8..357248ea13 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -351,6 +351,10 @@ $lang->execution->unfinishedExecution = "This {$lang->executionCommon} h $lang->execution->unfinishedTask = "[%s] unfinished tasks. "; $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; +$lang->execution->realBeganNotEmpty = 'Real Began should not be empty.'; +$lang->execution->realBeganNotFuture = 'Real Began should not be a feture date.'; +$lang->execution->realEndNotEmpty = 'Real End should not be empty.'; +$lang->execution->realEndNotFuture = 'Real End should not be a feture date.'; /* Statistics. */ $lang->execution->charts = new stdclass(); diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 6213a08bf4..99132abcdb 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -351,6 +351,11 @@ $lang->execution->unfinishedExecution = "该{$lang->executionCommon}下 $lang->execution->unfinishedTask = "[%s]个未完成的任务,"; $lang->execution->unresolvedBug = "[%s]个未解决的bug,"; $lang->execution->projectNotEmpty = '所属项目不能为空。'; +$lang->execution->realBeganNotEmpty = "实际开始不能为空。"; +$lang->execution->realBeganNotFuture = "实际开始不能为未来日期。"; +$lang->execution->realEndNotEmpty = "实际完成不能为空。"; +$lang->execution->realEndNotFuture = "实际完成不能为未来日期。"; + /* 统计。*/ $lang->execution->charts = new stdclass(); diff --git a/module/execution/model.php b/module/execution/model.php index 9bd30cb925..f58916ea63 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -706,8 +706,23 @@ class executionModel extends model ->remove('comment')->get(); $this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec(); + + if(!dao::isError()) + { + if($execution->realBegan == '') + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; + return false; + } - if(!dao::isError()) return common::createChanges($oldExecution, $execution); + if($execution->realBegan > $now) + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; + return false; + } + + return common::createChanges($oldExecution, $execution); + } } /** @@ -778,6 +793,7 @@ class executionModel extends model $now = helper::now(); $execution = fixer::input('post') + ->setDefault('realEnd','') ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) @@ -847,7 +863,6 @@ class executionModel extends model $execution = fixer::input('post') ->setDefault('status', 'closed') - ->setDefault('realEnd', helper::today()) ->setDefault('closedBy', $this->app->user->account) ->setDefault('closedDate', $now) ->setDefault('lastEditedBy', $this->app->user->account) @@ -861,6 +876,18 @@ class executionModel extends model ->exec(); if(!dao::isError()) { + if($execution->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty; + return false; + } + + if($execution->realEnd > $now) + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; + return false; + } + $this->loadModel('score')->create('execution', 'close', $oldExecution); return common::createChanges($oldExecution, $execution); } diff --git a/module/execution/view/close.html.php b/module/execution/view/close.html.php index e2933e2dfa..11ebcd1ed4 100644 --- a/module/execution/view/close.html.php +++ b/module/execution/view/close.html.php @@ -34,7 +34,7 @@ diff --git a/module/execution/view/start.html.php b/module/execution/view/start.html.php index 7b96b36706..6f9e74185c 100644 --- a/module/execution/view/start.html.php +++ b/module/execution/view/start.html.php @@ -30,7 +30,7 @@ diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 26995676bb..6c2b0f6b3d 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -177,6 +177,9 @@ $lang->project->createExecution = "There is no {$lang->executionCommon} u $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; +$lang->project->realEndNotEmpty = 'Real End should not be empty.'; +$lang->project->realEndNotFuture = 'Real End should not be a feture date.'; + $lang->project->tenThousand = ''; $lang->project->unitList['CNY'] = 'RMB'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 540943168e..c3982efcae 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -177,6 +177,9 @@ $lang->project->createExecution = "该项目下没有{$lang->executionCom $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->execution->common},是否同时将其移除?(该用户所产生的数据不会受影响。)"; $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?"; +$lang->project->realEndNotEmpty = "实际完成不能为空。"; +$lang->project->realEndNotFuture = "实际完成不能为未来日期。"; + $lang->project->tenThousand = '万'; $lang->project->unitList['CNY'] = '人民币'; diff --git a/module/project/model.php b/module/project/model.php index 0270fd325b..1f4e3cb979 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1206,6 +1206,7 @@ class projectModel extends model $now = helper::now(); $project = fixer::input('post') + ->setDefault('realEnd','') ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) @@ -1288,6 +1289,18 @@ class projectModel extends model ->exec(); if(!dao::isError()) { + if($project->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; + return false; + } + + if($project->realEnd > $now) + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; + return false; + } + $this->loadModel('score')->create('project', 'close', $oldProject); return common::createChanges($oldProject, $project); } diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 4f0060bbd3..0fd52dabdd 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -34,7 +34,7 @@ From b3c8ee7ccbb5a01b55d788181885a07d37371d2a Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Mon, 29 Nov 2021 09:29:44 +0800 Subject: [PATCH 05/26] *Finish task #45148. --- module/execution/lang/en.php | 20 +++++++++++--------- module/execution/lang/zh-cn.php | 2 ++ module/execution/view/close.html.php | 2 +- module/execution/view/start.html.php | 2 +- module/program/lang/en.php | 2 +- module/project/lang/en.php | 10 ++++++---- module/project/lang/zh-cn.php | 2 ++ module/project/view/close.html.php | 2 +- 8 files changed, 25 insertions(+), 17 deletions(-) diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 357248ea13..957daa8586 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -31,15 +31,17 @@ $lang->execution->canceledDate = 'CanceledDate'; $lang->execution->begin = 'Begin'; $lang->execution->end = 'End'; $lang->execution->dateRange = 'Duration'; -$lang->execution->realBegan = 'Actual start'; -$lang->execution->realEnd = 'Actual end'; +$lang->execution->realBegan = 'Actual Begin'; +$lang->execution->realBeganDate = 'Actual Begin'; +$lang->execution->realEnd = 'Actual End'; +$lang->execution->realEndDate = 'Actual End'; $lang->execution->to = 'To'; -$lang->execution->days = 'Available Days'; +$lang->execution->days = ' Days'; $lang->execution->day = ' Days'; $lang->execution->workHour = ' Hours'; $lang->execution->workHourUnit = 'H'; -$lang->execution->totalHours = 'Available Hours'; -$lang->execution->totalDays = 'Available Days'; +$lang->execution->totalHours = ' Hours'; +$lang->execution->totalDays = ' Days'; $lang->execution->status = $lang->executionCommon . 'Status'; $lang->execution->execStatus = 'Status'; $lang->execution->subStatus = 'Sub Status'; @@ -351,10 +353,10 @@ $lang->execution->unfinishedExecution = "This {$lang->executionCommon} h $lang->execution->unfinishedTask = "[%s] unfinished tasks. "; $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; -$lang->execution->realBeganNotEmpty = 'Real Began should not be empty.'; -$lang->execution->realBeganNotFuture = 'Real Began should not be a feture date.'; -$lang->execution->realEndNotEmpty = 'Real End should not be empty.'; -$lang->execution->realEndNotFuture = 'Real End should not be a feture date.'; +$lang->execution->realBeganNotEmpty = 'Actual begin should not be empty.'; +$lang->execution->realBeganNotFuture = 'Actual begin should not be a future date.'; +$lang->execution->realEndNotEmpty = 'Actual end should not be empty.'; +$lang->execution->realEndNotFuture = 'Actual end should not be a future date.'; /* Statistics. */ $lang->execution->charts = new stdclass(); diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 99132abcdb..7bb3f39c8d 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -33,6 +33,8 @@ $lang->execution->end = '计划完成'; $lang->execution->dateRange = '起始日期'; $lang->execution->realBegan = '实际开始'; $lang->execution->realEnd = '实际完成'; +$lang->execution->realBeganDate = '实际开始日期'; +$lang->execution->realEndDate = '实际完成日期'; $lang->execution->to = '至'; $lang->execution->days = '可用工作日'; $lang->execution->day = '天'; diff --git a/module/execution/view/close.html.php b/module/execution/view/close.html.php index 11ebcd1ed4..895d33a812 100644 --- a/module/execution/view/close.html.php +++ b/module/execution/view/close.html.php @@ -31,7 +31,7 @@ printExtendFields($execution, 'table');?> - + diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 34135a8a11..bf56083fe5 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -24,7 +24,7 @@ $lang->program->canceledBy = 'CanceledBy'; $lang->program->canceledDate = 'CanceledDate'; $lang->program->team = 'Team'; $lang->program->order = 'Rank'; -$lang->program->days = 'Available Days'; +$lang->program->days = 'Days'; $lang->program->acl = 'Access Control'; $lang->program->whitelist = 'WhiteList'; $lang->program->deleted = 'Deleted'; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 6c2b0f6b3d..814f590d48 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -109,7 +109,9 @@ $lang->project->progress = 'Progress'; $lang->project->dateRange = 'Duration'; $lang->project->to = ' to '; $lang->project->realEnd = 'Actual End'; -$lang->project->realBegan = 'Actual Began'; +$lang->project->realBegan = 'Actual Begin'; +$lang->project->realEndDate = 'Actual End'; +$lang->project->realBeganDate = 'Actual Begin'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -146,7 +148,7 @@ $lang->project->teamSumCount = '%s people in total'; $lang->project->longTime = 'Long-Term Program'; $lang->project->future = 'TBD'; $lang->project->moreProject = 'More Project'; -$lang->project->days = 'Available Days'; +$lang->project->days = 'Days'; $lang->project->mailto = 'Mailto'; $lang->project->etc = " , etc"; $lang->project->product = 'Product'; @@ -177,8 +179,8 @@ $lang->project->createExecution = "There is no {$lang->executionCommon} u $lang->project->unlinkExecutionMember = "The user participated in %s executions such as %s%s. Do you want to remove the user from those executions as well? (The data related to this user will not be deleted.)"; $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; -$lang->project->realEndNotEmpty = 'Real End should not be empty.'; -$lang->project->realEndNotFuture = 'Real End should not be a feture date.'; +$lang->project->realEndNotEmpty = 'Actual End should not be empty.'; +$lang->project->realEndNotFuture = 'Actual End should not be a future date.'; $lang->project->tenThousand = ''; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index c3982efcae..7e3d681902 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -110,6 +110,8 @@ $lang->project->dateRange = '起止日期'; $lang->project->to = '至'; $lang->project->realEnd = '实际完成'; $lang->project->realBegan = '实际开始'; +$lang->project->realEndDate = '实际完成日期'; +$lang->project->realBeganDate = '实际开始日期'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; $lang->project->bycard = '卡片'; diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 0fd52dabdd..2b9336051f 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -31,7 +31,7 @@ printExtendFields($project, 'table');?> - + + + + + From c854d353c6b63878802b5cf4cc50b479d1bbef8e Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 11:30:30 +0800 Subject: [PATCH 07/26] * Modify Date always in reverse order. --- module/company/control.php | 3 ++- module/company/view/dynamic.html.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/company/control.php b/module/company/control.php index ca4c93f11c..a8ab0d369b 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -204,7 +204,8 @@ class company extends control $pager = new pager($recTotal, $recPerPage = 50, $pageID = 1); /* Append id for secend sort. */ - $sort = $this->loadModel('common')->appendOrder($orderBy); + $order = $direction == 'next' ? 'date_desc' : 'date_asc'; + $sort = $this->loadModel('common')->appendOrder($order); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $date = empty($date) ? '' : date('Y-m-d', $date); diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 3c5bc77f7e..48f5eda5f0 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -53,6 +53,7 @@
    + $action):?>
  • major) echo "class='active'";?>> From 578d53f5ae1478b9a723cfca055163386dc4ef99 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Mon, 29 Nov 2021 13:08:18 +0800 Subject: [PATCH 08/26] * Finish task #45152. --- config/zentaopms.php | 2 +- module/project/config.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/zentaopms.php b/config/zentaopms.php index 4b8f72d147..8bf7fdc792 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -280,5 +280,5 @@ $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme'); /* Program privs.*/ $config->programPriv = new stdclass(); -$config->programPriv->scrum = array('projectstory', 'projectrelease', 'project', 'build', 'bug', 'testcase', 'testreport', 'caselib', 'doc', 'repo', 'meeting'); +$config->programPriv->scrum = array('projectstory', 'projectrelease', 'project', 'build', 'bug', 'testcase', 'testreport', 'caselib', 'doc', 'repo', 'meeting', 'stakeholder'); $config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp')); diff --git a/module/project/config.php b/module/project/config.php index 0ef78e1687..86c1da61db 100644 --- a/module/project/config.php +++ b/module/project/config.php @@ -112,4 +112,5 @@ $config->project->datatable->fieldList['actions']['required'] = 'yes'; $config->project->datatable->fieldList['actions']['pri'] = '1'; $config->project->removePriv['project'] = array('browse', 'kanban', 'create', 'batchEdit', 'qa', 'updateOrder', 'createGuide', 'programTitle'); +$config->project->removePriv['bug'] = array('batchChangePlan'); $config->project->removePriv['doc'] = array('catalog', 'index'); From adee5873ecf8f9d7685fb78ab3a8381ad9d2c741 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 13:22:05 +0800 Subject: [PATCH 09/26] * Modify Date always in reverse order. --- module/company/view/dynamic.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 48f5eda5f0..80b730840f 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -53,7 +53,7 @@
      - + $action):?>
    • major) echo "class='active'";?>> From ea4ee494dea38c10db53a24726bd3611026d8170 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 13:37:27 +0800 Subject: [PATCH 10/26] * Modify Date always in reverse order. --- module/company/view/dynamic.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 80b730840f..4884cabeeb 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -97,8 +97,8 @@ $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600); $lastDate = substr($action->originalDate, 0, 10); $hasPre = $this->action->hasPreOrNext($firstDate, 'pre'); $hasNext = $this->action->hasPreOrNext($lastDate, 'next'); -$preLink = $hasPre ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;'; -$nextLink = $hasNext ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next') : 'javascript:;'; +$preLink = $hasPre ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . "&direction=pre&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID&orderBy=$orderBy") : 'javascript:;'; +$nextLink = $hasNext ? inlink('dynamic', "browseType=$browseType¶m=$param&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . "&direction=next&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID&orderBy=$orderBy") : 'javascript:;'; ?>
      From 43c1b047b8979755e072d8c2555491dfbbbb7d29 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 13:43:04 +0800 Subject: [PATCH 11/26] * Modify Date always in reverse order. --- module/company/control.php | 3 +-- module/company/view/dynamic.html.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/company/control.php b/module/company/control.php index a8ab0d369b..ae7fb5931c 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -204,8 +204,7 @@ class company extends control $pager = new pager($recTotal, $recPerPage = 50, $pageID = 1); /* Append id for secend sort. */ - $order = $direction == 'next' ? 'date_desc' : 'date_asc'; - $sort = $this->loadModel('common')->appendOrder($order); + $sort = $this->loadModel('common')->appendOrder('date_desc'); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $date = empty($date) ? '' : date('Y-m-d', $date); diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 4884cabeeb..f8fb17993c 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -53,7 +53,7 @@
        - + $action):?>
      • major) echo "class='active'";?>> From aa840c5b9bc2ddabdf6928c98527c275c9c90135 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 14:33:12 +0800 Subject: [PATCH 12/26] * Finish task #45156. --- module/company/view/dynamic.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index f8fb17993c..7f0fc9f5d4 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -53,7 +53,7 @@
          - + $action):?>
        • major) echo "class='active'";?>> From 7368ed108bb64b34a8a4b15f51e6fadd277872e2 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 14:33:44 +0800 Subject: [PATCH 13/26] * Finish task #45156. --- module/company/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/company/control.php b/module/company/control.php index ae7fb5931c..9052d5c3ad 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -204,7 +204,8 @@ class company extends control $pager = new pager($recTotal, $recPerPage = 50, $pageID = 1); /* Append id for secend sort. */ - $sort = $this->loadModel('common')->appendOrder('date_desc'); + $order = $direction == 'next' ? 'date_desc' : 'date_asc'; + $sort = $this->loadModel('common')->appendOrder($order); $queryID = ($browseType == 'bysearch') ? (int)$param : 0; $date = empty($date) ? '' : date('Y-m-d', $date); From e9ead71632b0e48604a92c021b0bdcaca05c0443 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 14:37:21 +0800 Subject: [PATCH 14/26] * Finish task #45156. --- module/company/view/dynamic.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 7f0fc9f5d4..38ac06089e 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -53,7 +53,7 @@
            - + $action):?>
          • major) echo "class='active'";?>> From 4cec6b697d7e30f21a3dceb449182f56fd75c81d Mon Sep 17 00:00:00 2001 From: zhouxin Date: Mon, 29 Nov 2021 07:00:16 +0000 Subject: [PATCH 15/26] Finish task 45100. --- module/my/view/dynamic.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/my/view/dynamic.html.php b/module/my/view/dynamic.html.php index de3a76491f..5546dd3f2b 100644 --- a/module/my/view/dynamic.html.php +++ b/module/my/view/dynamic.html.php @@ -60,7 +60,7 @@ objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";?> maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName)) + if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) and empty($action->objectName)) { echo '#' . $action->objectID; } From a3f5e8ab43a3cfedf2d6b7c3997cb86437e0ef04 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 15:18:12 +0800 Subject: [PATCH 16/26] * Fix bug #16892. --- module/action/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/action/model.php b/module/action/model.php index 8c289f283e..520ee91cd2 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1136,6 +1136,7 @@ class actionModel extends model if(strpos($action->objectLabel, '|') !== false) { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); + a(); /* Fix bug #2961. */ $isLoginOrLogout = $action->objectType == 'user' and ($action->action == 'login' or $action->action == 'logout'); @@ -1170,6 +1171,7 @@ class actionModel extends model $libObjectID = trim($libObjectID, ','); if(empty($libObjectID) and $type != 'custom') return false; + $vars = substr($vars,0,strpos($vars,'&docID')); $params = sprintf($vars, $type, $libObjectID, $libID); } elseif($action->objectType == 'api') From f164f0cdd099ba7f079fa80860c0be0f475cc1a5 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 29 Nov 2021 15:19:19 +0800 Subject: [PATCH 17/26] * Fix bug #16892. --- module/action/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/action/model.php b/module/action/model.php index 520ee91cd2..a36ee17a49 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1136,7 +1136,6 @@ class actionModel extends model if(strpos($action->objectLabel, '|') !== false) { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); - a(); /* Fix bug #2961. */ $isLoginOrLogout = $action->objectType == 'user' and ($action->action == 'login' or $action->action == 'logout'); From bd2b8ab2a61b3f33949457d12086b5d717a340a0 Mon Sep 17 00:00:00 2001 From: reneeteng Date: Mon, 29 Nov 2021 16:31:18 +0800 Subject: [PATCH 18/26] * Edit lang file. --- module/backup/lang/en.php | 8 ++++---- module/programplan/lang/en.php | 16 ++++++++-------- module/repo/lang/en.php | 2 +- module/tree/lang/en.php | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/module/backup/lang/en.php b/module/backup/lang/en.php index a0139051a0..2b5109c58b 100644 --- a/module/backup/lang/en.php +++ b/module/backup/lang/en.php @@ -8,14 +8,14 @@ $lang->backup->restore = 'Restore'; $lang->backup->change = 'Edit Expiration'; $lang->backup->changeAB = 'Edit'; $lang->backup->rmPHPHeader = 'Remove PHP header'; -$lang->backup->setting = 'Setting'; +$lang->backup->setting = 'Settings'; -$lang->backup->settingAction = 'Backup Setting'; +$lang->backup->settingAction = 'Backup Settings'; $lang->backup->time = 'Date'; $lang->backup->files = 'Files'; -$lang->backup->allCount = 'All Count'; -$lang->backup->count = 'Backup Count'; +$lang->backup->allCount = 'All Files'; +$lang->backup->count = 'Backup Files'; $lang->backup->size = 'Size'; $lang->backup->status = 'Status'; diff --git a/module/programplan/lang/en.php b/module/programplan/lang/en.php index ab774d4154..de70969dc4 100644 --- a/module/programplan/lang/en.php +++ b/module/programplan/lang/en.php @@ -23,17 +23,17 @@ $lang->programplan->emptyParent = 'N/A'; $lang->programplan->name = 'Stage Name'; $lang->programplan->subStageName = 'Sub Stage Name'; $lang->programplan->percent = 'Workload Ratio'; -$lang->programplan->percentAB = 'Workload Ratio'; +$lang->programplan->percentAB = 'Ratio'; $lang->programplan->planPercent = 'Workload'; -$lang->programplan->attribute = 'Stage Type'; +$lang->programplan->attribute = 'Type'; $lang->programplan->milestone = 'Milestone'; $lang->programplan->taskProgress = 'Task Progress'; $lang->programplan->task = 'Task'; $lang->programplan->begin = 'Begin'; $lang->programplan->end = 'End'; -$lang->programplan->realBegan = 'Actual Started'; +$lang->programplan->realBegan = 'Actual Start'; $lang->programplan->realEnd = 'Actual End'; -$lang->programplan->ac = 'Actual cost'; +$lang->programplan->ac = 'Actual Cost'; $lang->programplan->sv = 'Schedule Variance'; $lang->programplan->cv = 'Cost Variance'; $lang->programplan->planDateRange = 'Planned Start'; @@ -48,7 +48,7 @@ $lang->programplan->version = 'Version'; $lang->programplan->full = 'Full Screen'; $lang->programplan->today = 'Today'; $lang->programplan->exporting = 'Exporting'; -$lang->programplan->exportFail = 'Export failed'; +$lang->programplan->exportFail = 'Failed'; $lang->programplan->hideCriticalPath = 'Hide Critical Path'; $lang->programplan->showCriticalPath = 'Show Critical Path'; $lang->programplan->errorEnd = "Project end date: %s, end date should be <= project end date."; @@ -61,7 +61,7 @@ $lang->programplan->noData = 'No Data'; $lang->programplan->children = 'Sub Plan'; $lang->programplan->childrenAB = 'Child'; $lang->programplan->confirmDelete = 'Do you want to delete the current plan?'; -$lang->programplan->workloadTips = 'The proportion of the sub stage workload is divided by 100%.'; +$lang->programplan->workloadTips = 'The workload of the sub stage is divided by 100%.'; $lang->programplan->stageCustom = new stdClass(); $lang->programplan->stageCustom->date = 'Show Date'; @@ -71,5 +71,5 @@ $lang->programplan->error = new stdclass(); $lang->programplan->error->percentNumber = '"Workload %" must be digits.'; $lang->programplan->error->planFinishSmall = 'The "End" date must be > the "Begin" date.'; $lang->programplan->error->percentOver = 'The sum of "Workload %" cannot exceed 100%.'; -$lang->programplan->error->createdTask = 'The task has been decomposed. Sub phases cannot be added.'; -$lang->programplan->error->parentWorkload = 'The sum of the workload of the child phase cannot be greater than that of the parent phase: %s.'; +$lang->programplan->error->createdTask = 'The task is decomposed. Sub stages cannot be added.'; +$lang->programplan->error->parentWorkload = 'The sum of the workload in the sub stage cannot be > that in the parent stage: %s.'; diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index da7c51712f..1c58036410 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -133,7 +133,7 @@ $lang->repo->scmList['Subversion'] = 'SVN'; $lang->repo->gitlabHost = 'Gitlab Host'; $lang->repo->gitlabToken = 'Gitlab Token'; -$lang->repo->gitlabProject = 'Projects'; +$lang->repo->gitlabProject = 'Project'; $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = 'Input url of gitlab'; diff --git a/module/tree/lang/en.php b/module/tree/lang/en.php index 2da5813be5..9b8e08da48 100644 --- a/module/tree/lang/en.php +++ b/module/tree/lang/en.php @@ -29,7 +29,7 @@ $lang->tree->updateOrder = 'Rank Module'; $lang->tree->manageChild = 'Manage Child Modules'; $lang->tree->manageStoryChild = 'Manage Child Modules'; $lang->tree->manageLineChild = "Manage {$lang->productCommon} Line"; -$lang->tree->manageBugChild = 'Manage Child Bugs'; +$lang->tree->manageBugChild = 'Manage Child Modules of Bugs'; $lang->tree->manageCaseChild = 'Manage Child Cases'; $lang->tree->manageCaselibChild = 'Manage Child Libraries'; $lang->tree->manageTaskChild = "Manage Child {$lang->executionCommon} Modules"; From 62907853b4e9de2f78fad13d2b5cffe5a8649853 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 30 Nov 2021 09:10:42 +0800 Subject: [PATCH 19/26] * Finish task #45156. --- module/action/lang/en.php | 2 +- module/action/model.php | 18 +++++++++++++++--- module/company/control.php | 2 +- module/company/view/dynamic.html.php | 1 - 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index d8f8cdd729..9767de0ddb 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -498,7 +498,7 @@ $lang->action->label->testtask = 'Request|testtask|view|caseID=%s'; $lang->action->label->testsuite = 'Test Suite|testsuite|view|suiteID=%s'; $lang->action->label->caselib = 'Case Library|caselib|view|libID=%s'; $lang->action->label->todo = 'Todo|todo|view|todoID=%s'; -$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s&docID=&version=&appendLib=%s'; +$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s'; $lang->action->label->doc = 'Doc|doc|view|docID=%s'; $lang->action->label->user = 'User|user|view|account=%s'; $lang->action->label->testreport = 'Report|testreport|view|report=%s'; diff --git a/module/action/model.php b/module/action/model.php index a36ee17a49..67710ecf15 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1170,7 +1170,6 @@ class actionModel extends model $libObjectID = trim($libObjectID, ','); if(empty($libObjectID) and $type != 'custom') return false; - $vars = substr($vars,0,strpos($vars,'&docID')); $params = sprintf($vars, $type, $libObjectID, $libID); } elseif($action->objectType == 'api') @@ -1428,7 +1427,7 @@ class actionModel extends model * @access public * @return array */ - public function buildDateGroup($actions, $direction = 'next', $type = 'today') + public function buildDateGroup($actions, $direction = 'next', $type = 'today', $orderBy = 'date_desc') { $dateGroup = array(); foreach($actions as $action) @@ -1456,7 +1455,20 @@ class actionModel extends model } } - if($direction != 'next') $dateGroup = array_reverse($dateGroup); + if($this->app->rawModule != 'company' and $direction != 'next') + { + $dateGroup = array_reverse($dateGroup); + } + else if($this->app->rawModule == 'company' and (($direction == 'next' and $orderBy == 'date_asc') or ($direction == 'pre' and $orderBy == 'date_desc'))) + { + $dateGroup = array_reverse($dateGroup); + foreach($dateGroup as $key => $dateItem) + { + $dateGroup[$key] = array_reverse($dateItem); + } + + } + return $dateGroup; } diff --git a/module/company/control.php b/module/company/control.php index 9052d5c3ad..30ff8032b2 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -290,7 +290,7 @@ class company extends control $this->view->userID = $userID; $this->view->param = $param; $this->view->browseType = $browseType; - $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $browseType); + $this->view->dateGroups = $this->action->buildDateGroup($actions, $direction, $browseType, $orderBy); $this->view->direction = $direction; $this->display(); } diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 38ac06089e..65620af0ed 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -53,7 +53,6 @@
              - $action):?>
            • major) echo "class='active'";?>> From e78c876216973c75c4470071dcdd79791dea76aa Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 30 Nov 2021 09:22:04 +0800 Subject: [PATCH 20/26] *Finish task #45148. --- module/execution/lang/en.php | 12 +++--- module/execution/lang/zh-cn.php | 12 +++--- module/execution/model.php | 55 +++++++++++++--------------- module/execution/view/close.html.php | 2 +- module/execution/view/view.html.php | 4 +- module/project/lang/en.php | 8 ++-- module/project/lang/zh-cn.php | 10 ++--- module/project/model.php | 26 ++++++------- module/project/view/close.html.php | 2 +- module/project/view/view.html.php | 4 +- 10 files changed, 66 insertions(+), 69 deletions(-) diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 957daa8586..34e75a84cf 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -31,10 +31,10 @@ $lang->execution->canceledDate = 'CanceledDate'; $lang->execution->begin = 'Begin'; $lang->execution->end = 'End'; $lang->execution->dateRange = 'Duration'; +$lang->execution->realBeganAB = 'Actual Begin'; +$lang->execution->realEndAB = 'Actual End'; $lang->execution->realBegan = 'Actual Begin'; -$lang->execution->realBeganDate = 'Actual Begin'; $lang->execution->realEnd = 'Actual End'; -$lang->execution->realEndDate = 'Actual End'; $lang->execution->to = 'To'; $lang->execution->days = ' Days'; $lang->execution->day = ' Days'; @@ -353,10 +353,10 @@ $lang->execution->unfinishedExecution = "This {$lang->executionCommon} h $lang->execution->unfinishedTask = "[%s] unfinished tasks. "; $lang->execution->unresolvedBug = "[%s] unresolved bugs. "; $lang->execution->projectNotEmpty = 'Project cannot be empty.'; -$lang->execution->realBeganNotEmpty = 'Actual begin should not be empty.'; -$lang->execution->realBeganNotFuture = 'Actual begin should not be a future date.'; -$lang->execution->realEndNotEmpty = 'Actual end should not be empty.'; -$lang->execution->realEndNotFuture = 'Actual end should not be a future date.'; +$lang->execution->realBeganNotEmpty = 'Actual Begin should not be empty.'; +$lang->execution->realBeganNotFuture = 'Actual Begin should be < = today.'; +$lang->execution->realEndNotEmpty = 'Actual End should not be empty.'; +$lang->execution->realEndNotFuture = 'Actual End should be < = today.'; /* Statistics. */ $lang->execution->charts = new stdclass(); diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 7bb3f39c8d..2e1a39d7ef 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -31,10 +31,10 @@ $lang->execution->canceledDate = '取消日期'; $lang->execution->begin = '计划开始'; $lang->execution->end = '计划完成'; $lang->execution->dateRange = '起始日期'; -$lang->execution->realBegan = '实际开始'; -$lang->execution->realEnd = '实际完成'; -$lang->execution->realBeganDate = '实际开始日期'; -$lang->execution->realEndDate = '实际完成日期'; +$lang->execution->realBeganAB = '实际开始'; +$lang->execution->realEndAB = '实际完成'; +$lang->execution->realBegan = '实际开始日期'; +$lang->execution->realEnd = '实际完成日期'; $lang->execution->to = '至'; $lang->execution->days = '可用工作日'; $lang->execution->day = '天'; @@ -354,9 +354,9 @@ $lang->execution->unfinishedTask = "[%s]个未完成的任务,"; $lang->execution->unresolvedBug = "[%s]个未解决的bug,"; $lang->execution->projectNotEmpty = '所属项目不能为空。'; $lang->execution->realBeganNotEmpty = "实际开始不能为空。"; -$lang->execution->realBeganNotFuture = "实际开始不能为未来日期。"; +$lang->execution->realBeganNotFuture = "实际开始不能大于当前日期。"; $lang->execution->realEndNotEmpty = "实际完成不能为空。"; -$lang->execution->realEndNotFuture = "实际完成不能为未来日期。"; +$lang->execution->realEndNotFuture = "实际完成不能大于当前日期。"; /* 统计。*/ diff --git a/module/execution/model.php b/module/execution/model.php index f58916ea63..7011a5aa37 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -704,25 +704,21 @@ class executionModel extends model ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->remove('comment')->get(); + + if($execution->realBegan == '') + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; + return false; + } + if($execution->realBegan > $now) + { + dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; + return false; + } $this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec(); - if(!dao::isError()) - { - if($execution->realBegan == '') - { - dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; - return false; - } - - if($execution->realBegan > $now) - { - dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; - return false; - } - - return common::createChanges($oldExecution, $execution); - } + if(!dao::isError()) return common::createChanges($oldExecution, $execution); } /** @@ -869,25 +865,26 @@ class executionModel extends model ->setDefault('lastEditedDate', $now) ->remove('comment') ->get(); + + if($execution->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty; + return false; + } + + if($execution->realEnd > $now) + { + dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; + return false; + } $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck() ->where('id')->eq((int)$executionID) ->exec(); + if(!dao::isError()) - { - if($execution->realEnd == '') - { - dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty; - return false; - } - - if($execution->realEnd > $now) - { - dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; - return false; - } - + { $this->loadModel('score')->create('execution', 'close', $oldExecution); return common::createChanges($oldExecution, $execution); } diff --git a/module/execution/view/close.html.php b/module/execution/view/close.html.php index 895d33a812..11ebcd1ed4 100644 --- a/module/execution/view/close.html.php +++ b/module/execution/view/close.html.php @@ -31,7 +31,7 @@
printExtendFields($execution, 'table');?> - + - + - + diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 814f590d48..95e4c82b59 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -108,10 +108,10 @@ $lang->project->surplus = 'Left'; $lang->project->progress = 'Progress'; $lang->project->dateRange = 'Duration'; $lang->project->to = ' to '; -$lang->project->realEnd = 'Actual End'; +$lang->project->realBeganAB = 'Actual Begin'; +$lang->project->realEndAB = 'Actual End'; $lang->project->realBegan = 'Actual Begin'; -$lang->project->realEndDate = 'Actual End'; -$lang->project->realBeganDate = 'Actual Begin'; +$lang->project->realEnd = 'Actual End'; $lang->project->bygrid = 'Kanban'; $lang->project->bylist = 'List'; $lang->project->bycard = 'Card'; @@ -180,7 +180,7 @@ $lang->project->unlinkExecutionMember = "The user participated in %s executions $lang->project->unlinkExecutionMembers = "The team members you are removing are also in the execution team of this project. Do you want to remove them from the execution team too?"; $lang->project->realEndNotEmpty = 'Actual End should not be empty.'; -$lang->project->realEndNotFuture = 'Actual End should not be a future date.'; +$lang->project->realEndNotFuture = 'Actual End should be < = today.'; $lang->project->tenThousand = ''; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 7e3d681902..ddc6701344 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -108,10 +108,10 @@ $lang->project->surplus = '剩余'; $lang->project->progress = '进度'; $lang->project->dateRange = '起止日期'; $lang->project->to = '至'; -$lang->project->realEnd = '实际完成'; -$lang->project->realBegan = '实际开始'; -$lang->project->realEndDate = '实际完成日期'; -$lang->project->realBeganDate = '实际开始日期'; +$lang->project->realBeganAB = '实际开始'; +$lang->project->realEndAB = '实际完成'; +$lang->project->realBegan = '实际开始日期'; +$lang->project->realEnd = '实际完成日期'; $lang->project->bygrid = '看板'; $lang->project->bylist = '列表'; $lang->project->bycard = '卡片'; @@ -180,7 +180,7 @@ $lang->project->unlinkExecutionMember = "该用户参与了%s%s%s个{$lang->exe $lang->project->unlinkExecutionMembers = "移除的团队成员还参与了项目下的执行,是否同步从执行团队中移除?"; $lang->project->realEndNotEmpty = "实际完成不能为空。"; -$lang->project->realEndNotFuture = "实际完成不能为未来日期。"; +$lang->project->realEndNotFuture = "实际完成不能大于当前日期。"; $lang->project->tenThousand = '万'; diff --git a/module/project/model.php b/module/project/model.php index 1f4e3cb979..062183813c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1283,24 +1283,24 @@ class projectModel extends model ->remove('comment') ->get(); + if($project->realEnd == '') + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; + return false; + } + if($project->realEnd > $now) + { + dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; + return false; + } + $this->dao->update(TABLE_PROJECT)->data($project) ->autoCheck() ->where('id')->eq((int)$projectID) ->exec(); + if(!dao::isError()) - { - if($project->realEnd == '') - { - dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; - return false; - } - - if($project->realEnd > $now) - { - dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; - return false; - } - + { $this->loadModel('score')->create('project', 'close', $oldProject); return common::createChanges($oldProject, $project); } diff --git a/module/project/view/close.html.php b/module/project/view/close.html.php index 2b9336051f..0fd52dabdd 100644 --- a/module/project/view/close.html.php +++ b/module/project/view/close.html.php @@ -31,7 +31,7 @@ printExtendFields($project, 'table');?> - + - + - + From 3e346ef8d98406262af4bdc930bc2056dd0f9d37 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 30 Nov 2021 09:31:08 +0800 Subject: [PATCH 21/26] * Modify refactor. --- module/action/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/action/model.php b/module/action/model.php index 67710ecf15..ecccf1535c 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1466,7 +1466,6 @@ class actionModel extends model { $dateGroup[$key] = array_reverse($dateItem); } - } return $dateGroup; From aa86de638cdc059e432b7f3b124989d96dfa7f20 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 30 Nov 2021 09:43:20 +0800 Subject: [PATCH 22/26] * Fix bug #16907. --- module/block/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/block/model.php b/module/block/model.php index ab34ff2761..03b5a6d941 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -171,9 +171,9 @@ class blockModel extends model ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.execution=t3.id') ->where('t1.assignedTo')->eq($this->app->user->account) ->andWhere('t2.status')->ne('suspended') - ->andWhere('t3.status')->ne('suspended') + ->beginIF('t3.Id is not null')->andWhere('t3.status')->ne('suspended')->fi() ->andWhere('t2.type')->eq('project') - ->andWhere('t3.type')->eq('sprint') + ->andWhere('t3.type')->in('sprint,stage') ->andWhere('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) ->andWhere('t3.deleted')->eq(0) From b264aa3199f77ff97681e320b0ec8e587ea12da6 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 30 Nov 2021 09:46:30 +0800 Subject: [PATCH 23/26] * Fix bug 16807,16892. --- module/action/lang/en.php | 2 +- module/block/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index d8f8cdd729..9767de0ddb 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -498,7 +498,7 @@ $lang->action->label->testtask = 'Request|testtask|view|caseID=%s'; $lang->action->label->testsuite = 'Test Suite|testsuite|view|suiteID=%s'; $lang->action->label->caselib = 'Case Library|caselib|view|libID=%s'; $lang->action->label->todo = 'Todo|todo|view|todoID=%s'; -$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s&docID=&version=&appendLib=%s'; +$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s'; $lang->action->label->doc = 'Doc|doc|view|docID=%s'; $lang->action->label->user = 'User|user|view|account=%s'; $lang->action->label->testreport = 'Report|testreport|view|report=%s'; diff --git a/module/block/model.php b/module/block/model.php index 03b5a6d941..6c2acd1c37 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -171,7 +171,7 @@ class blockModel extends model ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.execution=t3.id') ->where('t1.assignedTo')->eq($this->app->user->account) ->andWhere('t2.status')->ne('suspended') - ->beginIF('t3.Id is not null')->andWhere('t3.status')->ne('suspended')->fi() + ->andWhere('t3.status')->ne('suspended') ->andWhere('t2.type')->eq('project') ->andWhere('t3.type')->in('sprint,stage') ->andWhere('t1.deleted')->eq(0) From 4b9ee832e1a0b1a0d32a5b721257b7de989f5e73 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 30 Nov 2021 10:20:50 +0800 Subject: [PATCH 24/26] * Add comment. --- module/action/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/action/model.php b/module/action/model.php index ecccf1535c..62d0264966 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1424,6 +1424,7 @@ class actionModel extends model * @param array $actions * @param string $direction * @param string $type all|today|yesterday|thisweek|lastweek|thismonth|lastmonth + * @param string $orderBy * @access public * @return array */ From bd6a007e6af1fa89edfe5631f8813bd3ead8cb84 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 30 Nov 2021 10:55:51 +0800 Subject: [PATCH 25/26] * Add comment. --- module/action/model.php | 10 ++++------ module/company/control.php | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 62d0264966..f665e432e9 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1424,7 +1424,7 @@ class actionModel extends model * @param array $actions * @param string $direction * @param string $type all|today|yesterday|thisweek|lastweek|thismonth|lastmonth - * @param string $orderBy + * @param string $orderBy date_desc|date_asc * @access public * @return array */ @@ -1456,17 +1456,15 @@ class actionModel extends model } } + /* Modify date to the corrret order. */ if($this->app->rawModule != 'company' and $direction != 'next') { $dateGroup = array_reverse($dateGroup); } - else if($this->app->rawModule == 'company' and (($direction == 'next' and $orderBy == 'date_asc') or ($direction == 'pre' and $orderBy == 'date_desc'))) + elseif($this->app->rawModule == 'company' and (($direction == 'next' and $orderBy == 'date_asc') or ($direction == 'pre' and $orderBy == 'date_desc'))) { $dateGroup = array_reverse($dateGroup); - foreach($dateGroup as $key => $dateItem) - { - $dateGroup[$key] = array_reverse($dateItem); - } + foreach($dateGroup as $key => $dateItem) $dateGroup[$key] = array_reverse($dateItem); } return $dateGroup; diff --git a/module/company/control.php b/module/company/control.php index 30ff8032b2..1ce38f6366 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -167,7 +167,7 @@ class company extends control * @param int $productID * @param int $projectID * @param int $executionID - * @param string $orderBy + * @param string $orderBy date_deac|date_asc * @access public * @return void */ From 46a9f157b1569ab3be99ab970f2bd524093dfe86 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 30 Nov 2021 10:56:09 +0800 Subject: [PATCH 26/26] *Finish task #45148. --- module/execution/model.php | 8 ++++---- module/project/model.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 7011a5aa37..b31e98d682 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -710,7 +710,7 @@ class executionModel extends model dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; return false; } - if($execution->realBegan > $now) + if($execution->realBegan > helper::today()) { dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; return false; @@ -789,7 +789,7 @@ class executionModel extends model $now = helper::now(); $execution = fixer::input('post') - ->setDefault('realEnd','') + ->setDefault('realEnd', '') ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) @@ -872,7 +872,7 @@ class executionModel extends model return false; } - if($execution->realEnd > $now) + if($execution->realEnd > helper::today()) { dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; return false; @@ -884,7 +884,7 @@ class executionModel extends model ->exec(); if(!dao::isError()) - { + { $this->loadModel('score')->create('execution', 'close', $oldExecution); return common::createChanges($oldExecution, $execution); } diff --git a/module/project/model.php b/module/project/model.php index 062183813c..9e976fbc05 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1288,7 +1288,7 @@ class projectModel extends model dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; return false; } - if($project->realEnd > $now) + if($project->realEnd > helper::today()) { dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; return false; @@ -1300,7 +1300,7 @@ class projectModel extends model ->exec(); if(!dao::isError()) - { + { $this->loadModel('score')->create('project', 'close', $oldProject); return common::createChanges($oldProject, $project); }
execution->realBegan;?> +
+ realBegan) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date'");?> +
+
comment;?> execution->begin;?> begin;?> execution->realBegan;?> realBegan;?>execution->end;?> end;?> execution->realEnd;?> realEnd;?>
project->realEnd;?> +
+ realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date'");?> +
+
comment;?> execution->begin;?> begin;?> execution->realBegan;?>realBegan;?>realBegan == '0000-00-00' ? '' : $execution->realBegan;?>
execution->end;?> end;?> execution->realEnd;?>realEnd;?>realEnd == '0000-00-00' ? '' : $execution->realEnd;?>
execution->totalEstimate;?>project->begin;?> begin;?> project->realBegan;?>realBegan;?>realBegan == '0000-00-00' ? '' : $project->realBegan;?>
project->end;?> end;?> project->realEnd;?>realEnd;?>realEnd == '0000-00-00' ? '' : $project->realEnd;?>
execution->totalEstimate;?>execution->realEnd;?>
- realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date'");?> + realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date' required");?>
execution->realBegan;?>
- realBegan) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date'");?> + realBegan) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date' required");?>
project->realEnd;?>
- realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date'");?> + realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date' required");?>
execution->realEnd;?>execution->realEndDate;?>
realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> diff --git a/module/execution/view/start.html.php b/module/execution/view/start.html.php index 6f9e74185c..8a67e8954b 100644 --- a/module/execution/view/start.html.php +++ b/module/execution/view/start.html.php @@ -30,7 +30,7 @@
execution->realBegan;?>
- realBegan) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date' required");?> + realBeganDate) && $execution->realBegan != '0000-00-00' ? $execution->realBegan : date('Y-m-d')), "class='form-control form-date' required");?>
project->realEnd;?>project->realEndDate;?>
realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> From dbf176316b8deaea46da3f725b1ea16baa1a782a Mon Sep 17 00:00:00 2001 From: liyuchun Date: Mon, 29 Nov 2021 11:29:46 +0800 Subject: [PATCH 06/26] * Finish task #45154. --- module/mail/model.php | 7 ++++--- module/message/control.php | 4 +++- module/message/lang/en.php | 9 +++++---- module/message/lang/zh-cn.php | 9 +++++---- module/message/view/setting.html.php | 4 ++++ 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/module/mail/model.php b/module/mail/model.php index 35d893a5f2..4204f67953 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -292,9 +292,10 @@ class mailModel extends model } /* Remove deleted users. */ - $users = $this->loadModel('user')->getPairs('nodeleted|all'); - foreach($toList as $key => $to) if(!isset($users[trim($to)])) unset($toList[$key]); - foreach($ccList as $key => $cc) if(!isset($users[trim($cc)])) unset($ccList[$key]); + $users = $this->loadModel('user')->getPairs('nodeleted|all'); + $blockUsers = isset($this->config->message->blockUser) ? explode(',', $this->config->message->blockUser) : array(); + foreach($toList as $key => $to) if(!isset($users[trim($to)]) or in_array(trim($to), $blockUsers)) unset($toList[$key]); + foreach($ccList as $key => $cc) if(!isset($users[trim($cc)]) or in_array(trim($cc), $blockUsers)) unset($ccList[$key]); if(!$toList and !$ccList) return; if(!$toList and $ccList) $toList = array(array_shift($ccList)); diff --git a/module/message/control.php b/module/message/control.php index dc63edc9d6..f791f5e9aa 100644 --- a/module/message/control.php +++ b/module/message/control.php @@ -84,7 +84,9 @@ class message extends control { $data = fixer::input('post')->get(); $data->messageSetting = !empty($data->messageSetting) ? json_encode($data->messageSetting) : ''; + $data->blockUser = !empty($data->blockUser) ? implode(',', $data->blockUser) : ''; $this->loadModel('setting')->setItem('system.message.setting', $data->messageSetting); + $this->loadModel('setting')->setItem('system.message.blockUser', $data->blockUser); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); } @@ -95,7 +97,7 @@ class message extends control $this->view->position[] = $this->lang->message->common; $this->view->position[] = $this->lang->message->setting; - $users = $this->loadModel('user')->getPairs('noletter'); + $users = $this->loadModel('user')->getPairs('noletter,noclosed'); unset($users['']); $this->view->users = $users; diff --git a/module/message/lang/en.php b/module/message/lang/en.php index 1614a1243b..88fa9bf34e 100644 --- a/module/message/lang/en.php +++ b/module/message/lang/en.php @@ -1,8 +1,9 @@ message->common = 'Notification'; -$lang->message->index = 'Home'; -$lang->message->setting = 'Settings'; -$lang->message->browser = 'Browser Notification'; +$lang->message->common = 'Notification'; +$lang->message->index = 'Home'; +$lang->message->setting = 'Settings'; +$lang->message->browser = 'Browser Notification'; +$lang->message->blockUser = 'Block User'; $lang->message->typeList['mail'] = 'Email'; $lang->message->typeList['message'] = 'Browser Notifications'; diff --git a/module/message/lang/zh-cn.php b/module/message/lang/zh-cn.php index eb458ddb64..600d5ff70c 100644 --- a/module/message/lang/zh-cn.php +++ b/module/message/lang/zh-cn.php @@ -1,8 +1,9 @@ message->common = '消息'; -$lang->message->index = '首页'; -$lang->message->setting = '设置'; -$lang->message->browser = '浏览器通知'; +$lang->message->common = '消息'; +$lang->message->index = '首页'; +$lang->message->setting = '设置'; +$lang->message->browser = '浏览器通知'; +$lang->message->blockUser = '不通知人员'; $lang->message->typeList['mail'] = '邮件'; $lang->message->typeList['message'] = '浏览器通知'; diff --git a/module/message/view/setting.html.php b/module/message/view/setting.html.php index 6b062ae12d..d059b229d7 100644 --- a/module/message/view/setting.html.php +++ b/module/message/view/setting.html.php @@ -74,6 +74,10 @@
message->blockUser;?>message->blockUser) ? $config->message->blockUser: '', "class='form-control chosen' multiple");?>
execution->realEndDate;?>execution->realEnd;?>
realEnd) && $execution->realEnd != '0000-00-00' ? $execution->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 4b1a0b8932..99bc17355d 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -238,13 +238,13 @@
execution->begin;?> begin;?>execution->realBegan;?>execution->realBeganAB;?> realBegan == '0000-00-00' ? '' : $execution->realBegan;?>
execution->end;?> end;?>execution->realEnd;?>execution->realEndAB;?> realEnd == '0000-00-00' ? '' : $execution->realEnd;?>
project->realEndDate;?>project->realEnd;?>
realEnd) && $project->realEnd != '0000-00-00' ? $project->realEnd : date('Y-m-d')), "class='form-control form-date' required");?> diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 9972d2dec9..7c10b7262d 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -178,13 +178,13 @@
project->begin;?> begin;?>project->realBegan;?>project->realBeganAB;?> realBegan == '0000-00-00' ? '' : $project->realBegan;?>
project->end;?> end;?>project->realEnd;?>project->realEndAB;?> realEnd == '0000-00-00' ? '' : $project->realEnd;?>