diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 1adf76a8a1..f0741ffaa9 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -5251,7 +5251,7 @@ class upgradeModel extends model if(empty($doc->content)) continue; $this->dao->update(TABLE_DOC) - ->set('tempContent')->eq($doc->content) + ->set('draft')->eq($doc->content) ->where('id')->eq($docID) ->exec(); } From 54bf6bc829df58013bf632fb6f4a5d486e83fb17 Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Thu, 19 Aug 2021 08:54:49 +0800 Subject: [PATCH 38/71] * Finish task #41550. --- module/doc/js/edit.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js index 90d65a3833..b5540aa7ae 100644 --- a/module/doc/js/edit.js +++ b/module/doc/js/edit.js @@ -1,13 +1,10 @@ $(function() { - if(needUpdateContent) + if(needUpdateContent && confirm(confirmUpdateContent)) { - if(confirm(confirmUpdateContent)) - { - $('#content').html(draft); - editor = KindEditor.instances[0]; - editor.html(draft); - } + $('#content').html(draft); + editor = KindEditor.instances[0]; + editor.html(draft); } $('#top-submit').click(function() @@ -34,7 +31,7 @@ $(function() $('#subNavbar li[data-id="doc"]').addClass('active'); /* Automatically save document contents. */ - setInterval("saveTempContent()", 5 * 1000); + setInterval("saveTempContent()", 60 * 1000); $(document).on("mousedown", 'span[data-name="fullscreen"]', function() { From 567021b12b86f09d4cf9d8c3618a74e42989cfeb Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 19 Aug 2021 09:13:03 +0800 Subject: [PATCH 39/71] * Fix bug #14424. --- module/message/model.php | 8 ++------ module/release/model.php | 3 ++- module/webhook/model.php | 8 ++++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/module/message/model.php b/module/message/model.php index 72179162a4..c831c79e9c 100644 --- a/module/message/model.php +++ b/module/message/model.php @@ -140,7 +140,7 @@ class messageModel extends model $notify = new stdclass(); $notify->objectType = 'message'; $notify->action = $actionID; - $notify->toList = $toList; + $notify->toList = str_replace(",{$actor},", '', ",$toList,"); $notify->data = $data; $notify->status = 'wait'; $notify->createdBy = $actor; @@ -170,12 +170,8 @@ class messageModel extends model $notifyPersons = array(); if(!empty($object->notify)) $notifyPersons = $this->loadModel('release')->getNotifyPersons($object->notify, $object->product, $object->build); - foreach($notifyPersons as $account) - { - if(strpos($object->mailto . ',', ",{$account},") === false) $toList .= ',' . $account; - } + if(!empty($notifyPersons)) $toList = implode(',', $notifyPersons); } - $toList = ',' . trim($toList) . ','; if($toList == 'closed') $toList = ''; return $toList; diff --git a/module/release/model.php b/module/release/model.php index f3b1e04fca..0bba9b1233 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -229,6 +229,7 @@ class releaseModel extends model ->join('mailto', ',') ->join('notify', ',') ->setIF(!$this->post->marker, 'marker', 0) + ->setIF(!$this->post->notify, 'notify', '') ->cleanInt('product') ->remove('files,labels,allchecker,uid') ->get(); @@ -292,7 +293,7 @@ class releaseModel extends model } elseif(($notify == 'ET' or $notify == 'PT') and !empty($buildID)) { - $type = $notify == 'ET' ? 'execution' : 'project'; + $type = $notify == 'ET' ? 'execution' : 'project'; $members = $this->dao->select('t2.account')->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_TEAM)->alias('t2')->on('t1.' . $type .'=t2.root') ->where('t2.type')->eq($type) diff --git a/module/webhook/model.php b/module/webhook/model.php index cb42db7124..066d655eac 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -588,6 +588,14 @@ class webhookModel extends model $toList = $this->loadModel('message')->getToList($object, $action->objectType); if(!empty($object->mailto)) $toList .= ',' . $object->mailto; if(empty($toList)) return false; + + /* Remove duplicate people. */ + if($action->objectType == 'release') + { + $toList = array_unique(explode(',', $toList)); + $toList = implode(',', $toList); + } + $toList = str_replace(",{$this->app->user->account},", '', ",$toList,"); $openIdList = $this->getBoundUsers($webhookID, $toList); From 1a17dd0207c255f7f46f3112cabea731924c91a9 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 19 Aug 2021 09:16:00 +0800 Subject: [PATCH 40/71] * Finish task#41557. --- module/execution/control.php | 13 ++----------- .../execution/view/executionkanban.html.php | 19 ++----------------- module/repo/model.php | 1 + 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index e81e4a00aa..3a0b650289 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1906,17 +1906,8 @@ class execution extends control /* Up to five closed executions are displayed. */ if($status == 'closed') { - if(isset($myExecutions[$status]) and count($myExecutions[$status]) >= 5) - { - $myExecutions[$status] = array_slice($myExecutions[$status], 0, 5, true); - $myExecutions[$status]['more'] = $this->lang->execution->showMore; - } - - if(isset($kanbanGroup[$projectID][$status]) and count($kanbanGroup[$projectID][$status]) >= 5) - { - $kanbanGroup[$projectID][$status] = array_slice($kanbanGroup[$projectID][$status], 0, 5, true); - $kanbanGroup[$projectID][$status]['more'] = $this->lang->execution->showMore; - } + if(isset($myExecutions[$status]) and count($myExecutions[$status]) >= 5) $myExecutions[$status] = array_slice($myExecutions[$status], 0, 5, true); + if(isset($kanbanGroup[$projectID][$status]) and count($kanbanGroup[$projectID][$status]) >= 5) $kanbanGroup[$projectID][$status] = array_slice($kanbanGroup[$projectID][$status], 0, 5, true); } } diff --git a/module/execution/view/executionkanban.html.php b/module/execution/view/executionkanban.html.php index a7b00d03f0..b4b7775a76 100644 --- a/module/execution/view/executionkanban.html.php +++ b/module/execution/view/executionkanban.html.php @@ -22,7 +22,7 @@ execution->doingProject . ' (' . $projectCount . ')';?> execution->kanbanColType as $status => $colName):?> - + @@ -45,21 +45,7 @@
- $execution):?> - -
- createLink('execution', 'all', "status=closed&projectID=$projectID"), $execution, '', "title='$execution'"); - } - else - { - echo "$execution"; - } - ?> -
- +
status == 'doing' and isset($execution->delay)) echo "style='border-left: 3px solid red';";?>>
@@ -85,7 +71,6 @@
-
diff --git a/module/repo/model.php b/module/repo/model.php index 4ec2ce457e..f7ac6b78e9 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -1790,6 +1790,7 @@ class repoModel extends model { $gitlab = $this->loadModel('gitlab')->getByID($repo->client); // The $repo->client is gitlabID. if(!$gitlab) return $repo; + $repo->gitlab = $gitlab->id; $repo->project = $repo->path; // The projectID in gitlab. $repo->path = sprintf($this->config->repo->gitlab->apiPath, $gitlab->url, $repo->path); From 85129ebb3c8a9b0ba0431be51f0d98395a60e194 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 19 Aug 2021 09:16:28 +0800 Subject: [PATCH 41/71] * Finish task #41608. --- module/upgrade/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index f0741ffaa9..cdc1909a6e 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4702,9 +4702,9 @@ class upgradeModel extends model $today = helper::today(); foreach($projectTeams as $projectID => $projectMember) { - unset($projectMember['']); - $project = zget($projects, $projectID, ''); - $users = implode(',', $projectMember); + $projectMember = array_filter($projectMember); + $project = zget($projects, $projectID, ''); + $users = implode(',', $projectMember); $this->dao->update(TABLE_DOCLIB) ->set('users')->eq($users) From 00e47922e0409419b04a910a38e6281fe9ef4d2e Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 19 Aug 2021 09:19:22 +0800 Subject: [PATCH 42/71] * Delete unused language items. --- module/execution/lang/de.php | 1 - module/execution/lang/en.php | 1 - module/execution/lang/fr.php | 1 - module/execution/lang/vi.php | 1 - module/execution/lang/zh-cn.php | 1 - module/execution/lang/zh-tw.php | 1 - 6 files changed, 6 deletions(-) diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index b1152a579d..f8298ba8bf 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -100,7 +100,6 @@ $lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . ' $lang->execution->noTeam = 'No team members at the moment'; $lang->execution->or = ' or '; $lang->execution->selectProject = 'Please select project'; -$lang->execution->showMore = 'View closed executions'; if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "select Project/{$lang->execution->common} to copy its members"; if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "select Project/{$lang->executionCommon} to copy its members"; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index ab6ec655d9..c395805005 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -101,7 +101,6 @@ $lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . ' $lang->execution->noTeam = 'No team members at the moment'; $lang->execution->or = ' or '; $lang->execution->selectProject = 'Please select project'; -$lang->execution->showMore = 'View closed executions'; if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "select Project/{$lang->execution->common} to copy its members"; if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "select Project/{$lang->executionCommon} to copy its members"; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 2712929b4a..5c66827cc5 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -100,7 +100,6 @@ $lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . ' $lang->execution->noTeam = 'No team members at the moment'; $lang->execution->or = ' or '; $lang->execution->selectProject = 'Please select project'; -$lang->execution->showMore = 'View closed executions'; if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "select Project/{$lang->execution->common} to copy its members"; if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "select Project/{$lang->executionCommon} to copy its members"; diff --git a/module/execution/lang/vi.php b/module/execution/lang/vi.php index b17cd4214b..1adf0855ca 100644 --- a/module/execution/lang/vi.php +++ b/module/execution/lang/vi.php @@ -101,7 +101,6 @@ $lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . ' $lang->execution->noTeam = 'No team members at the moment'; $lang->execution->or = ' or '; $lang->execution->selectProject = 'Please select project'; -$lang->execution->showMore = 'View closed executions'; if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "select Project/{$lang->execution->common} to copy its members"; if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "select Project/{$lang->executionCommon} to copy its members"; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 53e838b003..20885cb59a 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -101,7 +101,6 @@ $lang->execution->copyNoExecution = '没有可用的' . $lang->executionCommon . $lang->execution->noTeam = '暂时没有团队成员'; $lang->execution->or = '或'; $lang->execution->selectProject = '请选择项目'; -$lang->execution->showMore = '点击查看所有已关闭的执行'; if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "可以选择复制项目或{$lang->execution->common}团队的成员"; if($this->config->systemMode == 'classic') $lang->execution->copyTeamTip = "可以选择复制{$lang->executionCommon}团队的成员"; diff --git a/module/execution/lang/zh-tw.php b/module/execution/lang/zh-tw.php index f0b066a4c7..d5f44425f2 100644 --- a/module/execution/lang/zh-tw.php +++ b/module/execution/lang/zh-tw.php @@ -100,7 +100,6 @@ $lang->execution->recent = '近期訪問:'; $lang->execution->copyNoExecution = '沒有可用的' . $lang->executionCommon . '來複制'; $lang->execution->noTeam = '暫時沒有團隊成員'; $lang->execution->selectProject = '請選擇項目'; -$lang->execution->showMore = '點擊查看所有已關閉的執行'; $lang->execution->start = "開始"; $lang->execution->activate = "激活"; From 4c60d66765dcae009abf0de6fd0ab9e7e77d160d Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 19 Aug 2021 09:21:04 +0800 Subject: [PATCH 43/71] * Finish task#41556. --- module/execution/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 3a0b650289..6182b84f59 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1903,7 +1903,7 @@ class execution extends control $statusCount[$status] += isset($kanbanGroup[$projectID][$status]) ? count($kanbanGroup[$projectID][$status]) : 0; - /* Up to five closed executions are displayed. */ + /* Max 5 closed executions. */ if($status == 'closed') { if(isset($myExecutions[$status]) and count($myExecutions[$status]) >= 5) $myExecutions[$status] = array_slice($myExecutions[$status], 0, 5, true); From 45c1153e17fbdd5e16763137f3ba8f8d3ff80683 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 19 Aug 2021 09:36:08 +0800 Subject: [PATCH 44/71] * Finish task #41573,41575. --- module/program/js/edit.js | 5 +++++ module/program/view/edit.html.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/program/js/edit.js b/module/program/js/edit.js index bf521c767a..6301615908 100644 --- a/module/program/js/edit.js +++ b/module/program/js/edit.js @@ -63,6 +63,11 @@ $(function() alert(exRateNotEmpty); return false; } + else if(isNaN(exchangeRate)) + { + alert(exRateNum); + return false; + } else if(exchangeRate < 0) { alert(exRateNotNegative); diff --git a/module/program/view/edit.html.php b/module/program/view/edit.html.php index f727f032a4..85faf2c1ab 100644 --- a/module/program/view/edit.html.php +++ b/module/program/view/edit.html.php @@ -21,6 +21,7 @@ budgetUnit);?> error->notempty, $lang->program->exchangeRate));?> +error->float, $lang->program->exchangeRate));?> program->exRateNotNegative);?> parent ? $lang->program->subAclList : $lang->program->aclList;?> program->edit->requiredFields;?> @@ -135,7 +136,7 @@ budgetUnit);?> -
+
From 91a7306bc481ca5b7d063e597866f3dde8a167ee Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 19 Aug 2021 09:40:12 +0800 Subject: [PATCH 45/71] * Finish task #41572. --- module/program/js/edit.js | 4 ++-- module/program/view/edit.html.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/program/js/edit.js b/module/program/js/edit.js index 6301615908..c73ca1c2f5 100644 --- a/module/program/js/edit.js +++ b/module/program/js/edit.js @@ -49,13 +49,13 @@ $(function() } }) - $('#cancelBtn').click(function() + $('#cancelBTN').click(function() { $('#syncPRJUnit').val('false'); $('#exchangeRate').val(''); }) - $('#confirmBtn').click(function() + $('#confirmBTN').click(function() { var exchangeRate = $('#rate').val(); if(!exchangeRate) diff --git a/module/program/view/edit.html.php b/module/program/view/edit.html.php index 85faf2c1ab..810baaa9fd 100644 --- a/module/program/view/edit.html.php +++ b/module/program/view/edit.html.php @@ -141,8 +141,8 @@ - confirm, "id='confirmBtn'", 'btn btn-primary btn-wide');?> - cancel, "data-dismiss='modal' id='cancelBtn'", 'btn btn-default btn-wide');?> + confirm, "id='confirmBTN'", 'btn btn-primary btn-wide');?> + cancel, "data-dismiss='modal' id='cancelBTN'", 'btn btn-default btn-wide');?> From 7306d7a66774bb8dd55b13fd33e7585c3d7451e3 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 19 Aug 2021 09:42:56 +0800 Subject: [PATCH 46/71] * Finish task #41572. --- module/program/js/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/program/js/edit.js b/module/program/js/edit.js index c73ca1c2f5..d69473ebad 100644 --- a/module/program/js/edit.js +++ b/module/program/js/edit.js @@ -60,17 +60,17 @@ $(function() var exchangeRate = $('#rate').val(); if(!exchangeRate) { - alert(exRateNotEmpty); + bootbox.alert(exRateNotEmpty); return false; } else if(isNaN(exchangeRate)) { - alert(exRateNum); + bootbox.alert(exRateNum); return false; } else if(exchangeRate < 0) { - alert(exRateNotNegative); + bootbox.alert(exRateNotNegative); return false; } From f7b9887fe06a8663130e933108de548363d32dc1 Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Thu, 19 Aug 2021 09:46:24 +0800 Subject: [PATCH 47/71] * Finish task #41565. --- module/execution/css/managemembers.css | 3 ++- module/execution/js/managemembers.js | 8 ++++++++ module/execution/view/managemembers.html.php | 2 ++ module/personnel/model.php | 3 +-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/module/execution/css/managemembers.css b/module/execution/css/managemembers.css index f49ff460c3..d9566fc8b1 100644 --- a/module/execution/css/managemembers.css +++ b/module/execution/css/managemembers.css @@ -14,7 +14,8 @@ #importTeams .input-group +.input-group {margin-left: 5px;} #dept_chosen .chosen-single {width: 220px;} -#execution_chosen .chosen-single {width: 220px;} +#execution_chosen .chosen-single {width: 230px;} +#execution_chosen .chosen-drop ul li .label {margin-top: 2px; background: #fff; color: #838a9d; border: 1px solid #d8d8d8;} .radio-inline {line-height: normal;} #teamForm .table tr > td:first-child {padding-left: 10px;} diff --git a/module/execution/js/managemembers.js b/module/execution/js/managemembers.js index c926647194..dcb825168b 100644 --- a/module/execution/js/managemembers.js +++ b/module/execution/js/managemembers.js @@ -1,3 +1,11 @@ +$(function() +{ + $('#execution_chosen').click(function() + { + if(systemMode == 'new') $('#execution_chosen ul li:first').append(' ') + }) +}) + /** * Set role when select an account. * diff --git a/module/execution/view/managemembers.html.php b/module/execution/view/managemembers.html.php index 5b0476f8e0..ed523ff266 100644 --- a/module/execution/view/managemembers.html.php +++ b/module/execution/view/managemembers.html.php @@ -11,6 +11,8 @@ */ ?> +systemMode);?> +projectCommon);?> id);?> diff --git a/module/personnel/model.php b/module/personnel/model.php index a6da2f6a1a..7184ecf012 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -485,8 +485,7 @@ class personnelModel extends model ->fetchPairs(); foreach($objects as $id => &$object) { - if($id == $parentID) $object = $this->lang->projectCommon . '-' . $object; - if($id != $parentID) $object = $this->lang->execution->common . '-' . $object; + if($id != $parentID) $object = '   ' . $object; } } elseif($objectType == 'project') From 2c0f0414ac0a11a339a8a2bc34e7a6042961ff6a Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 19 Aug 2021 09:47:01 +0800 Subject: [PATCH 48/71] + Add function getUserDetailsForAPI to user module. --- module/user/config.php | 3 +++ module/user/model.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/module/user/config.php b/module/user/config.php index 6530268885..bd1a602d98 100644 --- a/module/user/config.php +++ b/module/user/config.php @@ -17,3 +17,6 @@ $config->user->contactField = 'mobile,phone,qq,dingding,weixin,skype,whatsapp,sl $config->user->failTimes = 6; $config->user->lockMinutes = 10; $config->user->batchCreate = 10; + +/* user detail fields for API against JIHU GitLab. */ +$config->user->detailFields = 'id,account,realname,avatar'; diff --git a/module/user/model.php b/module/user/model.php index 9a46f5c0e6..d4c47acd94 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2552,4 +2552,34 @@ class userModel extends model return $personalData; } + + /** + * Get users details for API. + * + * @param array $userList + * @access public + * @return array + */ + public function getUserDetailsForAPI($userList) + { + $users = $this->dao->select($this->config->user->detailFields)->from(TABLE_USER)->where("account")->in($userList)->fetchAll(); + + $userDetails = array(); + foreach($users as $index => $user) + { + $user->url = helper::createLink('user', 'profile', "userID={$user->id}"); + + if($user->avatar != "") + { + $user->avatar = common::getSysURL() . $user->avatar; + } + else + { + $user->avatar = "https://www.gravatar.com/avatar/" . md5($user->account) . "?d=identicon&s=80"; + } + + $userDetails[$user->account] = $user; + } + return $userDetails; + } } From 954d2908c487bb55e0122c6a024b97955e9dea26 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 19 Aug 2021 09:47:49 +0800 Subject: [PATCH 49/71] * Refactor get user details logic and improve performance. --- api/v1/entries/productissues.php | 87 +++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 8 deletions(-) diff --git a/api/v1/entries/productissues.php b/api/v1/entries/productissues.php index a8c24b65c5..04dc1f4005 100644 --- a/api/v1/entries/productissues.php +++ b/api/v1/entries/productissues.php @@ -124,7 +124,7 @@ class productIssuesEntry extends entry ->beginIF($storyFilter != 'all')->andWhere('category')->in($storyFilter)->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); - foreach($stories as $story) $issues[] = array('id' => $story->id, 'type' => 'story', 'order' => $story->$order, 'status' => $this->getKey($story->status, $storyStatus)); + foreach($stories as $story) $issues[] = array('id' => $story->id, 'type' => 'story', 'order' => $story->$order, 'status' => $this->getKey($story->status, $storyStatus)); } if($bugFilter) @@ -136,7 +136,7 @@ class productIssuesEntry extends entry ->beginIF($bugFilter != 'all')->andWhere('type')->in($bugFilter)->fi() ->andWhere('deleted')->eq(0) ->fetchAll(); - foreach($bugs as $bug) $issues[] = array('id' => $bug->id, 'type' => 'bug', 'order' => $bug->$order, 'status' => $this->getKey($bug->status, $bugStatus)); + foreach($bugs as $bug) $issues[] = array('id' => $bug->id, 'type' => 'bug', 'order' => $bug->$order, 'status' => $this->getKey($bug->status, $bugStatus)); } array_multisort(array_column($issues, 'order'), $sort == 'asc' ? SORT_ASC : SORT_DESC, $issues); @@ -190,13 +190,39 @@ class productIssuesEntry extends entry $r->title = $task->name; $r->labels = array($this->app->lang->task->common, zget($this->app->lang->task->typeList, $task->type)); $r->pri = $task->pri; - $r->assignedTo = $this->entry->getAssignees('task', $task); $r->openedDate = $task->openedDate; - $r->openedBy = $this->entry->getUser($task->openedBy); + $r->openedBy = $task->openedBy; $r->lastEditedDate = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedDate : $task->lastEditedDate; $r->lastEditedBy = $task->lastEditedDate < '1970-01-01 01:01:01' ? $task->openedBy : $task->lastEditedBy; $r->status = $issue['status']; $r->url = helper::createLink('task', 'view', "taskID=$task->id"); + $r->assignedTo = array(); + + /* Get assignees for task, the task object has the type of multiple assign only so far. */ + $users = $this->dao->select('account')->from(TABLE_TEAM) + ->where('type')->eq('task') + ->andWhere('root')->eq($task->id) + ->fetchAll(); + if($users) + { + foreach($users as $user) + { + $r->assignedTo[] = $user->account; + } + } + else + { + if($task->assignedTo == "") + { + $r->assignedTo = array(); + } + else + { + $r->assignedTo = array($task->assignedTo); + } + } + + } else if($issue['type'] == 'story') { @@ -206,13 +232,21 @@ class productIssuesEntry extends entry $r->title = $story->title; $r->labels = array($this->app->lang->story->common, zget($this->app->lang->story->categoryList, $story->category)); $r->pri = $story->pri; - $r->assignedTo = $this->entry->getAssignees('story', $story); $r->openedDate = $story->openedDate; - $r->openedBy = $this->entry->getUser($story->openedBy); + $r->openedBy = $story->openedBy; $r->lastEditedDate = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedDate : $story->lastEditedDate; $r->lastEditedBy = $story->lastEditedDate < '1970-01-01 01:01:01' ? $story->openedBy : $story->lastEditedBy; $r->status = $issue['status']; $r->url = helper::createLink('story', 'view', "storyID=$story->id"); + + if($story->assignedTo == "") + { + $r->assignedTo = array(); + } + else + { + $r->assignedTo = array($story->assignedTo); + } } else if($issue['type'] == 'bug') { @@ -222,18 +256,55 @@ class productIssuesEntry extends entry $r->title = $bug->title; $r->labels = array($this->app->lang->bug->common, zget($this->app->lang->bug->typeList, $bug->type)); $r->pri = $bug->pri; - $r->assignedTo = $this->entry->getAssignees('bug', $bug); $r->openedDate = $bug->openedDate; - $r->openedBy = $this->entry->getUser($bug->openedBy); + $r->openedBy = $bug->openedBy; $r->lastEditedDate = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedDate : $bug->lastEditedDate; $r->lastEditedBy = $bug->lastEditedDate < '1970-01-01 01:01:01' ? $bug->openedBy : $bug->lastEditedBy; $r->status = $issue['status']; $r->url = helper::createLink('bug', 'view', "bugID=$bug->id"); + + if($bug->assignedTo == "") + { + $r->assignedTo = array(); + } + else + { + $r->assignedTo = array($bug->assignedTo); + } } $result[] = $this->format($r, 'openedDate:time,lastEditedDate:time'); } + /** + * Get all users in issues so that we can bulk get user detail later. + * + */ + $userList = array(); + foreach($result as $issue) + { + foreach($issue->assignedTo as $user) + { + $userList[] = $user; + } + $userList[] = $issue->openedBy; + } + $userList = array_unique($userList); + $userDetails = $this->loadModel('user')->getUserDetailsForAPI($userList); + + /** + * Set the user detail to assignedTo and openedBy. + * + */ + foreach($result as $issue) + { + foreach($issue->assignedTo as $index => $user) + { + $issue->assignedTo[$index] = $userDetails[$user]; + } + $issue->openedBy = $userDetails[$issue->openedBy]; + } + return $result; } From 1b6373b60aba50143e8889ab5139df2ed7a73212 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 19 Aug 2021 09:49:42 +0800 Subject: [PATCH 50/71] * Finish task #41590. --- module/release/model.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/module/release/model.php b/module/release/model.php index 0bba9b1233..b173c6175a 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -272,14 +272,14 @@ class releaseModel extends model /* Init vars. */ $notifyPersons = array(); - $managers = ''; + $managerFields = ''; $notifyList = explode(',', $notifyList); foreach($notifyList as $notify) { if($notify == 'PO' or $notify == 'QD' or $notify == 'feedback') { - $managers .= $notify . ','; + $managerFields .= $notify . ','; } elseif($notify == 'SC' and !empty($buildID)) { @@ -305,13 +305,13 @@ class releaseModel extends model } } - if(!empty($managers)) + if(!empty($managerFields)) { - $managers = trim($managers, ','); - $managerUsers = $this->dao->select($managers)->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch(); + $managerFields = trim($managerFields, ','); + $managerUsers = $this->dao->select($managerFields)->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch(); foreach($managerUsers as $account) { - if(!isset($notifyPersons[$account])) $notifyPersons += array($account => $account); + if(!isset($notifyPersons[$account])) $notifyPersons[$account] = $account; } } From c80bb11ebb81c891b71c756d8e8e4df5d2dd246e Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 19 Aug 2021 09:51:17 +0800 Subject: [PATCH 51/71] * Fix bug #14393. --- .../execution/view/ajaxgetdropmenu.html.php | 25 ++++++++++++++++--- module/product/view/ajaxgetdropmenu.html.php | 25 ++++++++++++++++--- module/project/view/ajaxgetdropmenu.html.php | 25 ++++++++++++++++--- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 03e279f61e..d5eec9606e 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -13,7 +13,7 @@ #tabContent {margin-top: 10px; z-index: 900;} #tabContent ul {list-style: none; margin: 0} #tabContent .tab-pane>ul {padding-left: 7px;} -#tabContent .tab-pane>ul>li.hide-in-search>div {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;} +#tabContent .tab-pane>ul>li>div {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;} #tabContent .tab-pane>ul>li label {background: rgba(255,255,255,0.5); line-height: unset; color: #838a9d; border: 1px solid #d8d8d8; border-radius: 2px; padding: 1px 4px;} #tabContent li a i.icon {font-size: 15px !important;} #tabContent li a i.icon:before {min-width: 16px !important;} @@ -23,8 +23,12 @@ #tabContent .tree li>.list-toggle {line-height: 24px;} #tabContent .tree li.has-list.open:before {content: unset;} -#swapper li.hide-in-search>div>a:focus, #swapper li.hide-in-search>div>a:hover {color: #838a9d; cursor: default;} +#swapper li>div.hide-in-search>a:focus, #swapper li>div.hide-in-search>a:hover {color: #838a9d; cursor: default;} a.executionName:focus, a.executionName:hover {background: #0c64eb; color: #fff !important;} + +#swapper li > a {padding-top: 4px; padding-bottom: 4px;} +#swapper li {padding-top: 0; padding-bottom: 0;} +#swapper .tree li>.list-toggle {top: -1px;} $projectExecutions) $projectName = zget($projects, $projectID); $preFix = $projectName . ' / '; - if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '