session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=$branchID&objectID=$objectID{$preDir}");?>
- " . $lang->goback, '', "class='btn btn-link' data-app='{$app->openApp}'");?>
+ " . $lang->goback, '', "class='btn btn-link'");?>
repo->revisionA . ' ' . ($repo->SCM == 'Subversion' ? $revision : $this->repo->getGitRevisionName($revision, $log->commit));?>
From f83a4e4b41afb6dea01ffd99ab3ce590b75ade05 Mon Sep 17 00:00:00 2001
From: holan20180123 <56391770@qq.com>
Date: Tue, 27 Apr 2021 11:37:39 +0800
Subject: [PATCH 04/21] * Fix bug #12368.
---
module/index/view/index.html.php | 1 -
module/testcase/view/createbug.html.php | 5 ++++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/module/index/view/index.html.php b/module/index/view/index.html.php
index 532aa11264..c81c19bb92 100644
--- a/module/index/view/index.html.php
+++ b/module/index/view/index.html.php
@@ -56,7 +56,6 @@ js::set('defaultOpen', $open);
-
diff --git a/module/testcase/view/createbug.html.php b/module/testcase/view/createbug.html.php
index e4f6557599..a4ac7c1908 100644
--- a/module/testcase/view/createbug.html.php
+++ b/module/testcase/view/createbug.html.php
@@ -11,6 +11,7 @@
*/
?>
+openApp);?>
Date: Tue, 27 Apr 2021 13:16:13 +0800
Subject: [PATCH 05/21] * Fix bug #12404.
---
module/product/model.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/module/product/model.php b/module/product/model.php
index d8c9a2c165..2255841b8f 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -1549,7 +1549,7 @@ class productModel extends model
public function getProductLink($module, $method, $extra, $branch = false)
{
$link = '';
- if(strpos('programplan,product,roadmap,bug,testcase,testtask,story,qa,testsuite,testreport,build,projectrelease,projectstory', ',' . $module . ',') !== false)
+ if(strpos(',programplan,product,roadmap,bug,testcase,testtask,story,qa,testsuite,testreport,build,projectrelease,projectstory,', ',' . $module . ',') !== false)
{
if($module == 'product' && $method == 'project')
{
@@ -1578,7 +1578,7 @@ class productModel extends model
elseif($module == 'programplan')
{
$extra = $extra ? $extra : 'gantt';
- $link = helper::createLink($module, 'browse', "projectID=%s&productID=%s&type=$extra" . ($branch ? "&branch=%s" : ''));
+ $link = helper::createLink($module, 'browse', "projectID=%s&productID=%s&type=$extra");
}
elseif($module == 'story' && $method == 'report')
{
From 7f3145888cdc0f2d004a247c763074001f084b50 Mon Sep 17 00:00:00 2001
From: hufangzhou <746775970@qq.com>
Date: Tue, 27 Apr 2021 14:13:40 +0800
Subject: [PATCH 06/21] * Fix bug #12420.
---
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 a65a6ec287..c0e515b743 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -2127,7 +2127,7 @@ class executionModel extends model
$this->loadModel('story')->setStage($storyID);
$this->unlinkCases($executionID, $storyID);
- $objectType = $executionID == $this->session->project ? unlinkedfromproject : unlinkedfromexecution;
+ $objectType = $executionID == $this->session->project ? 'unlinkedfromproject' : 'unlinkedfromexecution';
$this->loadModel('action')->create('story', $storyID, $objectType, '', $executionID);
$tasks = $this->dao->select('id')->from(TABLE_TASK)->where('story')->eq($storyID)->andWhere('execution')->eq($executionID)->andWhere('status')->in('wait,doing')->fetchPairs('id');
From 68ac2499142e49009390cffdd671cf7762c1848e Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Tue, 27 Apr 2021 14:24:04 +0800
Subject: [PATCH 07/21] * Fix bug#12373.
---
module/testreport/control.php | 12 ++++++++++++
module/testreport/view/view.html.php | 3 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/module/testreport/control.php b/module/testreport/control.php
index c76ccc0e8f..c82957a115 100644
--- a/module/testreport/control.php
+++ b/module/testreport/control.php
@@ -260,6 +260,18 @@ class testreport extends control
die(js::locate('back'));
}
+ if($this->app->openApp == 'qa')
+ {
+ $productID = $this->product->saveState(key($productIdList), $this->products);
+ $this->loadModel('qa')->setMenu($this->products, $productID);
+ }
+ elseif($this->app->openApp == 'project')
+ {
+ $projects = $this->project->getPairsByProgram();
+ $projectID = $this->project->saveState($execution->project, $projects);
+ $this->project->setMenu($projectID);
+ }
+
$builds = $this->build->getByList($buildIdList);
$stories = !empty($builds) ? $this->testreport->getStories4Test($builds) : $this->story->getExecutionStories($execution->id);;
diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php
index 56c10bfea0..adbfcdaf47 100644
--- a/module/testreport/view/view.html.php
+++ b/module/testreport/view/view.html.php
@@ -116,7 +116,8 @@
objectID&objectType=$report->objectType&extra=$report->id"), "", '', "class='btn' title='{$lang->testreport->recreate}' data-app='{$this->app->openApp}'");
+ $extra = $report->objectType == 'execution' ? "&extra=$report->tasks" : '';
+ if(common::hasPriv('testreport', 'create')) echo html::a(inLink('create', "objectID=$report->objectID&objectType=$report->objectType" . $extra), "", '', "class='btn' title='{$lang->testreport->recreate}' data-app='{$this->app->openApp}'");
common::printIcon('testreport', 'edit', "reportID=$report->id", '', 'button');
common::printIcon('testreport', 'delete', "reportID=$report->id", '', 'button', 'trash', 'hiddenwin');
}
From 4cec21a516ac096d4f10a231dd867e48a6e55639 Mon Sep 17 00:00:00 2001
From: holan20180123 <56391770@qq.com>
Date: Tue, 27 Apr 2021 14:28:21 +0800
Subject: [PATCH 08/21] * Fix bug #12333.
---
lib/base/front/front.class.php | 22 ++++++++++++++++------
module/todo/control.php | 10 ++++++++--
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php
index d9858e1afc..6708f6f377 100644
--- a/lib/base/front/front.class.php
+++ b/lib/base/front/front.class.php
@@ -885,16 +885,18 @@ class baseJS
* 显示一个确认框,点击确定跳转到$okURL,点击取消跳转到$cancelURL。
* show a confirm box, press ok go to okURL, else go to cancleURL.
*
- * @param string $message 显示的内容。 the text to be showed.
- * @param string $okURL 点击确定后跳转的地址。 the url to go to when press 'ok'.
- * @param string $cancleURL 点击取消后跳转的地址。 the url to go to when press 'cancle'.
- * @param string $okTarget 点击确定后跳转的target。 the target to go to when press 'ok'.
- * @param string $cancleTarget 点击取消后跳转的target。 the target to go to when press 'cancle'.
+ * @param string $message 显示的内容。 the text to be showed.
+ * @param string $okURL 点击确定后跳转的地址。 the url to go to when press 'ok'.
+ * @param string $cancleURL 点击取消后跳转的地址。 the url to go to when press 'cancle'.
+ * @param string $okTarget 点击确定后跳转的target。 the target to go to when press 'ok'.
+ * @param string $cancleTarget 点击取消后跳转的target。 the target to go to when press 'cancle'.
+ * @param string $okOpenApp 点击确定后跳转的应用。 the app to go to when press 'ok'.
+ * @param string $cancleOpenApp 点击取消后跳转的应用。 the app to go to when press 'cancle'.
* @static
* @access public
* @return string
*/
- static public function confirm($message = '', $okURL = '', $cancleURL = '', $okTarget = "self", $cancleTarget = "self")
+ static public function confirm($message = '', $okURL = '', $cancleURL = '', $okTarget = "self", $cancleTarget = "self", $okOpenApp = '', $cancleOpenApp = '')
{
global $app;
if($app->viewType == 'json')
@@ -921,6 +923,10 @@ class baseJS
{
$confirmAction = "history.back(-1);";
}
+ elseif(strpos($okTarget, '$.apps.open') !== false)
+ {
+ $confirmAction = "$okTarget('$okURL', '$okOpenApp');";
+ }
elseif(!empty($okURL))
{
$confirmAction = "$okTarget.location = '$okURL';";
@@ -931,6 +937,10 @@ class baseJS
{
$cancleAction = "history.back(-1);";
}
+ elseif(strpos($cancleTarget, '$.apps.open') !== false)
+ {
+ $cancleAction = "$cancleTarget('$cancleURL', '$cancleOpenApp');";
+ }
elseif(!empty($cancleURL))
{
$cancleAction = "$cancleTarget.location = '$cancleURL';";
diff --git a/module/todo/control.php b/module/todo/control.php
index 5b9d933f94..732ef0b358 100644
--- a/module/todo/control.php
+++ b/module/todo/control.php
@@ -279,8 +279,11 @@ class todo extends control
{
$confirmNote = 'confirm' . ucfirst($todo->type);
$confirmURL = $this->createLink($todo->type, 'view', "id=$todo->idvalue");
+ if($todo->type == 'bug') $app = 'qa';
+ if($todo->type == 'task') $app = 'execution';
+ if($todo->type == 'story') $app = 'product';
$cancelURL = $this->server->HTTP_REFERER;
- die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'parent', 'parent'));
+ die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'window.parent.$.apps.open', 'parent', $app));
}
if(isonlybody())die(js::reload('parent.parent'));
die(js::reload('parent'));
@@ -446,8 +449,11 @@ class todo extends control
{
$confirmNote = 'confirm' . ucfirst($todo->type);
$confirmURL = $this->createLink($todo->type, 'view', "id=$todo->idvalue");
+ if($todo->type == 'bug') $app = 'qa';
+ if($todo->type == 'task') $app = 'execution';
+ if($todo->type == 'story') $app = 'product';
$cancelURL = $this->server->HTTP_REFERER;
- die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'parent', 'parent'));
+ die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'window.parent.$.apps.open', 'parent', $app));
}
if(isonlybody())die(js::reload('parent.parent'));
die(js::reload('parent'));
From 7874535fd5930541ac63042f6551c2217ab1e80a Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Tue, 27 Apr 2021 14:34:53 +0800
Subject: [PATCH 09/21] * Fix bug#12380.
---
module/backup/view/index.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/backup/view/index.html.php b/module/backup/view/index.html.php
index 374ec2ef8c..6d7bef3fd7 100644
--- a/module/backup/view/index.html.php
+++ b/module/backup/view/index.html.php
@@ -63,7 +63,7 @@
1) echo "rowspan='$rowspan'"?>>time);?>
-
+ class='text-left' style='padding-left:5px;'>
From 402e1cb49244dd7abb068c0d7b69eef07c3e28e3 Mon Sep 17 00:00:00 2001
From: qiyu-xie
Date: Tue, 27 Apr 2021 15:04:11 +0800
Subject: [PATCH 10/21] * Fix bug#12397.
---
module/product/view/project.html.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php
index 6fcbd1ea08..5f23536dab 100644
--- a/module/product/view/project.html.php
+++ b/module/product/view/project.html.php
@@ -40,7 +40,7 @@
project->begin;?>
project->end;?>
project->status;?>
- project->budget;?>
+ project->budget;?>
project->estimate;?>
project->consume;?>
project->progress;?>
@@ -78,7 +78,8 @@
app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);?>
budget != 0 ? zget($this->lang->project->currencySymbol, $project->budgetUnit) . ' ' . $projectBudget : $this->lang->project->future;?>
-
+ budget != 0 ? 'text-right' : 'text-center';?>
+
hours->totalEstimate . $lang->execution->workHourUnit;?>
hours->totalConsumed . $lang->execution->workHourUnit;?>
From 7ed10733b38e135dabf9dd01ed268950bd1783f4 Mon Sep 17 00:00:00 2001
From: tianshujie98
Date: Tue, 27 Apr 2021 15:06:52 +0800
Subject: [PATCH 11/21] * Fix bug #11210.
---
module/bug/control.php | 4 ++--
module/product/model.php | 35 +++++++++++++++++++++++++----------
2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/module/bug/control.php b/module/bug/control.php
index d42ddb861f..fb35aca121 100644
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -61,7 +61,7 @@ class bug extends control
}
else
{
- $products = $this->product->getPairs();
+ $products = $this->product->getPairs('', 0, 'program_asc');
}
$this->view->products = $this->products = $products;
@@ -514,7 +514,7 @@ class bug extends control
if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story")));
/* Get products and projects. */
- $products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed');
+ $products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc');
$projects = array(0 => '');
if($projectID)
{
diff --git a/module/product/model.php b/module/product/model.php
index 2255841b8f..5f8bb17ca5 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -261,21 +261,36 @@ class productModel extends model
*
* @param string $mode
* @param string $programID
+ * @param string $orderBy program_asc
* @return array
*/
- public function getPairs($mode = '', $programID = 0)
+ public function getPairs($mode = '', $programID = 0, $orderBy = '')
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProductPairs();
- $orderBy = !empty($this->config->product->orderBy) ? $this->config->product->orderBy : 'isClosed';
- $products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
- ->from(TABLE_PRODUCT)
- ->where('deleted')->eq(0)
- ->beginIF($programID)->andWhere('program')->eq($programID)->fi()
- ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
- ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
- ->orderBy($orderBy)
- ->fetchPairs('id', 'name');
+ if($orderBy == 'program_asc')
+ {
+ $products = $this->dao->select('t1.id as id, t1.name as name, t1.*, IF(INSTR(" closed", t1.status) < 2, 0, 1) AS isClosed')->from(TABLE_PRODUCT)->alias('t1')
+ ->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id')
+ ->where('t1.deleted')->eq(0)
+ ->beginIF($programID)->andWhere('t1.program')->eq($programID)->fi()
+ ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi()
+ ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->products)->fi()
+ ->orderBy('t2.order_asc, t1.line_desc, t1.order_desc')
+ ->fetchPairs('id', 'name');
+ }
+ else
+ {
+ $orderBy = !empty($this->config->product->orderBy) ? $this->config->product->orderBy : 'isClosed';
+ $products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
+ ->from(TABLE_PRODUCT)
+ ->where('deleted')->eq(0)
+ ->beginIF($programID)->andWhere('program')->eq($programID)->fi()
+ ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
+ ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
+ ->orderBy($orderBy)
+ ->fetchPairs('id', 'name');
+ }
return $products;
}
From 7e89f43e86ee627e7db648d322487161c50e243a Mon Sep 17 00:00:00 2001
From: hufangzhou <746775970@qq.com>
Date: Tue, 27 Apr 2021 16:17:49 +0800
Subject: [PATCH 12/21] * Fix bug #12226.
---
module/doc/view/editlib.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/doc/view/editlib.html.php b/module/doc/view/editlib.html.php
index 49361eb4b7..c72d7835b5 100644
--- a/module/doc/view/editlib.html.php
+++ b/module/doc/view/editlib.html.php
@@ -43,7 +43,7 @@
doclib->control;?>
- type == 'product' or $lib->type == 'execution' or ($config->systemMode == 'classic' and $lib->type != 'custom')):?>
+ type == 'product' or $lib->type == 'execution'):?>
doclib->aclListA, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'")?>
doc->noticeAcl['lib'][$lib->type][$lib->acl];?>
From df4a023a7dba48dd76e2febeaf752e08943002e5 Mon Sep 17 00:00:00 2001
From: tianshujie98
Date: Tue, 27 Apr 2021 16:55:07 +0800
Subject: [PATCH 13/21] * Fix bug #12426.
---
module/execution/model.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/module/execution/model.php b/module/execution/model.php
index c0e515b743..68f135c88c 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -73,6 +73,7 @@ class executionModel extends model
{
global $lang;
$this->loadModel('execution');
+ $this->app->loadLang('project');
$lang->executionCommon = $lang->project->stage;
include $this->app->getModulePath('execution') . 'lang/' . $this->app->getClientLang() . '.php';
}
From d3922df5a938e95bc99921ab3d233aa99aa6e242 Mon Sep 17 00:00:00 2001
From: zhujinyong
Date: Tue, 27 Apr 2021 16:56:44 +0800
Subject: [PATCH 14/21] * Recovery file upload.
---
config/config.php | 5 +++--
framework/helper.class.php | 24 ------------------------
module/caselib/control.php | 2 +-
module/extension/control.php | 3 ++-
module/file/model.php | 4 ++--
module/file/view/printfiles.html.php | 3 ++-
module/testcase/control.php | 2 +-
module/testtask/model.php | 2 +-
8 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/config/config.php b/config/config.php
index a59d0e88eb..d9430f6863 100644
--- a/config/config.php
+++ b/config/config.php
@@ -138,8 +138,9 @@ $config->features->checkClient = true;
/* 文件上传设置。 Upload settings. */
$config->file = new stdclass();
-$config->file->dangers = 'php,php3,php4,phtml,php5,jsp,py,rb,asp,aspx,ashx,asa,cer,cdx,aspl,shtm,shtml,html,htm';
-$config->file->allowed = 'txt,doc,docx,dot,wps,wri,pdf,ppt,pptx,xls,xlsx,ett,xlt,xlsm,csv,jpg,jpeg,png,psd,gif,ico,bmp,swf,avi,rmvb,rm,mp3,mp4,3gp,flv,mov,movie,rar,zip,bz,bz2,tar,gz,mpp,rp,pdm,vsdx,vsd,sql';
+$config->file->dangers = 'php,php3,php4,phtml,php5,jsp,py,rb,asp,aspx,ashx,asa,cer,cdx,aspl,shtm,shtml,html,htm';
+$config->file->allowed = 'txt,doc,docx,dot,wps,wri,pdf,ppt,pptx,xls,xlsx,ett,xlt,xlsm,csv,jpg,jpeg,png,psd,gif,ico,bmp,swf,avi,rmvb,rm,mp3,mp4,3gp,flv,mov,movie,rar,zip,bz,bz2,tar,gz,mpp,rp,pdm,vsdx,vsd,sql';
+$config->file->storageType = 'fs'; // fs or s3
/* Upload settings. */
$config->allowedTags = '