From f04fe0dbd62c17093921e9e0537903872a099fa5 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 27 Jan 2021 13:26:00 +0800 Subject: [PATCH 1/8] * Fix bug#3816. --- module/block/view/contribute.html.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/module/block/view/contribute.html.php b/module/block/view/contribute.html.php index 3bc6f92681..1adf92bbe7 100644 --- a/module/block/view/contribute.html.php +++ b/module/block/view/contribute.html.php @@ -8,31 +8,31 @@
block->createdRequirements;?>
-
createLink('my', 'story', 'type=openedBy&storyType=requirement'), (int)$data['createdRequirements']);?>
+
createLink('my', 'contribute', 'mode=requirement'), (int)$data['createdRequirements']);?>
block->createdStories;?>
-
createLink('my', 'story', 'type=openedBy'), (int)$data['createdStories']);?>
+
createLink('my', 'contribute', 'mode=story'), (int)$data['createdStories']);?>
block->finishedTasks;?>
-
createLink('my', 'task', 'type=finishedBy'), (int)$data['finishedTasks']);?>
+
createLink('my', 'contribute', 'mode=task&type=finishedBy'), (int)$data['finishedTasks']);?>
block->createdBugs;?>
-
createLink('my', 'bug', 'type=openedBy'), (int)$data['createdBugs']);?>
+
createLink('my', 'contribute', 'mode=bug'), (int)$data['createdBugs']);?>
block->resolvedBugs;?>
-
createLink('my', 'bug', 'type=resolvedBy'), (int)$data['resolvedBugs']);?>
+
createLink('my', 'contribute', 'mode=bug&type=resolvedBy'), (int)$data['resolvedBugs']);?>
block->createdCases;?>
-
createLink('my', 'testcase', 'type=openedbyme'), (int)$data['createdCases']);?>
+
createLink('my', 'contribute', 'mode=testcase&type=openedbyme'), (int)$data['createdCases']);?>
block->createdRisks;?>
-
+
createLink('my', 'contribute', 'mode=risk'), (int)$data['createdRisks']);?>
block->resolvedRisks;?>
@@ -40,7 +40,7 @@
block->createdIssues;?>
-
+
createLink('my', 'contribute', 'mode=issue'), (int)$data['createdIssues']);?>
block->resolvedIssues;?>
From 64e01f669fa9b08c7e3d8256a269c69b72cc2bfd Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 27 Jan 2021 13:46:52 +0800 Subject: [PATCH 2/8] * Finish task#9094. --- module/block/view/scrumoverviewblock.html.php | 6 +++--- module/product/view/project.html.php | 6 +++--- module/project/view/importtask.html.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/block/view/scrumoverviewblock.html.php b/module/block/view/scrumoverviewblock.html.php index 341de826fa..d349d50aeb 100644 --- a/module/block/view/scrumoverviewblock.html.php +++ b/module/block/view/scrumoverviewblock.html.php @@ -46,10 +46,10 @@
block->spent;?>
- budget != 0 ? zget($lang->program->currencySymbol, $totalData[$projectID]->budgetUnit) . number_format($totalData[$projectID]->budget, 2) : $lang->program->future;?> -
+
¥0
- block->budget . ' ' . $budget;?> + budget != 0 ? zget($lang->program->currencySymbol, $totalData[$projectID]->budgetUnit) . number_format($totalData[$projectID]->budget, 2) : $lang->program->future;?> + block->budget . ' ' . $budget;?>
diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php index d375a1c387..779319baab 100644 --- a/module/product/view/project.html.php +++ b/module/product/view/project.html.php @@ -61,9 +61,9 @@ - budget != 0 ? $project->budget . zget($this->lang->program->unitList, $project->budgetUnit) : $this->lang->program->future;?> - hours->totalEstimate;?> - hours->totalConsumed;?> + budget != 0 ? zget($lang->program->currencySymbol, $project->budgetUnit) . number_format($project->budget, 2) : $this->lang->program->future;?> + hours->totalEstimate . ' ' . $lang->project->workHourUnit;?> + hours->totalConsumed . ' ' . $lang->project->workHourUnit;?>
hours->progress;?>%
diff --git a/module/project/view/importtask.html.php b/module/project/view/importtask.html.php index 2ead337e5d..cff5f28302 100644 --- a/module/project/view/importtask.html.php +++ b/module/project/view/importtask.html.php @@ -57,7 +57,7 @@ pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri);?> id", $task->name)) echo $task->name;?> >assignedToRealName;?> - left;?> + left . ' ' . $lang->project->workHourUnit;?> delay)) echo 'delayed';?>>deadline, 0, 4) > 0) echo $task->deadline;?> processStatus('task', $task);?> From 1704f684f4567050503ab9e0889b571a4019f491 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 27 Jan 2021 14:36:17 +0800 Subject: [PATCH 3/8] * Adjust the code. --- module/program/control.php | 23 ++++++++--------------- module/project/control.php | 20 ++++++-------------- module/project/model.php | 8 +++----- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index bc598287dc..e640bb9a17 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -1001,16 +1001,12 @@ class program extends control $linkedProducts = $programID != $project->parent ? array() : $this->project->getProducts($projectID); $parentProgram = $this->program->getPGMByID($programID); - /* If the story of the product which linked the execution under the project, you don't allow to remove the product. */ - $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->fetchAll('story'); - $projectStoryIdList = array_keys($projectStories); + /* If the story of the product which linked the project, you don't allow to remove the product. */ $notRemoveProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { - $productStories = $this->loadModel('story')->getProductStories($productID); - $productStoryIdList = array_keys($productStories); - $storyIntersect = array_intersect($projectStoryIdList, $productStoryIdList); - if(!empty($storyIntersect)) array_push($notRemoveProducts, $productID); + $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); + if(!empty($projectStories)) array_push($notRemoveProducts, $productID); } foreach($linkedProducts as $product) @@ -1735,19 +1731,16 @@ class program extends control $this->loadModel('product'); $project = $this->project->getById($projectID); - /* If the story of the product which linked the execution under the project, you don't allow to remove the product. */ $allProducts = $this->program->getPGMProductPairs($project->parent, 'assign', 'noclosed'); $linkedProducts = $this->project->getProducts($project->id); $linkedBranches = array(); - $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->fetchAll('story'); - $projectStoryIdList = array_keys($projectStories); - $notRemoveProducts = array(); + + /* If the story of the product which linked the project, you don't allow to remove the product. */ + $notRemoveProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { - $productStories = $this->loadModel('story')->getProductStories($productID); - $productStoryIdList = array_keys($productStories); - $storyIntersect = array_intersect($projectStoryIdList, $productStoryIdList); - if(!empty($storyIntersect)) array_push($notRemoveProducts, $productID); + $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); + if(!empty($projectStories)) array_push($notRemoveProducts, $productID); } /* Merge allProducts and linkedProducts for closed product. */ diff --git a/module/project/control.php b/module/project/control.php index c8ecb952a8..71d3c3ff99 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1290,15 +1290,11 @@ class project extends control $linkedBranches = array(); /* If the story of the product which linked the execution, you don't allow to remove the product. */ - $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->fetchAll('story'); - $projectStoryIdList = array_keys($projectStories); - $notRemoveProducts = array(); + $notRemoveProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { - $productStories = $this->loadModel('story')->getProductStories($productID); - $productStoryIdList = array_keys($productStories); - $storyIntersect = array_intersect($projectStoryIdList, $productStoryIdList); - if(!empty($storyIntersect)) array_push($notRemoveProducts, $productID); + $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); + if(!empty($projectStories)) array_push($notRemoveProducts, $productID); } foreach($linkedProducts as $product) @@ -2010,15 +2006,11 @@ class project extends control $linkedBranches = array(); /* If the story of the product which linked the execution, you don't allow to remove the product. */ - $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->fetchAll('story'); - $projectStoryIdList = array_keys($projectStories); - $notRemoveProducts = array(); + $notRemoveProducts = array(); foreach($linkedProducts as $productID => $linkedProduct) { - $productStories = $this->loadModel('story')->getProductStories($productID); - $productStoryIdList = array_keys($productStories); - $storyIntersect = array_intersect($projectStoryIdList, $productStoryIdList); - if(!empty($storyIntersect)) array_push($notRemoveProducts, $productID); + $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('product')->eq($productID)->fetchAll('story'); + if(!empty($projectStories)) array_push($notRemoveProducts, $productID); } // Merge allProducts and linkedProducts for closed product. diff --git a/module/project/model.php b/module/project/model.php index 4f754847c5..f7f4c57661 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2176,11 +2176,9 @@ class projectModel extends model $project = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch(); if($project->type == 'project') { - $executions = $this->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq($projectID)->fetchAll('id'); - $projectStoryList = $this->dao->select('story')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->fetchAll('story'); - $executionStoryList = $this->dao->select('story')->from(TABLE_PROJECTSTORY)->where('project')->in(array_keys($executions))->fetchAll('story'); - $storyIntersect = array_intersect(array_keys($projectStoryList), array_keys($executionStoryList)); - if(in_array($storyID, $storyIntersect)) die(js::alert($this->lang->project->notAllowedUnlinkStory)); + $executions = $this->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq($projectID)->fetchAll('id'); + $executionStories = $this->dao->select('project,story')->from(TABLE_PROJECTSTORY)->where('story')->eq($storyID)->andWhere('project')->in(array_keys($executions))->fetchAll(); + if(!empty($executionStories)) die(js::alert($this->lang->project->notAllowedUnlinkStory)); } $this->dao->delete()->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('story')->eq($storyID)->limit(1)->exec(); From a986454abd01568c58a58cb57768ee7d4e9fd9ac Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 27 Jan 2021 15:13:04 +0800 Subject: [PATCH 4/8] * Fix bug#3769. --- module/program/view/pgmedit.html.php | 2 +- module/program/view/prjedit.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/program/view/pgmedit.html.php b/module/program/view/pgmedit.html.php index 196b3f9cee..c0130dd4ae 100644 --- a/module/program/view/pgmedit.html.php +++ b/module/program/view/pgmedit.html.php @@ -74,7 +74,7 @@ ?>
- end == LONG_TIME ? 999 : '';?> + end == LONG_TIME ? 999 : (strtotime($program->end) - strtotime($program->begin)) / 3600 / 24 + 1;?> program->endList , $endValue, "onclick='computeEndDate(this.value)'");?> diff --git a/module/program/view/prjedit.html.php b/module/program/view/prjedit.html.php index cdfbf5d1a1..0083dc241b 100644 --- a/module/program/view/prjedit.html.php +++ b/module/program/view/prjedit.html.php @@ -79,7 +79,7 @@ ?> - end == LONG_TIME ? 999 : '';?> + end == LONG_TIME ? 999 : (strtotime($project->end) - strtotime($project->begin)) / 3600 / 24 + 1;?> program->endList , $deltaValue, "onclick='computeEndDate(this.value)'");?> model == 'scrum'):?> From ac77fa3a15aaef6d02fec1ba7f6ed376088f0070 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Wed, 27 Jan 2021 15:20:27 +0800 Subject: [PATCH 5/8] * Merge code. --- Makefile | 10 +++++----- module/block/lang/zh-cn.php | 4 ++-- module/block/view/contribute.html.php | 8 ++++---- module/upgrade/control.php | 5 ++++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 89ba630a1b..8395691f37 100644 --- a/Makefile +++ b/Makefile @@ -141,13 +141,13 @@ package: rm -rf zentaopms/tools pms: make common - #make zentaoxx - #unzip zentaoxx.*.zip - #cp zentaoxx/* zentaopms/ -r - #cat zentaoxx/db/xuanxuan.sql >> zentaopms/db/zentao.sql + make zentaoxx + unzip zentaoxx.*.zip + cp zentaoxx/* zentaopms/ -r + cat zentaoxx/db/xuanxuan.sql >> zentaopms/db/zentao.sql make package zip -rq -9 ZenTaoPMS.$(VERSION).zip zentaopms - rm -fr zentaopms #zentaoxx zentaoxx.*.zip + rm -fr zentaopms #entaoxx zentaoxx.*.zip deb: mkdir buildroot cp -r build/debian/DEBIAN buildroot diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index ff292ae8d7..f4aa89a6eb 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -48,8 +48,8 @@ $lang->block->delayed = '已延期'; $lang->block->noData = '当前统计类型下暂无数据'; $lang->block->emptyTip = '暂无信息'; $lang->block->createdTodos = '创建的待办数'; -$lang->block->createdRequirements = '创建的' . $lang->generalUR . '数'; -$lang->block->createdStories = '创建的' . $lang->generalSR . '数'; +$lang->block->createdRequirements = '创建的' . $lang->URCommon . '数'; +$lang->block->createdStories = '创建的' . $lang->SRCommon . '数'; $lang->block->finishedTasks = '完成的任务数'; $lang->block->createdBugs = '提交的Bug数'; $lang->block->resolvedBugs = '解决的Bug数'; diff --git a/module/block/view/contribute.html.php b/module/block/view/contribute.html.php index 1adf92bbe7..e384b1051e 100644 --- a/module/block/view/contribute.html.php +++ b/module/block/view/contribute.html.php @@ -8,11 +8,11 @@
block->createdRequirements;?>
-
createLink('my', 'contribute', 'mode=requirement'), (int)$data['createdRequirements']);?>
+
block->createdStories;?>
-
createLink('my', 'contribute', 'mode=story'), (int)$data['createdStories']);?>
+
block->finishedTasks;?>
@@ -20,7 +20,7 @@
block->createdBugs;?>
-
createLink('my', 'contribute', 'mode=bug'), (int)$data['createdBugs']);?>
+
block->resolvedBugs;?>
@@ -28,7 +28,7 @@
block->createdCases;?>
-
createLink('my', 'contribute', 'mode=testcase&type=openedbyme'), (int)$data['createdCases']);?>
+
block->createdRisks;?>
diff --git a/module/upgrade/control.php b/module/upgrade/control.php index e66a2a5341..64e57e7f7e 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -23,7 +23,10 @@ class upgrade extends control $upgradeFile = $this->app->wwwRoot . 'upgrade.php'; if(!file_exists($upgradeFile)) $this->locate($this->createLink('my', 'index')); - if(version_compare($this->config->installedVersion, '20', '<')) + if((version_compare($this->config->installedVersion, '20', '<') + || strpos($config->version, 'biz') !== false + || strpos($config->version, 'pro') !== false) + && strpos($config->version, 'max') === false) { /* Judge upgrade step. */ $upgradeStep = $this->loadModel('setting')->getItem('owner=system&module=common§ion=global&key=upgradeStep'); From 1409281fd9b13120e0b14323ef767da062f6485a Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 27 Jan 2021 15:34:58 +0800 Subject: [PATCH 6/8] * Finish task#9094. --- module/task/control.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/task/control.php b/module/task/control.php index 362fd59558..a80905b057 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1543,6 +1543,9 @@ class task extends control $task->canceledDate = substr($task->canceledDate, 0, 10); $task->closedDate = substr($task->closedDate, 0, 10); $task->lastEditedDate = substr($task->lastEditedDate, 0, 10); + $task->estimate = $task->estimate . $this->lang->project->workHourUnit; + $task->consumed = $task->consumed . $this->lang->project->workHourUnit; + $task->left = $task->left . $this->lang->project->workHourUnit; /* Set related files. */ $task->files = ''; From 79fc98935b4ce7ff9bdbc90d03d4658501a442f1 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 27 Jan 2021 15:45:50 +0800 Subject: [PATCH 7/8] * Finish task #9097. --- module/my/css/profile.css | 5 ++--- module/my/view/profile.html.php | 21 +++++---------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/module/my/css/profile.css b/module/my/css/profile.css index 1671f2e971..3b7ff34334 100644 --- a/module/my/css/profile.css +++ b/module/my/css/profile.css @@ -6,8 +6,7 @@ table+table{border-top: 1px solid #eee;} .row td{width: 33%; text-align: left; font-weight: 700;} .main-actions{margin: 20px 0 20px 0; text-align: center;} .user-title{margin: 10px 10px -10px 10px; font-size: 14px; font-weight: bold; padding-left: 10px;} -.avatar { display: inline-block; width: 50px; height: 50px; line-height: 50px;} +.avatar{display: inline-block; width: 50px; height: 50px; line-height: 50px;} +.avatar .btn{padding: 0;vertical-align: revert; border: 0;} .user-name{margin-left: 15px} .user-name, .user-role{font-size: 16px; vertical-align: top;} -#avatarUploadBtn{padding: 4px 12px; position: relative; left: 32px; bottom: 30px;} -#avatarForm{height: 10px} diff --git a/module/my/view/profile.html.php b/module/my/view/profile.html.php index 2c12cbf71e..2fb4952dc1 100644 --- a/module/my/view/profile.html.php +++ b/module/my/view/profile.html.php @@ -15,25 +15,14 @@
- avatar) - { - echo html::image($user->avatar); - } - else - { - echo strtoupper($user->account[0]); - } - ?> +
id='avatarForm' enctype='multipart/form-data'> + + avatar ? html::image($user->avatar) : strtoupper($user->account[0]);?> + +
- realname;?> user->roleList, $user->role);?> -
id='avatarForm' enctype='multipart/form-data'> - - my->uploadAvatar, '', "class='btn btn-avatar' id='avatarUploadBtn' data-placement='right'");?> -
-
From 810b7783bcec3d1af59ddde2dba86435479bf9b8 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 27 Jan 2021 15:58:47 +0800 Subject: [PATCH 8/8] * Finish task#9070. --- module/doc/view/objectlibs.html.php | 2 +- module/doc/view/objectlibsbylist.html.php | 2 +- module/index/js/index.js | 2 +- module/index/view/index.html.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/doc/view/objectlibs.html.php b/module/doc/view/objectlibs.html.php index 0fbf2e5a3a..75e1e4b09c 100644 --- a/module/doc/view/objectlibs.html.php +++ b/module/doc/view/objectlibs.html.php @@ -45,7 +45,7 @@ id");?> - id");?> + id&from=$from");?> diff --git a/module/doc/view/objectlibsbylist.html.php b/module/doc/view/objectlibsbylist.html.php index 80f69b88d9..45fb2a47ca 100644 --- a/module/doc/view/objectlibsbylist.html.php +++ b/module/doc/view/objectlibsbylist.html.php @@ -27,7 +27,7 @@ id");?> - id");?> + id&from=$from");?> diff --git a/module/index/js/index.js b/module/index/js/index.js index 7775e42a0e..18da69dadd 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -70,7 +70,7 @@ if(link.prj) return 'project'; if(methodLowerCase === 'objectlibs' && (link.params.type || link.params.$3) == 'product') return 'product'; - if(methodLowerCase === 'showfiles' && (link.params.type || link.params.$1) == 'product') return 'product'; + if(methodLowerCase === 'showfiles' && (link.params.from || link.params.$3) == 'product') return 'product'; if(methodLowerCase === 'browse' && (link.params.from || link.params.$5) == 'product') return 'product'; if(methodLowerCase === 'view' && (link.params.from || link.params.$3) == 'product') return 'product'; if(methodLowerCase === 'edit' && (link.params.from || link.params.$3) == 'product') return 'product'; diff --git a/module/index/view/index.html.php b/module/index/view/index.html.php index c4a919f30c..35f4594eea 100644 --- a/module/index/view/index.html.php +++ b/module/index/view/index.html.php @@ -20,7 +20,7 @@ js::set('menuItems', commonModel::getMainNavList($app->rawModule)); js::set('defaultOpen', $open); ?> config->bizVersion)):?> - +
name, '', "data-group=$from");?> allCount . $lang->doc->item;?>