From 77cab3ad10b27e71b229cbc9aac25249f0e3ce67 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Wed, 15 Sep 2021 09:14:16 +0800 Subject: [PATCH 01/11] * Fix bug #15184. --- module/install/lang/en.php | 2 +- module/install/lang/zh-cn.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 934401687b..dbe7d1659d 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -58,7 +58,7 @@ $lang->install->introductionContent = <<Project is used to organize the manpower for development, track and manage the project process, and complete the project in a faster, better, and less costly way.

-

Execution

+

Execution

Execution is used to decompose, assign, and track tasks to ensure that project goals can be implemented by manpower.

diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 2764d11265..ab9eaae020 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -58,7 +58,7 @@ $lang->install->introductionContent = <<项目用来组织相应的人力进行研发,做好项目过程的跟踪管理,多快好省地完成项目。

-

执行

+

执行

执行用来做任务的分解、指派和跟踪,保证项目目标可以落实到人来执行。

From d2ef694ea6246d32ff761e599149b979085d96c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 15 Sep 2021 10:04:28 +0800 Subject: [PATCH 02/11] * fix for set realStart when edit task. --- module/task/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index d84696e06b..2f281bc080 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -211,7 +211,7 @@ task->realStarted;?> - realStarted) ? helper::now() : $task->realStarted, "class='form-control form-datetime'");?> + realStarted) ? '' : $task->realStarted, "class='form-control form-datetime'");?> task->finishedBy;?> From 7757da97f50b7023a274c456b765933cd4049a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 15 Sep 2021 10:28:46 +0800 Subject: [PATCH 03/11] * adjust for get wait project in program kanban. --- module/program/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/program/model.php b/module/program/model.php index 76f7bff9bb..7525d37122 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -182,7 +182,7 @@ class programModel extends model ->on('t1.project = t2.id') ->where('t2.deleted')->eq(0) ->andWhere('t1.product')->in($productPairs) - ->andWhere('t2.status')->eq('doing') + ->andWhere('t2.status')->in('wait,doing') ->andWhere('t2.type')->eq('project') ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->projects)->fi() ->fetchGroup('product'); From afb19a3a14c1abfbff5da9135721669d8765f016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 15 Sep 2021 10:36:14 +0800 Subject: [PATCH 04/11] * Merge for userbind btn. --- module/gitlab/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/gitlab/view/browse.html.php b/module/gitlab/view/browse.html.php index 1943eb0ef9..07ebd9f40d 100644 --- a/module/gitlab/view/browse.html.php +++ b/module/gitlab/view/browse.html.php @@ -48,7 +48,7 @@ isAdminToken) ? '' : 'disabled'; common::printLink('gitlab', 'edit', "gitlabID=$id", " ", '',"title={$lang->gitlab->edit} class='btn btn-primary'"); - common::printLink('gitlab', 'bindUser', "id=$id", " ", '', "title={$lang->gitlab->bindUser} class='btn btn-primary {$disabled}' ,'disabled'"); + common::printLink('gitlab', 'bindUser', "id=$id", " ", '', "title={$lang->gitlab->bindUser} class='btn {$disabled}' ,'disabled'"); if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'delete', "gitlabID=$id"), '', 'hiddenwin', "title='{$lang->gitlab->delete}' class='btn'"); ?> From 9cedf76f8ca884fbc29905fadfe3387e8eb9c324 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Wed, 15 Sep 2021 10:36:36 +0800 Subject: [PATCH 05/11] * Fix bug for the job with gitlab type, merged from master. --- module/ci/model.php | 21 ++++++++++++++++----- module/compile/control.php | 8 ++++---- module/job/model.php | 1 + module/job/view/edit.html.php | 2 +- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/module/ci/model.php b/module/ci/model.php index 2af08d66f9..9943a6fcaa 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -118,7 +118,7 @@ class ciModel extends model /** * Sync gitlab task status. - * + * * @param object $compile * @access public * @return void @@ -127,10 +127,21 @@ class ciModel extends model { $this->loadModel('gitlab'); - $now = helper::now(); - $pipeline = $this->gitlab->apiGetSinglePipeline($compile->server, $compile->pipeline, $compile->queue); - $jobs = $this->gitlab->apiGetJobs($compile->server, $compile->pipeline, $compile->queue); + $now = helper::now(); + /* The value of `$compile->pipeline` is like `'{"project":"46","reference":"master"}'` in current design. */ + $pipeline = json_decode($compile->pipeline); + $compile->project = isset($pipeline->project) ? $pipeline->project : $compile->pipeline; + + $pipeline = $this->gitlab->apiGetSinglePipeline($compile->server, $compile->project, $compile->queue); + if(!isset($pipeline->id) or isset($pipeline->message)) /* The pipeline is not available. */ + { + $pipeline->status = 'create_fail'; /* Set the status to fail. */ + $this->dao->update(TABLE_JOB)->set('lastExec')->eq($now)->set('lastStatus')->eq($pipeline->status)->where('id')->eq($compile->job)->exec(); + return false; + } + + $jobs = $this->gitlab->apiGetJobs($compile->server, $compile->project, $compile->queue); $data = new stdclass; $data->status = $pipeline->status; $data->updateDate = $now; @@ -140,7 +151,7 @@ class ciModel extends model if(empty($job->duration) or $job->duration == '') $job->duration = '-'; $data->logs = ">>> Job: $job->name, Stage: $job->stage, Status: $job->status, Duration: $job->duration Sec\r\n "; $data->logs .= "Job URL: web_url\" target='_blank'>$job->web_url \r\n"; - $data->logs .= $this->transformAnsiToHtml($this->gitlab->apiGetJobLog($compile->server, $compile->pipeline, $job->id)); + $data->logs .= $this->transformAnsiToHtml($this->gitlab->apiGetJobLog($compile->server, $compile->project, $job->id)); } $this->dao->update(TABLE_COMPILE)->data($data)->where('id')->eq($compile->id)->exec(); diff --git a/module/compile/control.php b/module/compile/control.php index d40e36798b..aa81b14e1d 100644 --- a/module/compile/control.php +++ b/module/compile/control.php @@ -12,10 +12,10 @@ class compile extends control { /** - * Construct - * - * @param string $moduleName - * @param string $methodName + * Construct + * + * @param string $moduleName + * @param string $methodName * @access public * @return void */ diff --git a/module/job/model.php b/module/job/model.php index 3195bd5179..c9344e89a4 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -24,6 +24,7 @@ class jobModel extends model if(strtolower($job->engine) == 'gitlab') { $pipeline = json_decode($job->pipeline); + if(!isset($pipeline->reference)) return $job; $job->project = $pipeline->project; $job->reference = $pipeline->reference; } diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 9c06425b7a..863e03f716 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -44,7 +44,7 @@ job->repo; ?> repo, "class='chosen form-control'");?> - reference, "class='chosen form-control'");?> + reference) ? $job->reference : '', "class='chosen form-control'");?> job->product;?> From 32213e6266be8621cf107f8b64c665228bd40ae5 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 15 Sep 2021 10:59:09 +0800 Subject: [PATCH 06/11] * Fix bug #15187. --- www/js/my.full.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/js/my.full.js b/www/js/my.full.js index 35c7ab77fd..ef085c9a27 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -552,6 +552,10 @@ function checkTutorial() window.location.reload(); }).error(function(){alert(lang.timeout)}); } + else + { + window.location.href = createLink('tutorial', 'index'); + } } } From 342a0335b13943be3d7983b45c2fea6e9e66c0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 15 Sep 2021 11:19:54 +0800 Subject: [PATCH 07/11] * Merge for bug #15187. --- www/js/my.full.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/js/my.full.js b/www/js/my.full.js index 35c7ab77fd..8f0b20a086 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -553,6 +553,10 @@ function checkTutorial() }).error(function(){alert(lang.timeout)}); } } + else + { + window.location.href = createLink('tutorial', 'index'); + } } /* Remove 'ditto' in first row when batch create or edit. */ From fc887d625a8852075d0d73d345f38b1c45e8f1ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 15 Sep 2021 11:26:29 +0800 Subject: [PATCH 08/11] * revert for bug #15187. --- www/js/my.full.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/www/js/my.full.js b/www/js/my.full.js index d3a728d51f..ef085c9a27 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -557,10 +557,6 @@ function checkTutorial() window.location.href = createLink('tutorial', 'index'); } } - else - { - window.location.href = createLink('tutorial', 'index'); - } } /* Remove 'ditto' in first row when batch create or edit. */ From 4c0319296ca9052016d6e9814c6917c0ea9c2ac5 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Wed, 15 Sep 2021 13:58:52 +0800 Subject: [PATCH 09/11] * Fix bug #15183. --- module/task/control.php | 4 ++-- module/task/model.php | 5 ++--- module/task/view/edit.html.php | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 51ec0bc928..4ab35b56bd 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -385,9 +385,9 @@ class task extends control $task = $this->task->getById($taskID); if($this->post->comment != '' or !empty($changes) or !empty($files)) { - $action = (!empty($changes) or !empty($files)) ? 'Edited' : 'Commented'; + $action = (!empty($changes) or !empty($files)) ? 'Edited' : 'Commented'; $fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : ''; - $actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment); + $actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } diff --git a/module/task/model.php b/module/task/model.php index 9e87c22359..d59db80472 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -848,8 +848,7 @@ class taskModel extends model $now = helper::now(); $task = fixer::input('post') ->setDefault('story, estimate, left, consumed', 0) - ->setDefault('estStarted', '0000-00-00') - ->setDefault('deadline', '0000-00-00') + ->setDefault('realStarted', '0000-00-00 00:00:00') ->setIF(is_numeric($this->post->estimate), 'estimate', (float)$this->post->estimate) ->setIF(is_numeric($this->post->consumed), 'consumed', (float)$this->post->consumed) ->setIF(is_numeric($this->post->left), 'left', (float)$this->post->left) @@ -1922,7 +1921,7 @@ class taskModel extends model if($task->assignedTo == 'closed') $task->assignedToRealName = 'Closed'; foreach($task as $key => $value) { - if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $task->$key = ''; + if((strpos($key, 'Date') !== false or strpos('estStarted|deadline', $key) !== false) and !(int)substr($value, 0, 4)) $task->$key = ''; } $task->files = $this->loadModel('file')->getByObject('task', $taskID); diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 2f281bc080..5c3862a9c4 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -176,11 +176,11 @@ - + - + From e6ed9fba46ab1b7873e2cd69ec6f6abe63b86c84 Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 15 Sep 2021 14:19:01 +0800 Subject: [PATCH 10/11] * Fix bug#14654 --- module/project/model.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/project/model.php b/module/project/model.php index c31a42e922..1adebc2bff 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1017,6 +1017,14 @@ class projectModel extends model if($oldProject->parent != $project->parent) $this->loadModel('program')->processNode($projectID, $project->parent, $oldProject->path, $oldProject->grade); + /* Fix whitelist changes. */ + $oldWhitelist = explode(',', $oldProject->whitelist) and $oldWhitelist = array_filter($oldWhitelist); + $newWhitelist = explode(',', $project->whitelist) and $newWhitelist = array_filter($newWhitelist); + if(count($oldWhitelist) == count($newWhitelist) and count(array_diff($oldWhitelist, $newWhitelist)) == 0) unset($project->whitelist); + /* Add linkedproducts changes. */ + $oldProject->linkedProducts = implode(',', $linkedProducts); + $project->linkedProducts = implode(',', $_POST['products']); + return common::createChanges($oldProject, $project); } } From a8c37fa1deed1dbd26e1a8e4931c0537e11457ab Mon Sep 17 00:00:00 2001 From: lichengjun Date: Wed, 15 Sep 2021 06:55:09 +0000 Subject: [PATCH 11/11] * Fix bug#15073. --- module/mr/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/mr/model.php b/module/mr/model.php index db71b79297..cdd895ed7e 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -327,7 +327,7 @@ class mrModel extends model $todo->assignedBy = $this->app->user->account; $todo->date = date("Y-m-d", strtotime($rawTodo->target->created_at)); $todo->assignedDate = $rawTodo->target->created_at; - $todo->begin = date("Hi", strtotime($rawTodo->target->created_at)); + $todo->begin = ceil(date("Hi", strtotime($rawTodo->target->created_at))/10)*10; $todo->end = '2400'; /* 2400 means end is 'undefined'. */ $todo->type = 'custom'; $todo->idvalue = $rawTodo->id;
task->estStarted;?>estStarted) ? '' : $task->estStarted, "class='form-control form-date'");?>estStarted, "class='form-control form-date'");?>
task->deadline;?>deadline) ? '' : $task->deadline, "class='form-control form-date'");?>deadline, "class='form-control form-date'");?>
task->estimate;?>