From c1f71409f8fef1d5151cc70d4eb55cad5fb5a157 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 11 Aug 2022 16:49:33 +0800 Subject: [PATCH 1/8] * Fix bug #22376. --- .../lite/workflow/ext/view/ui.flow.html.hook.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 extension/lite/workflow/ext/view/ui.flow.html.hook.php diff --git a/extension/lite/workflow/ext/view/ui.flow.html.hook.php b/extension/lite/workflow/ext/view/ui.flow.html.hook.php new file mode 100644 index 0000000000..c7a346d076 --- /dev/null +++ b/extension/lite/workflow/ext/view/ui.flow.html.hook.php @@ -0,0 +1,11 @@ +visions == ',lite,'):?> +dao->select('id')->from(TABLE_WORKFLOWDATASOURCE)->where('code')->like('litefeedback%')->andWhere('vision')->eq('lite')->fetchPairs('id', 'id');?> + + + + From baf02b5fe38212ff436ed5d354b91125c099ff25 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 12 Aug 2022 08:42:01 +0800 Subject: [PATCH 2/8] * Format code for port. --- module/port/control.php | 10 ++++------ module/port/model.php | 19 +++++-------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/module/port/control.php b/module/port/control.php index decc297470..0725f3a71a 100644 --- a/module/port/control.php +++ b/module/port/control.php @@ -104,13 +104,11 @@ class port extends control $file = $this->loadModel('file')->getUpload('file'); $file = $file[0]; $shortName = $this->file->getSaveName($file['pathname']); - if(empty($shortName)) - { - die(js::alert($this->lang->excel->emptyFileName)); - } - $extension = $file['extension']; - $fileName = $this->file->savePath . $shortName; + if(empty($shortName)) die(js::alert($this->lang->excel->emptyFileName)); + + $extension = $file['extension']; + $fileName = $this->file->savePath . $shortName; move_uploaded_file($file['tmpname'], $fileName); diff --git a/module/port/model.php b/module/port/model.php index 91a7d79a7a..7dae8978f5 100644 --- a/module/port/model.php +++ b/module/port/model.php @@ -401,10 +401,8 @@ class portModel extends model $dataList = array(); $sysDataFields = explode(',', $this->portConfig->sysDataFields); - foreach($sysDataFields as $field) - { - $dataList[$field] = $this->loadModel($field)->getPairs(); - } + + foreach($sysDataFields as $field) $dataList[$field] = $this->loadModel($field)->getPairs(); return $dataList; } @@ -523,8 +521,7 @@ class portModel extends model */ public function getSourceByLang($lang) { - $lang = isset($this->modelLang->$lang) ? $this->modelLang->$lang : ''; - return $lang; + return isset($this->modelLang->$lang) ? $this->modelLang->$lang : ''; } /** @@ -733,10 +730,7 @@ class portModel extends model } /* Deal children datas and multiple tasks .*/ - if($modelDatas) - { - $modelDatas = $this->updateChildDatas($modelDatas); - } + if($modelDatas) $modelDatas = $this->updateChildDatas($modelDatas); return $modelDatas; } @@ -790,10 +784,7 @@ class portModel extends model $relatedObjectIdList = array(); $relatedObjects = array(); - foreach($datas as $data) - { - $relatedObjectIdList[$data->$object] = $data->$object; - } + foreach($datas as $data) $relatedObjectIdList[$data->$object] = $data->$object; if($object == 'openedBuild') $object = 'build'; From 21866db3090d3f3aeffa9563e18f1ecd8604c379 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Fri, 12 Aug 2022 00:46:07 +0000 Subject: [PATCH 3/8] * Fix bug. --- module/file/view/viewfiles.html.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/file/view/viewfiles.html.php b/module/file/view/viewfiles.html.php index a1534e45d3..9848291995 100644 --- a/module/file/view/viewfiles.html.php +++ b/module/file/view/viewfiles.html.php @@ -114,7 +114,6 @@ data: postData, success: function(data) { - console.log(data['title']); $('#fileTitle' + fileID).html("  " + data['title']); $('#renameFile' + fileID).closest('li').removeClass('hidden'); $('#renameBox' + fileID).addClass('hidden'); From c5522146da19ecaa22884be7572d67bbf0dbb9dd Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 13:12:56 +0800 Subject: [PATCH 4/8] * Fix bug #26325. --- module/user/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/user/model.php b/module/user/model.php index 4e366ef854..83fe7a3f4a 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -798,6 +798,7 @@ class userModel extends model $this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec(); $this->app->user->password = $user->password; $this->app->user->modifyPassword = false; + $_SESSION['user']->password = $user->password; if(!dao::isError()) { if(!empty($this->app->user->modifyPasswordReason)) $this->app->user->modifyPasswordReason = ''; From 698510fadfa88681f9d3d56e0b60458721263ef7 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 13:13:38 +0800 Subject: [PATCH 5/8] * Fix bug #26325. --- module/user/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/user/model.php b/module/user/model.php index 83fe7a3f4a..7fec646510 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -796,9 +796,9 @@ class userModel extends model } $this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec(); + $_SESSION['user']->password = $user->password; $this->app->user->password = $user->password; $this->app->user->modifyPassword = false; - $_SESSION['user']->password = $user->password; if(!dao::isError()) { if(!empty($this->app->user->modifyPasswordReason)) $this->app->user->modifyPasswordReason = ''; From f540e5838851be00718416fc1be3af4f92c7b919 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 14:25:29 +0800 Subject: [PATCH 6/8] * Fix bug. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 5c441b0f47..14d8e21126 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -100,7 +100,7 @@ class executionModel extends model include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - if(isset($execution->cal) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); + if(isset($execution->acl) and $execution->acl != 'private') unset($this->lang->execution->menu->settings['subMenu']->whitelist); if($execution and $execution->lifetime == 'ops') { From 26085d7a41f3c7ea327c1edaf1ecca4155f8480f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 12 Aug 2022 14:56:27 +0800 Subject: [PATCH 7/8] * Operations type execution and story or design type stage do not display story field. --- module/task/control.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 905ee7cdc3..eb7277686d 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -438,10 +438,16 @@ class task extends control $customFields[$field] = $this->lang->task->$field; } - if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') unset($customFields['story']); + $showFields = $this->config->task->custom->batchCreateFields; + if($execution->lifetime == 'ops' or $execution->attribute == 'request' or $execution->attribute == 'review') + { + unset($customFields['story']); + $showFields = str_replace(',story,', ',', ",$showFields,"); + $showFields = trim($showFields, ','); + } $this->view->customFields = $customFields; - $this->view->showFields = $this->config->task->custom->batchCreateFields; + $this->view->showFields = $showFields; if($execution->type == 'kanban') { From 8dc2999075f6f7bc98526c331f8f50ca8ff87309 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 12 Aug 2022 15:44:01 +0800 Subject: [PATCH 8/8] * Fix bug #26379. --- module/action/model.php | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 92c83c05b4..98b6cfe56c 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -989,39 +989,43 @@ class actionModel extends model if($projectID == 'all') $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? $this->app->user->view->projects : '0'; if($executionID == 'all') $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? $this->app->user->view->sprints : '0'; + if(empty($authedProducts)) $authedProducts = '0'; + if($productID == 'all' and $projectID == 'all') { $productCondition = ''; - foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + $productCondition .= '))'; - $projectCondition = "project " . helper::dbIN($authedProjects); - $executionCondition = isset($authedExecutions) ? "execution " . helper::dbIN($authedExecutions) : ''; + $projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')'; + $executionCondition = isset($authedExecutions) ? "(execution != 0 and execution " . helper::dbIN($authedExecutions) . ')' : ''; } elseif($productID == 'all' and is_numeric($projectID)) { $products = $this->loadModel('product')->getProductPairsByProject($projectID); - $executions = $this->loadModel('execution')->getPairs($projectID); + $executions = $this->loadModel('execution')->getPairs($projectID) + array(0 => 0); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); $productCondition = ''; - foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "(execution = '0' and project = '0' and (product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'"; + $productCondition .= '))'; - $projectCondition = "project = $projectID"; - $executionCondition = "execution " . helper::dbIN($authedExecutions); + $projectCondition = "(execution = '0' and project = '$projectID')"; + $executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')'; } elseif(is_numeric($productID) and $projectID == 'all') { $this->loadModel('product'); $projects = $this->product->getProjectPairsByProduct($productID); - $executions = $this->product->getExecutionPairsByProduct($productID); + $executions = $this->product->getExecutionPairsByProduct($productID) + array(0 => 0); $authedProjects = array_intersect(array_keys($projects), explode(',', $authedProjects)); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); $productCondition = "product like '%,$productID,%'"; - $projectCondition = 'project ' . helper::dbIN($authedProjects); - $executionCondition = 'execution ' . helper::dbIN($authedExecutions); + $projectCondition = "(execution = '0' and project != '0' and project " . helper::dbIN($authedProjects) . ')'; + $executionCondition = "(execution != '0' and execution " . helper::dbIN($authedExecutions) . ')'; } $condition = "((product =',0,' or product = '0' or product=',,') AND project = '0' AND execution = '0')"; @@ -1222,17 +1226,8 @@ class actionModel extends model $relatedProjects = $relatedData['relatedProjects']; $requirements = $relatedData['requirements']; - $aclViews = isset($this->app->user->rights['acls']['views']) ? $this->app->user->rights['acls']['views'] : array(); - $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? ",{$this->app->user->view->projects}," : ''; - $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? ",{$this->app->user->view->sprints},": ''; - foreach($actions as $i => $action) { - if(($action->execution != '0' and strpos($authedExecutions, ",$action->execution,") === false) or ($action->execution == '0' and $action->project != '0' and strpos($authedProjects, ",$action->project,") === false)) - { - unset($actions[$i]); - continue; - } /* Add name field to the actions. */ $action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : '';