- kanban->type, $browseType, 'class="form-control chosen" data-max_drop_width="215"');?>
+ lifetime == 'ops')
+ {
+ unset($lang->kanban->type['story']);
+ unset($lang->kanban->type['bug']);
+ }
+ echo html::select('type', $lang->kanban->type, $browseType, 'class="form-control chosen" data-max_drop_width="215"');
+ ?>
@@ -49,9 +56,12 @@
$link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#';
echo "" . html::a($link, $lang->execution->importTask, '', $misc) . " ";
- $misc = common::hasPriv('execution', 'importBug') ? '' : "class=disabled";
- $link = common::hasPriv('execution', 'importBug') ? $this->createLink('execution', 'importBug', "execution=$execution->id") : '#';
- echo "" . html::a($link, $lang->execution->importBug, '', $misc) . " ";
+ if($execution->lifetime != 'ops')
+ {
+ $misc = common::hasPriv('execution', 'importBug') ? '' : "class=disabled";
+ $link = common::hasPriv('execution', 'importBug') ? $this->createLink('execution', 'importBug', "execution=$execution->id") : '#';
+ echo "" . html::a($link, $lang->execution->importBug, '', $misc) . " ";
+ }
?>
@@ -90,6 +100,7 @@
-
+ lifetime != 'ops'):?>
' . html::a(helper::createLink('story', 'create', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id", '', true), $lang->execution->createStory, '', "class='iframe'") . '';?>
' . html::a(helper::createLink('story', 'batchCreate', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id", '', true), $lang->execution->batchCreateStory, '', "class='iframe' data-width='90%'") . '';?>
' . html::a(helper::createLink('execution', 'linkStory', "execution=$execution->id", '', true), $lang->execution->linkStory, '', "class='iframe' data-width='90%'") . '';?>
@@ -103,9 +114,10 @@
echo $batchCreateBugLink;
}?>
';?>
+ ' . html::a(helper::createLink('execution', 'importBug', "execution=$execution->id", '', true), $lang->execution->importBug, '', "class='iframe'") . '';?>
+
' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '';?>
' . html::a(helper::createLink('task', 'batchCreate', "execution=$execution->id", '', true), $lang->execution->batchCreateTask, '', "class='iframe'") . '';?>
- ' . html::a(helper::createLink('execution', 'importBug', "execution=$execution->id", '', true), $lang->execution->importBug, '', "class='iframe'") . '';?>
- lifetime == 'ops')
- {
- unset($lang->kanban->type['story']);
- unset($lang->kanban->type['bug']);
- }
- echo html::select('type', $lang->kanban->type, $browseType, 'class="form-control chosen" data-max_drop_width="215"');
- ?>
+ kanban->type, $browseType, 'class="form-control chosen" data-max_drop_width="215"');?>
From c7e76c117651a8f8187041c92ddd2069757c8433 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Wed, 30 Mar 2022 13:05:59 +0800
Subject: [PATCH 08/26] * Fix bug #18270.
---
module/execution/model.php | 8 +-------
module/execution/view/edit.html.php | 4 ++--
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/module/execution/model.php b/module/execution/model.php
index 6c94f5653f..9ea9d26e07 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -460,13 +460,7 @@ class executionModel extends model
dao::$errors['days'] = sprintf($this->lang->project->workdaysExceed, $workdays);
return false;
}
- $products = array_filter($this->post->products);
- $noLinkTip = $oldExecution->type != 'kanban' ? $this->lang->execution->noLinkProduct : $this->lang->execution->kanbanNoLinkProduct;
- if(empty($products))
- {
- dao::$errors['message'][] = $noLinkTip;
- return false;
- }
+
/* Get the data from the post. */
$execution = fixer::input('post')
->setDefault('lastEditedBy', $this->app->user->account)
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php
index aba139060f..56ead0a3f4 100644
--- a/module/execution/view/edit.html.php
+++ b/module/execution/view/edit.html.php
@@ -141,7 +141,7 @@
type != 'normal' and isset($branchGroups[$product->id]);?>
id] as $branchID => $branch):?>
-
">
+
id, "class='form-control chosen' $class onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='". $product->type ."'");?>
id], $branchID, "class='form-control chosen' $class onchange=\"loadPlans('#products{$i}', this.value)\" data-last='" . $branchID . "'");?>
@@ -159,7 +159,7 @@
From c86e39c093cf0ea04f2073c71a245223a722cf3c Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Wed, 30 Mar 2022 14:26:24 +0800
Subject: [PATCH 09/26] * Fix bug #18002 #19684.
---
module/execution/control.php | 5 +++++
module/kanban/model.php | 3 +++
2 files changed, 8 insertions(+)
diff --git a/module/execution/control.php b/module/execution/control.php
index c8b48d451b..defae0bac5 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2158,6 +2158,11 @@ class execution extends control
unset($this->lang->kanban->type['all']);
}
+ if($execution->type == 'stage' and $execution->attribute != 'dev')
+ {
+ unset($this->lang->kanban->type['task']);
+ }
+
$kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy);
if(empty($kanbanGroup))
{
diff --git a/module/kanban/model.php b/module/kanban/model.php
index 3646c208db..01357a147d 100644
--- a/module/kanban/model.php
+++ b/module/kanban/model.php
@@ -1316,12 +1316,15 @@ class kanbanModel extends model
*/
public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default')
{
+ $execution = $this->loadModel('execution')->getById($executionID);
+
if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy);
$lanes = $this->dao->select('*')->from(TABLE_KANBANLANE)
->where('execution')->eq($executionID)
->andWhere('deleted')->eq(0)
->beginIF($browseType != 'all')->andWhere('type')->eq($browseType)->fi()
+ ->beginIF($execution->type == 'stage' and $execution->attribute != 'dev')->andWhere('type')->ne('task')->fi()
->orderBy('order_asc')
->fetchAll('id');
From df1dc3dd9ba9a1f59197e4e890850513e91d96c2 Mon Sep 17 00:00:00 2001
From: Zongjun Lan
Date: Wed, 30 Mar 2022 16:51:14 +0800
Subject: [PATCH 10/26] * fix bug #20165
---
module/product/view/project.html.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php
index 3abaf6ad66..ff9bed560a 100644
--- a/module/product/view/project.html.php
+++ b/module/product/view/project.html.php
@@ -16,7 +16,8 @@
{$label}" . ($status == $key ? " " . count($projectStats) . "" : ''), '', "class='btn btn-link" . ($status == $key ? ' btn-active-text' : '') . "' id='{$key}Tab'");?>
$lang->project->mine), '', $this->cookie->involved ? 'checked=checked' : '');?>
- product->projectInfo;?>>
+
+
systemMode == 'new' and $branchStatus != 'closed'):?>
-
+
From 74d2ed5ea6b47a57959e44ce9e1d3b7ae8c2c285 Mon Sep 17 00:00:00 2001
From: liyuchun
Date: Wed, 30 Mar 2022 17:01:15 +0800
Subject: [PATCH 11/26] * Fix bug #11348.
---
module/task/model.php | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/module/task/model.php b/module/task/model.php
index f524c69262..e9f1066081 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -35,6 +35,30 @@ class taskModel extends model
if($this->post->selectTestStory)
{
+ /* Check required fields when create test task. */
+ foreach($this->post->testStory as $i => $storyID)
+ {
+ if(empty($storyID)) continue;
+
+ $task = new stdclass();
+ $task->pri = $this->post->testPri[$i];
+ $task->estStarted = $this->post->testEstStarted[$i];
+ $task->deadline = $this->post->testDeadline[$i];
+ $task->assignedTo = $this->post->testAssignedTo[$i];
+ $task->estimate = $this->post->testEstimate[$i];
+ $task->left = $this->post->testEstimate[$i];
+
+ $this->dao->insert(TABLE_TASK)->data($task)->batchCheck($requiredFields, 'notempty');
+ if(dao::isError())
+ {
+ foreach(dao::getError() as $field => $error)
+ {
+ dao::$errors[] = $error;
+ return false;
+ }
+ }
+ }
+
$requiredFields = str_replace(",estimate,", ',', "$requiredFields");
$requiredFields = str_replace(",story,", ',', "$requiredFields");
$requiredFields = str_replace(",estStarted,", ',', "$requiredFields");
From 33629b518346e100a9e3c41cde4ad904645b8698 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Wed, 30 Mar 2022 17:21:42 +0800
Subject: [PATCH 12/26] * Fix bug #18744.
---
module/kanban/view/createexeclane.html.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/kanban/view/createexeclane.html.php b/module/kanban/view/createexeclane.html.php
index 60fa0886e3..075603d023 100644
--- a/module/kanban/view/createexeclane.html.php
+++ b/module/kanban/view/createexeclane.html.php
@@ -38,7 +38,7 @@
kanbanlane->WIPType;?>
- kanban->laneTypeList, 'story');?>
+ kanban->laneTypeList, 'story');?>
kanbanlane->column;?>
From 0983c30e8dabd798d146e8fa445323d41d743376 Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 30 Mar 2022 17:26:17 +0800
Subject: [PATCH 13/26] * Fix bug#18083.
---
module/task/control.php | 2 +-
module/task/lang/en.php | 2 +-
module/task/lang/zh-cn.php | 2 +-
module/task/model.php | 37 ++++++++++++++++++++++++-------------
4 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/module/task/control.php b/module/task/control.php
index f869833fb1..d9711ecb04 100644
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -562,7 +562,7 @@ class task extends control
if($this->post->names)
{
$allChanges = $this->task->batchUpdate();
- if(dao::isError()) return print(js::error(dao::getError()));
+ if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(!empty($allChanges))
{
diff --git a/module/task/lang/en.php b/module/task/lang/en.php
index 3a1c97a3f9..4c7464d2d1 100644
--- a/module/task/lang/en.php
+++ b/module/task/lang/en.php
@@ -247,7 +247,7 @@ $lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Start
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
$lang->task->error->date = 'The date should be >= today.';
$lang->task->error->leftEmpty = 'When the task status is %s, "Hours Left" cannot be 0';
-$lang->task->error->leftEmptyAB = 'task#%sWhen the task status is %s, "Hours Left" cannot be 0';
+$lang->task->error->leftEmptyAB = 'task#%sWhen the task status is %s, "Left" cannot be 0';
/* Report. */
$lang->task->report = new stdclass();
diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php
index d8234cc45f..b289c2171b 100644
--- a/module/task/lang/zh-cn.php
+++ b/module/task/lang/zh-cn.php
@@ -247,7 +247,7 @@ $lang->task->error->finishedDateSmall = '实际完成不能小于实际开始';
$lang->task->error->alreadyConsumed = '当前选中的父任务已有消耗。';
$lang->task->error->date = '日期不能大于今天';
$lang->task->error->leftEmpty = '任务状态为%s时,预计剩余不能为0';
-$lang->task->error->leftEmptyAB = 'task#%s任务状态为%s时,预计剩余不能为0';
+$lang->task->error->leftEmptyAB = 'task#%s任务状态为%s时,剩余不能为0';
/* Report. */
$lang->task->report = new stdclass();
diff --git a/module/task/model.php b/module/task/model.php
index 7416b93276..4ffc3f2522 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -998,7 +998,7 @@ class taskModel extends model
$requiredFields = str_replace(',estimate,', ',', $requiredFields);
}
- if(strpos(',done,wait,cancel,closed,', $task->status) === false && empty($teams) && $task->left == 0)
+ if(strpos(',done,wait,cancel,closed,', $task->status) === false && empty($teams) && empty($task->left))
{
dao::$errors[] = sprintf($this->lang->task->error->leftEmpty, $this->lang->task->statusList[$task->status]);
return false;
@@ -1118,7 +1118,6 @@ class taskModel extends model
{
if(isset($data->modules[$taskID]) and ($data->modules[$taskID] == 'ditto')) $data->modules[$taskID] = isset($prev['module']) ? $prev['module'] : 0;
if($data->types[$taskID] == 'ditto') $data->types[$taskID] = isset($prev['type']) ? $prev['type'] : '';
- if($data->statuses[$taskID] == 'ditto') $data->statuses[$taskID] = isset($prev['status']) ? $prev['status'] : '';
if($data->assignedTos[$taskID] == 'ditto') $data->assignedTos[$taskID] = isset($prev['assignedTo']) ? $prev['assignedTo'] : '';
if($data->pris[$taskID] == 'ditto') $data->pris[$taskID] = isset($prev['pri']) ? $prev['pri'] : 0;
if($data->finishedBys[$taskID] == 'ditto') $data->finishedBys[$taskID] = isset($prev['finishedBy']) ? $prev['finishedBy'] : '';
@@ -1129,7 +1128,6 @@ class taskModel extends model
$prev['module'] = $data->modules[$taskID];
$prev['type'] = $data->types[$taskID];
- $prev['status'] = $data->statuses[$taskID];
$prev['assignedTo'] = $data->assignedTos[$taskID];
$prev['pri'] = $data->pris[$taskID];
$prev['finishedBy'] = $data->finishedBys[$taskID];
@@ -1150,7 +1148,7 @@ class taskModel extends model
$task->name = $data->names[$taskID];
$task->module = isset($data->modules[$taskID]) ? $data->modules[$taskID] : 0;
$task->type = $data->types[$taskID];
- $task->status = $data->statuses[$taskID];
+ $task->status = isset($data->statuses[$taskID]) ? $data->statuses[$taskID] : $oldTask->status;
$task->assignedTo = $task->status == 'closed' ? 'closed' : $data->assignedTos[$taskID];
$task->pri = $data->pris[$taskID];
$task->estimate = isset($data->estimates[$taskID]) ? $data->estimates[$taskID] : $oldTask->estimate;
@@ -1185,11 +1183,12 @@ class taskModel extends model
if($message) return print(js::alert($message));
}
- if($data->consumeds[$taskID])
+ if(isset($data->consumeds[$taskID]))
{
if($data->consumeds[$taskID] < 0)
{
- echo js::alert(sprintf($this->lang->task->error->consumed, $taskID));
+ dao::$errors[] = sprintf($this->lang->task->error->consumed, $taskID);
+ return false;
}
else
{
@@ -1261,9 +1260,19 @@ class taskModel extends model
/* Check field not empty. */
foreach($tasks as $taskID => $task)
{
- if($task->status == 'done' and $task->consumed == false) return print(js::error('task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime)));
if($task->status == 'cancel') continue;
- if(!empty($task->deadline) and $task->estStarted > $task->deadline) return print(js::error('task#' . $taskID . $this->lang->task->error->deadlineSmall));
+ if($task->status == 'done' and $task->consumed == false)
+ {
+ dao::$errors[] = 'task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime);
+ return false;
+ }
+
+ if(!empty($task->deadline) and $task->estStarted > $task->deadline)
+ {
+ dao::$errors[] = 'task#' . $taskID . $this->lang->task->error->deadlineSmall;
+ return false;
+ }
+
foreach(explode(',', $this->config->task->edit->requiredFields) as $field)
{
$field = trim($field);
@@ -1280,11 +1289,12 @@ class taskModel extends model
foreach($tasks as $taskID => $task)
{
- if(strpos(',done,wait,cancel,closed,', $task->status) === false && empty($teams) && $task->parent > 0 && $task->consumed != 0)
+ if(strpos(',done,wait,cancel,closed,', $task->status) === false && empty($teams) && $task->parent >= 0 && empty($task->left))
{
dao::$errors[] = sprintf($this->lang->task->error->leftEmptyAB, $taskID, $this->lang->task->statusList[$task->status]);
return false;
}
+
$oldTask = $oldTasks[$taskID];
$this->dao->update(TABLE_TASK)->data($task)
->autoCheck()
@@ -1303,6 +1313,11 @@ class taskModel extends model
->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty')
->where('id')->eq((int)$taskID)
->exec();
+ if(dao::isError())
+ {
+ dao::$errors[] = 'task#' . $taskID . dao::getError(true);
+ return false;
+ }
if($task->status == 'done' and $task->closedReason) $this->dao->update(TABLE_TASK)->set('status')->eq('closed')->where('id')->eq($taskID)->exec();
@@ -1333,10 +1348,6 @@ class taskModel extends model
if($task->status != $oldTask->status) $this->loadModel('kanban')->updateLane($oldTask->execution, 'task', $oldTask->id);
$allChanges[$taskID] = common::createChanges($oldTask, $task);
}
- else
- {
- return print(js::error('task#' . $taskID . dao::getError(true)));
- }
}
if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchEdit');
return $allChanges;
From b2ade4c3d72ff430aa6936627de324618946c626 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Wed, 30 Mar 2022 17:30:37 +0800
Subject: [PATCH 14/26] * Fix bug #18744 #18763.
---
module/kanban/css/createlane.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/kanban/css/createlane.css b/module/kanban/css/createlane.css
index b133c07fa7..aebe98433b 100644
--- a/module/kanban/css/createlane.css
+++ b/module/kanban/css/createlane.css
@@ -1 +1 @@
-.table-form>tbody>tr>th {width: 150px;}
+.table-form>tbody>tr>th {width: 160px;}
From af7f9bd8e3a74f6f127de683a5335aa58c0af4e6 Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 30 Mar 2022 20:22:17 +0800
Subject: [PATCH 15/26] * Fix bug#18270.
---
module/execution/control.php | 7 -------
1 file changed, 7 deletions(-)
diff --git a/module/execution/control.php b/module/execution/control.php
index d4ef2cbb54..5d47dfe10f 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2549,13 +2549,6 @@ class execution extends control
if(!empty($_POST))
{
- /* Get executionType and determine whether a product is linked with the stage. */
- $executionType = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch('type');
- if($executionType == 'stage')
- {
- if(!isset($_POST['products'])) return print(js::alert($this->lang->execution->noLinkProduct) . js::locate($this->createLink('execution', 'manageProducts', "executionID=$executionID&from=$from")));
- }
-
$oldProducts = $this->product->getProducts($executionID);
if($from == 'buildCreate' && $this->session->buildCreate) $browseExecutionLink = $this->session->buildCreate;
From 79d9664263673a318e1e1efa8b1ac9deb9f9138e Mon Sep 17 00:00:00 2001
From: xieqiyu
Date: Wed, 30 Mar 2022 20:48:33 +0800
Subject: [PATCH 16/26] * Fix bug#18002.
---
module/execution/control.php | 9 +++------
module/execution/view/task.html.php | 1 +
module/kanban/model.php | 3 +--
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/module/execution/control.php b/module/execution/control.php
index defae0bac5..1ba865bf66 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2131,7 +2131,6 @@ class execution extends control
*/
public function taskKanban($executionID, $browseType = '', $orderBy = 'order_asc', $groupBy = '')
{
- $execution = $this->loadModel('execution')->getById($executionID);
if(empty($browseType)) $browseType = $this->session->kanbanType ? $this->session->kanbanType : 'all';
if(empty($groupBy)) $groupBy = 'default';
@@ -2150,6 +2149,8 @@ class execution extends control
/* Compatibility IE8. */
if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7");
+ $this->execution->setMenu($executionID);
+ $execution = $this->execution->getById($executionID);
if($execution->lifetime == 'ops')
{
$browseType = 'task';
@@ -2157,8 +2158,7 @@ class execution extends control
unset($this->lang->kanban->type['bug']);
unset($this->lang->kanban->type['all']);
}
-
- if($execution->type == 'stage' and $execution->attribute != 'dev')
+ elseif($execution->type == 'stage' and $execution->attribute != 'dev')
{
unset($this->lang->kanban->type['task']);
}
@@ -2170,9 +2170,6 @@ class execution extends control
$kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy);
}
- $this->execution->setMenu($executionID);
- $execution = $this->loadModel('execution')->getById($executionID);
-
/* Determines whether an object is editable. */
$canBeChanged = common::canModify('execution', $execution);
diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php
index bf0aa62c49..dbfdadd784 100644
--- a/module/execution/view/task.html.php
+++ b/module/execution/view/task.html.php
@@ -132,6 +132,7 @@ body {margin-bottom: 25px;}
$misc = common::hasPriv('execution', 'importTask') ? "class='import'" : "class=disabled";
$link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#';
echo "" . html::a($link, $lang->execution->importTask, '', $misc) . " ";
+
if($execution->lifetime != 'ops')
{
$class = common::hasPriv('execution', 'importBug') ? '' : "class=disabled";
diff --git a/module/kanban/model.php b/module/kanban/model.php
index 01357a147d..746b3638ec 100644
--- a/module/kanban/model.php
+++ b/module/kanban/model.php
@@ -1316,10 +1316,9 @@ class kanbanModel extends model
*/
public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default')
{
- $execution = $this->loadModel('execution')->getById($executionID);
-
if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy);
+ $execution = $this->loadModel('execution')->getById($executionID);
$lanes = $this->dao->select('*')->from(TABLE_KANBANLANE)
->where('execution')->eq($executionID)
->andWhere('deleted')->eq(0)
From 1b4441e5463c61ad5549609f31de706e6909a80d Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Thu, 31 Mar 2022 08:55:14 +0800
Subject: [PATCH 17/26] * Fix bug #18744.
---
module/kanban/css/createlane.css | 1 -
module/kanban/view/createexeclane.html.php | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
delete mode 100644 module/kanban/css/createlane.css
diff --git a/module/kanban/css/createlane.css b/module/kanban/css/createlane.css
deleted file mode 100644
index aebe98433b..0000000000
--- a/module/kanban/css/createlane.css
+++ /dev/null
@@ -1 +0,0 @@
-.table-form>tbody>tr>th {width: 160px;}
diff --git a/module/kanban/view/createexeclane.html.php b/module/kanban/view/createexeclane.html.php
index 075603d023..b5b161456d 100644
--- a/module/kanban/view/createexeclane.html.php
+++ b/module/kanban/view/createexeclane.html.php
@@ -16,7 +16,7 @@
From 3e49aee5dc20bae62acb16130f560ae4c19a8048 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Thu, 31 Mar 2022 08:59:04 +0800
Subject: [PATCH 18/26] * Fix bug #18744.
---
module/kanban/css/createlane.css | 1 +
1 file changed, 1 insertion(+)
create mode 100644 module/kanban/css/createlane.css
diff --git a/module/kanban/css/createlane.css b/module/kanban/css/createlane.css
new file mode 100644
index 0000000000..aebe98433b
--- /dev/null
+++ b/module/kanban/css/createlane.css
@@ -0,0 +1 @@
+.table-form>tbody>tr>th {width: 160px;}
From 62a286da2b74dc7a0a1c2482a463fc8b8f0c69c2 Mon Sep 17 00:00:00 2001
From: qateam
Date: Thu, 31 Mar 2022 09:46:12 +0800
Subject: [PATCH 19/26] add productplan unittest
---
test/class/productplan.class.php | 253 +++++++++++++++---
test/model/productplan/batchchangestatus.php | 38 ++-
test/model/productplan/batchupdate.php | 27 +-
test/model/productplan/changeparentfield.php | 25 ++
test/model/productplan/create.php | 35 ++-
test/model/productplan/getbranchplanpairs.php | 16 +-
test/model/productplan/getbyidlist.php | 15 +-
test/model/productplan/getchildren.php | 16 +-
test/model/productplan/getforproducts.php | 19 +-
test/model/productplan/getgroupbyproduct.php | 17 +-
test/model/productplan/getlast.php | 14 +-
test/model/productplan/getlist.php | 15 +-
test/model/productplan/getpairs.php | 20 +-
test/model/productplan/getpairsforstory.php | 17 +-
test/model/productplan/getplansbystories.php | 14 +-
test/model/productplan/isclickable.php | 38 +++
test/model/productplan/linkbug.php | 43 +++
test/model/productplan/linkproject.php | 19 ++
test/model/productplan/linkstory.php | 46 ++++
test/model/productplan/reorderchildren.php | 29 ++
test/model/productplan/unlinkstory.php | 8 +
test/model/productplan/update.php | 18 +-
test/model/productplan/updateparentstatus.php | 17 +-
test/model/productplan/updatestatus.php | 14 +-
24 files changed, 690 insertions(+), 83 deletions(-)
create mode 100755 test/model/productplan/changeparentfield.php
create mode 100755 test/model/productplan/isclickable.php
create mode 100755 test/model/productplan/linkbug.php
create mode 100755 test/model/productplan/linkproject.php
create mode 100755 test/model/productplan/linkstory.php
create mode 100755 test/model/productplan/reorderchildren.php
create mode 100755 test/model/productplan/unlinkstory.php
diff --git a/test/class/productplan.class.php b/test/class/productplan.class.php
index 62dd1ef05f..4b98b90534 100644
--- a/test/class/productplan.class.php
+++ b/test/class/productplan.class.php
@@ -9,49 +9,52 @@ class productPlan
}
/**
- * getByIDPlan
+ * Get by ID plan
*
* @param int mixed $planID
* @param bool mixed $setImgSize
* @access public
- * @return void
+ * @return array
*/
public function getByIDPlan($planID, $setImgSize = false)
{
$productplans = $this->productplan->getByID($planID, $setImgSize = false);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * getByIDList
+ * Get by ID list
*
* @param array(int) mixed $planIDList
* @access public
- * @return void
+ * @return array
*/
public function getByIDList($planIDList)
{
$productplans = $this->productplan->getByIDList($planIDList);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * getLast
+ * Get last
*
* @param int mixed $productID
* @param int $branch
* @param int $parent
* @access public
- * @return void
+ * @return array
*/
public function getLast($productID, $branch = 0, $parent = 0)
{
- $productplans = $this->productplan->getLast($productID, $branch = 0, $parent = 0);
+ $productplans = $this->productplan->getLast($productID, $parent);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * getList
+ * Get list
*
* @param int $product
* @param int $branch
@@ -60,118 +63,130 @@ class productPlan
* @param string $orderBy
* @param string $param
* @access public
- * @return void
+ * @return array
*/
public function getList($product, $branch, $browseType, $pager, $orderBy, $param)
{
$productplans = $this->productplan->getList($product, $branch, $browseType, $pager, $orderBy, $param);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * getPairs
+ * Get pairs
*
* @param int $product
* @param string $branch
* @param string $expired
- * @param mixed $skipParent
+ * @param bool mixed $skipParent
* @access public
- * @return void
+ * @return array
*/
public function getPairs($product, $branch = '', $expired = '', $skipParent = false)
{
$productplans = $this->productplan->getPairs($product, $branch = '', $expired = '', $skipParent = false);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * getPairsForStory
+ * Get pairs for story
*
* @param mrray|int mixed $product
* @param int mixed $branch
* @param string mixed $param
* @access public
- * @return void
+ * @return count
*/
public function getPairsForStory($product, $branch, $param)
{
$productplans = $this->productplan->getPairsForStory($product, $branch, $param);
+ if(dao::isError()) return dao::getError();
return count($productplans) - 1;
}
/**
- * getForProducts
+ * Get for products
*
* @param array(int) mixed $products
* @access public
- * @return void
+ * @return count
*/
public function getForProducts($products)
{
$productplans = $this->productplan->getForProducts($products);
- return count($productplans) - 1;
+ if(dao::isError()) return dao::getError();
+ return $productplans;
}
/**
- * getGroupByProduct
+ * Get group by product
*
* @param array(int) mixed $products
* @param string mixed $param
* @param string $field
* @param string $orderBy
* @access public
- * @return void
+ * @return count
*/
public function getGroupByProduct($products, $param, $field = 'name', $orderBy = 'id_desc')
{
$productplans = $this->productplan->getGroupByProduct($products, $param, $field, $orderBy);
+ if(dao::isError()) return dao::getError();
return count($productplans);
}
/**
- * getChildren
+ * Get children
*
* @param int mixed $planID
* @access public
- * @return void
+ * @return count
*/
public function getChildren($planID)
{
$productplans = $this->productplan->getChildren($planID);
+ if(dao::isError()) return dao::getError();
return count($productplans);
}
/**
- * getPlansByStories
+ * Get plans by stories
*
* @param array(int) mixed $storyIdList
* @access public
- * @return void
+ * @return count
*/
public function getPlansByStories($storyIdList)
{
$productplans = $this->productplan->getPlansByStories($storyIdList);
+ if(dao::isError()) return dao::getError();
return count($productplans);
}
/**
- * getBranchPlanPairs
+ * Get branch plan pairs
*
* @param int mixed $productID
* @param int mixed $branches
* @access public
- * @return void
+ * @return array
*/
public function getBranchPlanPairs($productID, $branches)
{
$productplans = $this->productplan->getBranchPlanPairs($productID, $branches);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * @param array
+ * Create
+ *
+ * @param array mixed $param
+ * @access public
+ * @return array
*/
- public function create($param) //声明一个create方法
+ public function create($param)
{
//初始化传的参数,这里可以设置默认值
$createPlan = array('title' => '', 'begin' => '', 'end' => '', 'delta' => '', 'desc' => '', 'uid' => '', 'product' => '', 'parent' => '');
@@ -182,16 +197,17 @@ class productPlan
//这行代码的作用是调用源码中的方法(参数通过$_POST直接取,具体原理可以不知道)
$productPlans = $this->productplan->create();
//将方法返回内容返回
+ if(dao::isError()) return dao::getError();
return $productPlans;
}
/**
- * update
+ * Update
*
* @param int mixed $planID
* @param array mixed $values
* @access public
- * @return void
+ * @return array
*/
public function update($planID, $values)
{
@@ -201,44 +217,46 @@ class productPlan
foreach($values as $key =>$value) $_POST[$key] = $value;
$productplans = $this->productplan->update($planID);
-
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * updateStatus
+ * Update status
*
* @param int mixed $planID
* @param string $status
* @param string $action
* @access public
- * @return void
+ * @return array
*/
public function updateStatus($planID, $status = '', $action = '')
{
$productplans = $this->productplan->updateStatus($planID, $status, $action);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * updateParentStatus
+ * Update parent status
*
* @param int mixed $parentId
* @access public
- * @return void
+ * @return bool
*/
public function updateParentStatus($parentId)
{
$productplans = $this->productplan->updateParentStatus($parentId);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
/**
- * batchUpdate
+ * Batch update
*
* @param int mixed $productId
* @access public
- * @return void
+ * @return array(array)
*/
public function batchUpdate($productId, $bratch)
{
@@ -248,17 +266,172 @@ class productPlan
foreach($bratch as $key => $value) $_POST[$key] = $value;
$productplans = $this->productplan->batchUpdate($productId);
+ if(dao::isError()) return dao::getError();
return $productplans;
}
- public function batchChangeStatus($status)
+ /**
+ * Batch change status
+ *
+ * @param string mixed $status
+ * @access public
+ * @return array
+ */
+ public function batchChangeStatus($status, $planIDList = array('planIDList' => array(4, 5)))
{
- $posts = array(6, 5, 4);
+ $planID = $planIDList;
- foreach($posts as $field => $defaultvalue) $_POST[$field] = $defaultvalue;
- //foreach($param as $key => $value) $_POST[$key] = $valuep;
+ foreach($planID as $field => $defaultvalue) $_POST[$field] = $defaultvalue;
$productplans = $this->productplan->batchChangeStatus($status);
+ if(dao::isError()) return dao::getError();
+ return $productplans;
+ }
+
+ /**
+ * Change parent field
+ *
+ * @param int mixed $planID
+ * @access public
+ * @return true
+ */
+ public function changeParentField($planID)
+ {
+ $productplans = $this->productplan->changeParentField($planID);
+ if(dao::isError()) return dao::getError();
+ return $productplans;
+ }
+
+ /**
+ * Link story
+ *
+ * @param int mixed $planID
+ * @param array(stories => array())mixed $storyID
+ * @access public
+ * @return void
+ */
+ public function linkStory($planID, $storyID)
+ {
+
+ foreach($storyID as $key => $value) $_POST[$key] = $value;
+
+ $productplans = $this->productplan->linkStory($planID);
+
+ if(dao::isError()) return dao::getError();
+ return $productplans;
+ }
+
+ /**
+ * Unlink story
+ *
+ * @param int mixed $storyID
+ * @param int mixed $planID
+ * @access public
+ * @return void
+ */
+ public function unlinkStory($storyID, $planID)
+ {
+ $productPlans = $this->productplan->unlinkStory($storyID, $planID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $productPlans;
+ }
+
+ /**
+ * Link bug
+ *
+ * @param int mixed $planID
+ * @param array mixed $bugID
+ * @access public
+ * @return void
+ */
+ public function linkBug($planID, $bugID)
+ {
+
+ foreach($bugID as $key => $value) $_POST[$key] = $value;
+
+ $productPlans = $this->productplan->linkBug($planID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $productPlans;
+ }
+
+ /**
+ * Unlink bug
+ *
+ * @param int mixed $bugID
+ * @access public
+ * @return void
+ */
+ public function unlinkBug($bugID)
+ {
+ $productplans = $this->productplan->unlinkBug($bugID);
+
+ if(dao::isError()) return dao::getError();
+
+ return $productplans;
+ }
+
+ /**
+ * Link project
+ *
+ * @param $projectID mixed $projectID
+ * @param $newPlans mixed $newPlans
+ * @access public
+ * @return void
+ */
+ public function linkProject($projectID, $newPlans)
+ {
+ $productplans = $this->productplan->linkProject($projectID, $newPlans);
+
+ if(dao::isError()) return dao::getError();
+
+ return $productplans;
+ }
+
+ /**
+ * Reorder 4 children
+ *
+ * @param array mixed $plans
+ * @access public
+ * @return array
+ */
+ public function reorder4Children($plans)
+ {
+ $plan = $this->productplan->dao->select('*')->from(TABLE_PRODUCTPLAN)
+ ->where('id')->in($plans)
+ ->andWhere('deleted')->eq(0)
+ ->fetchAll('id');
+
+ $productplans = $this->productplan->reorder4Children($plan);
+
+ if(dao::isError()) return dao::getError();
+
+ return $productplans;
+ }
+
+ /**
+ * Is clickable
+ *
+ * @param int mixed $planID
+ * @param string mixed $action
+ * @access public
+ * @return void
+ */
+ public function isClickable($planID, $action)
+ {
+ $plan = $this->productplan->dao->select('*')->from(TABLE_PRODUCTPLAN)
+ ->where('id')->eq($planID)
+ ->andWhere('deleted')->eq(0)
+ ->fetchAll('id');
+
+ $plans = $plan[$planID];
+ $productplans = $this->productplan->isClickable($plans, $action);
+
+ if(dao::isError()) return dao::getError();
+
return $productplans;
}
diff --git a/test/model/productplan/batchchangestatus.php b/test/model/productplan/batchchangestatus.php
index 6061f57b51..3d03dc2808 100755
--- a/test/model/productplan/batchchangestatus.php
+++ b/test/model/productplan/batchchangestatus.php
@@ -3,7 +3,41 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->batchChangeStatus();
+cid=1
+pid=1
+
+将planiID=4,5的计划状态修改为doing,打印4旧状态 >> wait
+将planiID=4, 5的计划状态修改为doing,打印4新状态 >> doing
+将planiID=4, 5的计划状态修改为doing,打印5旧状态 >> wait
+将planiID=4, 5的计划状态修改为doing,打印5新状态 >> doing
+将planiID=4, 5的计划状态修改回wait, 打印4的当前状态 >> doing
+将planiID=4, 5的计划状态修改回wait, 打印4的修改后的状态 >> wait
+将planiID=4, 5的计划状态修改回wait, 打印5的当前状态 >> doing
+将planiID=4, 5的计划状态修改回wait, 打印5的修改后的状态 >> wait
+
+*/
$plan = new productPlan('admin');
-var_dump($plan->batchChangeStatus(2));die;
-?>
+$postID = array('planIDList' => array(4, 5));
+
+$status = $plan->batchChangeStatus('doing', $postID);
+$status4 = $status[4];
+$status5 = $status[5];
+
+$status = $plan->batchChangeStatus('wait', $postID);
+$status6 = $status[4];
+$status7 = $status[5];
+
+r($status4) && p('0:old') && e('wait'); //将planiID=4,5的计划状态修改为doing,打印4旧状态
+r($status4) && p('0:new') && e('doing'); //将planiID=4, 5的计划状态修改为doing,打印4新状态
+r($status5) && p('0:old') && e('wait'); //将planiID=4, 5的计划状态修改为doing,打印5旧状态
+r($status5) && p('0:new') && e('doing'); //将planiID=4, 5的计划状态修改为doing,打印5新状态
+r($status6) && p('0:old') && e('doing'); //将planiID=4, 5的计划状态修改回wait, 打印4的当前状态
+r($status6) && p('0:new') && e('wait'); //将planiID=4, 5的计划状态修改回wait, 打印4的修改后的状态
+r($status7) && p('0:old') && e('doing'); //将planiID=4, 5的计划状态修改回wait, 打印5的当前状态
+r($status6) && p('0:new') && e('wait'); //将planiID=4, 5的计划状态修改回wait, 打印5的修改后的状态
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/batchupdate.php b/test/model/productplan/batchupdate.php
index d58d53da05..a28ede7e26 100755
--- a/test/model/productplan/batchupdate.php
+++ b/test/model/productplan/batchupdate.php
@@ -3,6 +3,20 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->batchUpdate();
+cid=1
+pid=1
+
+当product=1时,传入正常参数批量修改id=1,2,3的计划,打印id=1修改后的名字new >> list-1
+当product=1时,传入正常参数批量修改id=1,2,3的计划,打印id=2修改后的名字new >> list-2
+当product=1时,传入正常参数批量修改id=1,2,3的计划,打印id=3修改后的名字new >> list-3
+当product=2时,传入正常参数批量修改id=4,5,6的计划,打印id=4修改后的名字new >> list-4
+当product=2时,传入正常参数批量修改id=4,5,6的计划,打印id=5修改后的名字new >> list-5
+当product=2时,传入正常参数批量修改id=4,5,6的计划,打印id=6修改后的名字new >> list-6
+
+*/
$plan = new productPlan('admin');
$product = array();
@@ -30,11 +44,10 @@ $begin1[2] = '2021-04-12';
$begin1[3] = '2021-04-01';
$end1 = $end;
-$end1[1] = '2021-10-31';
+$end1[1] = '2021-11-30';
$end1[2] = '2021-10-25';
$end1[3] = '2021-10-23';
-
$id2 = $id;
$id2[4] = 4;
$id2[5] = 5;
@@ -51,9 +64,9 @@ $begin2[5] = '2021-06-12';
$begin2[4] = '2021-06-01';
$end2 = $end;
-$end2[6] = '2021-10-31';
-$end2[5] = '2021-10-25';
-$end2[4] = '2021-10-23';
+$end2[6] = '2021-11-30';
+$end2[5] = '2021-11-28';
+$end2[4] = '2021-11-23';
$branch1 = array();
$branch1['id'] = $id1;
@@ -68,6 +81,7 @@ $branch2['begin'] = $begin2;
$branch2['end'] = $end2;
$batchUpdate = $plan->batchUpdate($product[0], $branch1);
+
$batchUpdate1 = $batchUpdate[1];
$batchUpdate2 = $batchUpdate[2];
$batchUpdate3 = $batchUpdate[3];
@@ -83,4 +97,5 @@ r($batchUpdate3) && p('0:new') && e('list-3'); //当product=1时,传入正常参
r($batchUpdate4) && p('0:new') && e('list-4'); //当product=2时,传入正常参数批量修改id=4,5,6的计划,打印id=4修改后的名字new
r($batchUpdate5) && p('0:new') && e('list-5'); //当product=2时,传入正常参数批量修改id=4,5,6的计划,打印id=5修改后的名字new
r($batchUpdate6) && p('0:new') && e('list-6'); //当product=2时,传入正常参数批量修改id=4,5,6的计划,打印id=6修改后的名字new
-?>
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/changeparentfield.php b/test/model/productplan/changeparentfield.php
new file mode 100755
index 0000000000..a73eb55b9e
--- /dev/null
+++ b/test/model/productplan/changeparentfield.php
@@ -0,0 +1,25 @@
+#!/usr/bin/env php
+changeParentField();
+cid=1
+pid=1
+
+传入ID为1的情况,返回true >> 1
+传入ID为5的情况,返回true,如不存在函数会报错 >> 1
+
+*/
+
+$plan = new productPlan('admin');
+
+$planID = array();
+$planID[0] = 1;
+$planID[1] = 5;
+
+r($plan->changeParentField($planID[0])) && p() && e('1'); //传入ID为1的情况,返回true
+r($plan->changeParentField($planID[1])) && p() && e('1'); //传入ID为5的情况,返回true,如不存在函数会报错
+?>
\ No newline at end of file
diff --git a/test/model/productplan/create.php b/test/model/productplan/create.php
index f1ade46873..eeef6ea9f0 100755
--- a/test/model/productplan/create.php
+++ b/test/model/productplan/create.php
@@ -3,6 +3,22 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->create();
+cid=1
+pid=1
+
+测试正常创建 >> 110
+测试不传入名称的情况 >> 『名称』不能为空。
+测试不传开始时间的情况 >> 111
+测试不传结束时间的情况 >> 112
+测试不传开始时间及结束时间的情况 >> 113
+测试不传UID的情况 >> 114
+测试不传关联产品的情况 >> 『产品』应当是数字。
+测试不传父级计划的情况 >> 『父计划』应当是数字。
+
+*/
$plan = new productPlan('admin');
$posts = array();
@@ -34,12 +50,13 @@ $noProduct['product'] = '';
$noParent = $posts;
$noParent['parent'] = '';
-r($plan->create($posts)) && p() && e('71'); //测试正常创建
-r($plan->create($noTitle)) && p() && e('0'); //测试不传入名称的情况
-r($plan->create($noBegin)) && p() && e('0'); //测试不传开始时间的情况
-r($plan->create($noEnd)) && p() && e('0'); //测试不传结束时间的情况
-r($plan->create($noBeginEnd)) && p() && e('0'); //测试不传开始时间及结束时间的情况
-r($plan->create($noUid)) && p() && e('0'); //测试不传UID的情况
-r($plan->create($noProduct)) && p() && e('0'); //测试不传关联产品的情况
-r($plan->create($noParent)) && p() && e('0'); //测试不传父级计划的情况
-?>
+r($plan->create($posts)) && p() && e('110'); //测试正常创建
+r($plan->create($noTitle)) && p('title:0') && e('『名称』不能为空。'); //测试不传入名称的情况
+r($plan->create($noBegin)) && p() && e('111'); //测试不传开始时间的情况
+r($plan->create($noEnd)) && p() && e('112'); //测试不传结束时间的情况
+r($plan->create($noBeginEnd)) && p() && e('113'); //测试不传开始时间及结束时间的情况
+r($plan->create($noUid)) && p() && e('114'); //测试不传UID的情况
+r($plan->create($noProduct)) && p('product:0') && e('『产品』应当是数字。'); //测试不传关联产品的情况
+r($plan->create($noParent)) && p('parent:0') && e('『父计划』应当是数字。'); //测试不传父级计划的情况
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getbranchplanpairs.php b/test/model/productplan/getbranchplanpairs.php
index ae72c7a10b..9a00a71959 100755
--- a/test/model/productplan/getbranchplanpairs.php
+++ b/test/model/productplan/getbranchplanpairs.php
@@ -3,18 +3,30 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getLast();
+cid=1
+pid=1
+
+传入存在的数据,返回相应信息 >> 1.0 [2021-06-11~2022-04-26]
+传入不存在的分支 >> 0
+传入不存在的产品id >> 0
+
+*/
$plan = new productPlan('admin');
$product = array();
$product[0] = 41;
$product[1] = 1;
$product[2] = 111;
+
$branch = array();
$branch[0] = 1;
$branch[1] = 111;
$branch[2] = 1;
-r($plan->getBranchPlanPairs($product[0], $branch[0])) && p('1:31') && e('1.0 [2021-06-01~2022-04-16]'); //传入存在的数据,返回相应信息
+r($plan->getBranchPlanPairs($product[0], $branch[0])) && p('1:31') && e('1.0 [2021-06-11~2022-04-26]'); //传入存在的数据,返回相应信息
r($plan->getBranchPlanPairs($product[1], $branch[1])) && p('1:31') && e('0'); //传入不存在的分支
r($plan->getBranchPlanPairs($product[2], $branch[2])) && p('1:31') && e('0'); //传入不存在的产品id
-?>
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getbyidlist.php b/test/model/productplan/getbyidlist.php
index 2a1821b1d0..7b94582e2d 100755
--- a/test/model/productplan/getbyidlist.php
+++ b/test/model/productplan/getbyidlist.php
@@ -3,6 +3,19 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=cid=1
+cid=1
+pid=1
+
+传入一个数组,取值id为3的数据 >> 3
+传入一个数组,取值id为1的数据 >> 1
+传入一个数值,正常取值 >> 1
+传入一个不存在的值返回布尔值 >> 0
+
+*/
+
$plan = new productPlan('admin');
$IDlist = array();
@@ -14,4 +27,4 @@ r($plan->getByIDList($IDlist)) && p('3:id') && e('3'); //传入一个数组
r($plan->getByIDList($IDlist)) && p('1:id') && e('1'); //传入一个数组,取值id为1的数据
r($plan->getByIDList($IDlist[0])) && p('1:id') && e('1'); //传入一个数值,正常取值
r($plan->getByIDList($IDlist[1])) && p() && e('0'); //传入一个不存在的值返回布尔值
-?>
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getchildren.php b/test/model/productplan/getchildren.php
index 38b173a80d..1f630e5a6b 100755
--- a/test/model/productplan/getchildren.php
+++ b/test/model/productplan/getchildren.php
@@ -3,12 +3,22 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getChildren();
+cid=1
+pid=1
+
+这里统计了取出所有的数量 >> 61
+这里统计不存在的情况 >> 1
+
+*/
$plan = new productPlan('admin');
$planid = array();
$planid[0] = 0;
$planid[1] = 1;
-r($plan->getChildren(0)) && p() && e('70'); //这里统计了取出所有的数量
-r($plan->getChildren(1)) && p() && e('0'); //这里统计不存在的情况
-?>
+r($plan->getChildren(0)) && p() && e('61'); //这里统计了取出所有的数量
+r($plan->getChildren(1)) && p() && e('1'); //这里统计不存在的情况
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getforproducts.php b/test/model/productplan/getforproducts.php
index 2459361734..514d66e573 100755
--- a/test/model/productplan/getforproducts.php
+++ b/test/model/productplan/getforproducts.php
@@ -3,12 +3,25 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getForProducts();
+cid=1
+pid=1
+
+测试传入一个数组,取出产品名称count >> 1.0
+测试传入一个不存在的product数组,应为空 >> 0
+
+*/
+
$plan = new productPlan('admin');
$products = array();
$products[0] = array(1, 2);
$products[1] = array(1000,1001);
-r($plan->getForProducts($products[0])) && p() && e('3'); //测试传入一个数组,取出产品名称count
-r($plan->getForProducts($products[1])) && p() && e('0'); //测试传入一个不存在的product数组,应为空
-?>
+$noProduct = count($plan->getForProducts(array(1000,1001))) -1;
+
+r($plan->getForProducts($products[0])) && p('1') && e('1.0'); //测试传入一个数组,取出产品名称count
+r($noProduct) && p() && e('0'); //测试传入一个不存在的product数组,应为空
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getgroupbyproduct.php b/test/model/productplan/getgroupbyproduct.php
index 561dc68107..51a243de40 100755
--- a/test/model/productplan/getgroupbyproduct.php
+++ b/test/model/productplan/getgroupbyproduct.php
@@ -3,6 +3,21 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getGroupByProduct();
+cid=1
+pid=1
+
+传入正常product 1,2; >> 2
+传入部分不存在product; >> 1
+传入不存在product >> 0
+传入正常product 1,2;未过期param >> 0
+传入部分不存在product;未过期param >> 0
+传入不存在product; 未过期param >> 0
+
+*/
+
$plan = new productPlan('admin');
$products = array();
@@ -19,4 +34,4 @@ r($plan->getGroupByProduct($products[2], $param[0])) && p() && e('0'); //传入
r($plan->getGroupByProduct($products[0], $param[1])) && p() && e('0'); //传入正常product 1,2;未过期param
r($plan->getGroupByProduct($products[1], $param[1])) && p() && e('0'); //传入部分不存在product;未过期param
r($plan->getGroupByProduct($products[2], $param[1])) && p() && e('0'); //传入不存在product; 未过期param
-?>
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getlast.php b/test/model/productplan/getlast.php
index 5071e07a01..158aa952fb 100755
--- a/test/model/productplan/getlast.php
+++ b/test/model/productplan/getlast.php
@@ -3,6 +3,18 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getLast();
+cid=1
+pid=1
+
+获取id为1的最后一个产品 >> 3
+获取id为2的最后一个产品 >> 6
+获取不存在的id返回布尔值 >> 0
+
+*/
+
$plan = new productPlan('admin');
$getLast = array();
@@ -13,4 +25,4 @@ $getLast[2] = 200;
r($plan->getLast($getLast[0])) && p('id') && e('3'); //获取id为1的最后一个产品
r($plan->getLast($getLast[1])) && p('id') && e('6'); //获取id为2的最后一个产品
r($plan->getLast($getLast[2])) && p('id') && e('0'); //获取不存在的id返回布尔值
-?>
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getlist.php b/test/model/productplan/getlist.php
index d0b2e400ff..76bbbd31d9 100755
--- a/test/model/productplan/getlist.php
+++ b/test/model/productplan/getlist.php
@@ -3,6 +3,16 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=cid=1
+cid=1
+pid=1
+
+获取product=1的所有数据 >> 3
+
+*/
+
$productplan = new Productplan('admin');
$List = array();
@@ -13,6 +23,5 @@ $List[3] = null;
$List[4] = 'begin_desc';
$List[5] = 'kipparent';
-//var_dump($productplan->getList(1, 0, 'all', null, 'begin_desc', 'kipparent'));die;
-r($productplan->getList(1, 0, 'all', null, 'begin_desc', 'kipparent')) && p('3:id') && e('3'); //查询
-?>
+r($productplan->getList(1, 0, 'all', null, 'begin_desc', 'kipparent')) && p('3:id') && e('3'); //获取product=1的所有数据
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getpairs.php b/test/model/productplan/getpairs.php
index 268d6569ef..b69d300d8f 100755
--- a/test/model/productplan/getpairs.php
+++ b/test/model/productplan/getpairs.php
@@ -3,6 +3,18 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getPairs();
+cid=1
+pid=1
+
+id为41的产品分支32 >> 分支2 / 1.1 [2021-06-18 ~ 2022-05-03]
+id为41的产品分支31 >> 分支1 / 1.0 [2021-06-11 ~ 2022-04-26]
+id为42的产品分支34 >> 分支4 / 1.0 [2021-07-02 ~ 2022-05-17]
+
+*/
+
$plan = new productPlan('admin');
$product = array();
@@ -11,7 +23,7 @@ $product[1] = 42;
$branch = 1;
$expired = 'unexpired';
-r($plan->getPairs($product[0], $branch, $expired)) && p('32') && e('分支2 / 1.1 [2021-06-08 ~ 2022-04-23]'); //id为41的产品分支32
-r($plan->getPairs($product[0], $branch, $expired)) && p('31') && e('分支1 / 1.0 [2021-06-01 ~ 2022-04-16]'); //id为41的产品分支31
-r($plan->getPairs($product[1], $branch, $expired)) && p('34') && e('分支4 / 1.0 [2021-06-22 ~ 2022-05-07]'); //id为42的产品分支34
-?>
+r($plan->getPairs($product[0], $branch, $expired)) && p('32') && e('分支2 / 1.1 [2021-06-18 ~ 2022-05-03]'); //id为41的产品分支32
+r($plan->getPairs($product[0], $branch, $expired)) && p('31') && e('分支1 / 1.0 [2021-06-11 ~ 2022-04-26]'); //id为41的产品分支31
+r($plan->getPairs($product[1], $branch, $expired)) && p('34') && e('分支4 / 1.0 [2021-07-02 ~ 2022-05-17]'); //id为42的产品分支34
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getpairsforstory.php b/test/model/productplan/getpairsforstory.php
index bb7bf1cc43..8de61c3710 100755
--- a/test/model/productplan/getpairsforstory.php
+++ b/test/model/productplan/getpairsforstory.php
@@ -3,6 +3,21 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getPairsForStory();
+cid=1
+pid=1
+
+测试传入已有数据product=10,branch=0情况,正常返回 >> 3
+测试传入product=41, branch=1的数据 >> 1
+测试传入一个数组 >> 4
+测试传入不存在的product >> 0
+测试传入不同param情况 >> 3
+测试传入不同param情况 >> 3
+
+*/
+
$plan = new productPlan('admin');
$product = array(10, 41, 42, 1000);
@@ -15,4 +30,4 @@ r($plan->getPairsForStory($product, $branch[1], $param[1])) && p('') && e('4'
r($plan->getPairsForStory($product[3], $branch[1], $param[1])) && p('') && e('0'); //测试传入不存在的product
r($plan->getPairsForStory($product[0], $branch[0], $param[0])) && p('') && e('3'); //测试传入不同param情况
r($plan->getPairsForStory($product[0], $branch[0], $param[2])) && p('') && e('3'); //测试传入不同param情况
-?>
+?>
\ No newline at end of file
diff --git a/test/model/productplan/getplansbystories.php b/test/model/productplan/getplansbystories.php
index e7c282de82..6f451f23fd 100755
--- a/test/model/productplan/getplansbystories.php
+++ b/test/model/productplan/getplansbystories.php
@@ -3,13 +3,25 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->getPlansByStories();
+cid=1
+pid=1
+
+查询存在的id >> 3
+查询部分存在的id >> 1
+查询不存在的id >> 0
+
+*/
$plan = new productPlan('admin');
$storyIdList = array();
$storyIdList[0] = array(5, 6, 7);
$storyIdList[1] = array(5, 1000);
$storyIdList[2] = array(1000, 1001);
+
r($plan->getPlansByStories($storyIdList[0])) && p() && e('3'); //查询存在的id
r($plan->getPlansByStories($storyIdList[1])) && p() && e('1'); //查询部分存在的id
r($plan->getPlansByStories($storyIdList[2])) && p() && e('0'); //查询不存在的id
-?>
+?>
\ No newline at end of file
diff --git a/test/model/productplan/isclickable.php b/test/model/productplan/isclickable.php
new file mode 100755
index 0000000000..83ccf7ef54
--- /dev/null
+++ b/test/model/productplan/isclickable.php
@@ -0,0 +1,38 @@
+#!/usr/bin/env php
+isClickable();
+cid=1
+pid=1
+
+id=100,无子集计划,可以点击的id=100 >> 1
+id=1,有子集计划,不能点击 >> 0
+id=102,无子集计划,计划关闭,不可点击 >> 0
+id=105,无子集计划,等待状态,不可点击 >> 0
+
+*/
+
+$plan = new productPlan('admin');
+
+$planID = array();
+$planID[0] = 100;
+$planID[1] = 101;
+$planID[2] = 1;
+$planID[3] = 102;
+$planID[4] = 105;
+
+$action = array();
+$action[0] = 'start';
+$action[1] = 'finish';
+$action[2] = 'close';
+$action[3] = 'activate';
+
+r($plan->isClickable($planID[0], $action[0])) && p() && e('1'); //id=100,无子集计划,可以点击的id=100
+r($plan->isClickable($planID[2], $action[1])) && p() && e('0'); //id=1,有子集计划,不能点击
+r($plan->isClickable($planID[3], $action[2])) && p() && e('0'); //id=102,无子集计划,计划关闭,不可点击
+r($plan->isClickable($planID[4], $action[3])) && p() && e('0'); //id=105,无子集计划,等待状态,不可点击
+?>
\ No newline at end of file
diff --git a/test/model/productplan/linkbug.php b/test/model/productplan/linkbug.php
new file mode 100755
index 0000000000..970c839396
--- /dev/null
+++ b/test/model/productplan/linkbug.php
@@ -0,0 +1,43 @@
+#!/usr/bin/env php
+linkBug()
+cid=1
+pid=1
+
+id为100的计划关联id为3的bug >> 0
+id为100的计划关联id为1和2的bug >> 0
+传入不存在的id >> 0
+解除bugid为1的关联关系 >> 0
+解除bugid为2的关联关系 >> 0
+解除不存在的id >> 0
+
+*/
+
+$plan = new productPlan('admin');
+
+$planID = array();
+$planID[0] = 100;
+
+$bugID = array();
+$bugID[0] = array('bugs' => array(3));
+$bugID[1] = array('bugs' => array(1, 2));
+$bugID[2] = array('bugs' => array(10000));
+
+$unbugID = array();
+$unbugID[0] = 1;
+$unbugID[1] = 2;
+$unbugID[2] = 10000;
+
+r($plan->linkBug($planID[0], $bugID[0])) && p() && e('0'); //id为100的计划关联id为3的bug
+r($plan->linkBug($planID[0], $bugID[1])) && p() && e('0'); //id为100的计划关联id为1和2的bug
+r($plan->linkBug($planID[0], $bugID[2])) && p() && e('0'); //传入不存在的id
+r($plan->unlinkBug($planID[0], $unbugID[0])) && p() && e('0'); //解除bugid为1的关联关系
+r($plan->unlinkBug($planID[0], $unbugID[1])) && p() && e('0'); //解除bugid为2的关联关系
+r($plan->unlinkBug($planID[0], $unbugID[2])) && p() && e('0'); //解除不存在的id
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/linkproject.php b/test/model/productplan/linkproject.php
new file mode 100755
index 0000000000..fe0c820096
--- /dev/null
+++ b/test/model/productplan/linkproject.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+linkProject();
+cid=1
+pid=1
+
+项目ID=3关联计划ID为11,12的产品计划 >> 0
+
+*/
+
+$plan = new productPlan('admin');
+
+r($plan->linkProject(13, array(11 ,12))) && p() && e('0'); //项目ID=3关联计划ID为11,12的产品计划
+?>
\ No newline at end of file
diff --git a/test/model/productplan/linkstory.php b/test/model/productplan/linkstory.php
new file mode 100755
index 0000000000..14c05dd0d4
--- /dev/null
+++ b/test/model/productplan/linkstory.php
@@ -0,0 +1,46 @@
+#!/usr/bin/env php
+linkStory();
+cid=1
+pid=1
+
+关联计划id为100的需求4 >> 0
+关联计划id为101的需求8 >> 0
+传入不存在id的情况 >> 0
+解除id为100关联需求4 >> 0
+解除id为101关联需求8 >> 0
+
+*/
+
+$plan = new productPlan('admin');
+
+$planID = array();
+$planID[0] = 100;
+$planID[1] = 101;
+$planID[2] = 10000;
+
+$storyID = array();
+$storyID[0] = array('stories' => array(4));
+$storyID[1] = array('stories' => array(8));
+$storyID[2] = array('stories' => array(1111));
+
+$unstoryID = array();
+$unstoryID[0] = 4;
+$unstoryID[1] = 8;
+$unstoryID[2] = 1111;
+
+#方法没有return返回结果,页面上看关联成功了,成功失败均返回空
+r($plan->linkStory($planID[0], $storyID[0])) && p() && e('0'); //关联计划id为100的需求4
+r($plan->linkStory($planID[1], $storyID[1])) && p() && e('0'); //关联计划id为101的需求8
+r($plan->linkStory($planID[2], $storyID[2])) && p() && e('0'); //传入不存在id的情况
+
+#这里将另一个同类方法unlinkStory放在这里调用
+r($plan->unlinkStory($unstoryID[0], $planID[0])) && p() && e('0'); //解除id为100关联需求4
+r($plan->unlinkStory($unstoryID[1], $planID[1])) && p() && e('0'); //解除id为101关联需求8
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/reorderchildren.php b/test/model/productplan/reorderchildren.php
new file mode 100755
index 0000000000..198e439bef
--- /dev/null
+++ b/test/model/productplan/reorderchildren.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+reorder4Children();
+cid=1
+pid=1
+
+传入三个子计划id100,102,101,排序第一个 >> 100
+第二个 >> 101
+第三个,会输出正序排列的数组100,101,102 >> 102
+传入不存在的id时 >> 0
+
+*/
+
+$plan = new productPlan('admin');
+
+$planID = array();
+$planID[0] = array(100, 102, 101);
+$planID[1] = array(1000, 10000);
+
+r($plan->reorder4Children($planID[0])) && p('100:id') && e('100'); //传入三个子计划id100,102,101,排序第一个
+r($plan->reorder4Children($planID[0])) && p('101:id') && e('101'); //第二个
+r($plan->reorder4Children($planID[0])) && p('102:id') && e('102'); //第三个,会输出正序排列的数组100,101,102
+r($plan->reorder4Children($planID[1])) && p() && e('0'); //传入不存在的id时
+?>
\ No newline at end of file
diff --git a/test/model/productplan/unlinkstory.php b/test/model/productplan/unlinkstory.php
new file mode 100755
index 0000000000..8b86073a4e
--- /dev/null
+++ b/test/model/productplan/unlinkstory.php
@@ -0,0 +1,8 @@
+#!/usr/bin/env php
+
diff --git a/test/model/productplan/update.php b/test/model/productplan/update.php
index 4c4e90c193..82eedba5a1 100755
--- a/test/model/productplan/update.php
+++ b/test/model/productplan/update.php
@@ -3,6 +3,17 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->update();
+cid=1
+pid=1
+
+修改planId=5的数据,打印出旧的名称 >> 1.1
+二次修改旧的数据,由于数据发生变化,理应失败 >> 0
+测试传入结束时间小于开始时间的情况 >> 父计划[5]的完成日期:2021-10-10,不能小于子计划的完成日期: 2021-10-26
+
+*/
$plan = new productPlan('admin');
$planId = array();
@@ -12,7 +23,7 @@ $planId[1] = 6;
$posts = array();
$posts['title'] = '测试修改';
$posts['status'] = 'doing';
-$posts['begin'] = '2022-03-22';
+$posts['begin'] = '2021-03-22';
$posts['end'] = '2022-10-31';
$posts['uid'] = '';
$posts['product'] = '2';
@@ -22,5 +33,6 @@ $late['end'] = '2021-10-10';
r($plan->update($planId[0], $posts)) && p('0:old') && e('1.1'); //修改planId=5的数据,打印出旧的名称
r($plan->update($planId[0], $posts)) && p('0:old') && e('0'); //二次修改旧的数据,由于数据发生变化,理应失败
-r($plan->update($planId[0], $late)) && p() && e('0'); //测试传入结束时间小于开始时间的情况
-?>
+r($plan->update($planId[0], $late)) && p('end') && e('父计划[5]的完成日期:2021-10-10,不能小于子计划的完成日期: 2021-10-26'); //测试传入结束时间小于开始时间的情况
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/updateparentstatus.php b/test/model/productplan/updateparentstatus.php
index cf71fe9382..c9504744b5 100755
--- a/test/model/productplan/updateparentstatus.php
+++ b/test/model/productplan/updateparentstatus.php
@@ -3,6 +3,18 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->updateParentStatus();
+cid=1
+pid=1
+
+将id为1的计划改为wait状态 >> 0
+将id为2的计划改为doing状态 >> 1
+将id为3的计划改为closed状态 >> 1
+将id为4的计划改为done状态 >> 1
+
+*/
$plan = new productPlan('admin');
$parentId = array();
@@ -12,8 +24,9 @@ $parentid[2] = 3;
$parentid[3] = 4;
#此方法将父级plan状态改为与子plan相同的状态
-r($plan->updateParentStatus($parentid[0])) && p() && e('1'); //将id为1的计划改为wait状态
+r($plan->updateParentStatus($parentid[0])) && p() && e('0'); //将id为1的计划改为wait状态
r($plan->updateParentStatus($parentid[1])) && p() && e('1'); //将id为2的计划改为doing状态
r($plan->updateParentStatus($parentid[2])) && p() && e('1'); //将id为3的计划改为closed状态
r($plan->updateParentStatus($parentid[3])) && p() && e('1'); //将id为4的计划改为done状态
-?>
+system("./ztest init");
+?>
\ No newline at end of file
diff --git a/test/model/productplan/updatestatus.php b/test/model/productplan/updatestatus.php
index 7bf667ba58..83474ef0b2 100755
--- a/test/model/productplan/updatestatus.php
+++ b/test/model/productplan/updatestatus.php
@@ -3,6 +3,17 @@
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productplan.class.php';
+/**
+
+title=productpanModel->updateStatus();
+cid=1
+pid=1
+
+修改id=5的状态为doing >> 1
+修改状态为done >> 1
+修改状态为closed >> 1
+
+*/
$plan = new productPlan('admin');
$planId = array();
@@ -18,4 +29,5 @@ $planId[7] = 'activated';
r($plan->updateStatus($planId[0], $planId[1], $planId[4])) && p() && e('1'); //修改id=5的状态为doing
r($plan->updateStatus($planId[0], $planId[2], $planId[5])) && p() && e('1'); //修改状态为done
r($plan->updateStatus($planId[0], $planId[3], $planId[6])) && p() && e('1'); //修改状态为closed
-?>
+system("./ztest init");
+?>
\ No newline at end of file
From fb5a792fee65a57dea4dde05a7e00c72b0a4ad72 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Thu, 31 Mar 2022 10:05:31 +0800
Subject: [PATCH 20/26] * Fix bug #18002.
---
module/execution/control.php | 4 ----
module/kanban/model.php | 1 -
2 files changed, 5 deletions(-)
diff --git a/module/execution/control.php b/module/execution/control.php
index 1ba865bf66..6fcab91979 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -2158,10 +2158,6 @@ class execution extends control
unset($this->lang->kanban->type['bug']);
unset($this->lang->kanban->type['all']);
}
- elseif($execution->type == 'stage' and $execution->attribute != 'dev')
- {
- unset($this->lang->kanban->type['task']);
- }
$kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy);
if(empty($kanbanGroup))
diff --git a/module/kanban/model.php b/module/kanban/model.php
index 746b3638ec..949366368b 100644
--- a/module/kanban/model.php
+++ b/module/kanban/model.php
@@ -1323,7 +1323,6 @@ class kanbanModel extends model
->where('execution')->eq($executionID)
->andWhere('deleted')->eq(0)
->beginIF($browseType != 'all')->andWhere('type')->eq($browseType)->fi()
- ->beginIF($execution->type == 'stage' and $execution->attribute != 'dev')->andWhere('type')->ne('task')->fi()
->orderBy('order_asc')
->fetchAll('id');
From 16e62835ae6cb26549b835ba1824d89890e7cc02 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Thu, 31 Mar 2022 10:06:58 +0800
Subject: [PATCH 21/26] * Fix bug #18002.
---
module/kanban/model.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/module/kanban/model.php b/module/kanban/model.php
index 949366368b..3646c208db 100644
--- a/module/kanban/model.php
+++ b/module/kanban/model.php
@@ -1318,7 +1318,6 @@ class kanbanModel extends model
{
if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy);
- $execution = $this->loadModel('execution')->getById($executionID);
$lanes = $this->dao->select('*')->from(TABLE_KANBANLANE)
->where('execution')->eq($executionID)
->andWhere('deleted')->eq(0)
From bc12fbdf607d8e99db9cae49bc424cbb926b6bfd Mon Sep 17 00:00:00 2001
From: liyang <“liyang@easycorp.ltd”>
Date: Thu, 31 Mar 2022 10:08:52 +0800
Subject: [PATCH 22/26] update kanbancard
---
test/data/kanbancard.yaml | 15 +++++++++------
test/data/kanbancell.yaml | 7 +++++--
test/data/zentao/config.php | 2 +-
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/test/data/kanbancard.yaml b/test/data/kanbancard.yaml
index 7422226af8..8b41cb3652 100644
--- a/test/data/kanbancard.yaml
+++ b/test/data/kanbancard.yaml
@@ -10,18 +10,21 @@ fields:
- field: group
range: 1-100{8}
- field: fromID
- range: "0"
+ range: 0{800},1-70,1-10,101-200,1-20
- field: fromType
- range: ""
+ range: []{800},productplan{70},release{10},execution{100},build{20}
- field: name
- range: 1-1000000
- prefix: "卡片"
+ fields:
+ - field: name1
+ range: 卡片{800},[]{200}
+ - field: name2
+ range: 1-800,[]{200}
- field: status
range: doing,doing,done
- field: pri
- range: "3"
+ range: 3{800},0{200}
- field: assignedTo
- range: "admin"
+ range: admin{800},[]{200}
- field: desc
range: ""
- field: begin
diff --git a/test/data/kanbancell.yaml b/test/data/kanbancell.yaml
index fb53137baa..901509dee9 100644
--- a/test/data/kanbancell.yaml
+++ b/test/data/kanbancell.yaml
@@ -16,7 +16,10 @@ fields:
- field: card1
prefix: ","
postfix: ","
- range: 1-800:2
+ range: 1-1000:2
- field: card2
postfix: ","
- range: 2-800:2
+ range: 2-1000:2
+ - field: card3
+ postfix: ","
+ range: 801-1000:2
diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php
index e639a4127e..35b4a398a4 100644
--- a/test/data/zentao/config.php
+++ b/test/data/zentao/config.php
@@ -60,7 +60,7 @@ $builder->kanbanregion = array('rows' => 100, 'extends' => array('kanbanregion',
$builder->kanbangroup = array('rows' => 100, 'extends' => array('kanbangroup','kanbangroup'));
$builder->kanbanlane = array('rows' => 100, 'extends' => array('kanbanlane','kanbanlane'));
$builder->kanbancolumn = array('rows' => 400, 'extends' => array('kanbancolumn','kanbancolumn'));
-$builder->kanbancard = array('rows' => 800, 'extends' => array('kanbancard','kanbancard'));
+$builder->kanbancard = array('rows' => 1000, 'extends' => array('kanbancard','kanbancard'));
$builder->kanbancell = array('rows' => 400, 'extends' => array('kanbancell','kanbancell'));
$builder->kanbanregionproject = array('rows' => 180, 'extends' => array('kanbanregion','kanbanregionproject'));
From 8ff464a02c4ea7ed8751f8f52fa62d98de04c8b1 Mon Sep 17 00:00:00 2001
From: Zongjun Lan
Date: Thu, 31 Mar 2022 10:34:12 +0800
Subject: [PATCH 23/26] * fix bug add install lite version text
---
extension/lite/install/ext/control/index.php | 10 ++++++++++
extension/lite/install/ext/lang/zh-cn/lite.php | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 extension/lite/install/ext/control/index.php
diff --git a/extension/lite/install/ext/control/index.php b/extension/lite/install/ext/control/index.php
new file mode 100644
index 0000000000..bdf96f7275
--- /dev/null
+++ b/extension/lite/install/ext/control/index.php
@@ -0,0 +1,10 @@
+view->versionName = $this->config->liteVersion;
+ return parent::index();
+ }
+}
diff --git a/extension/lite/install/ext/lang/zh-cn/lite.php b/extension/lite/install/ext/lang/zh-cn/lite.php
index 4b0a59ab1a..40e0c890e3 100644
--- a/extension/lite/install/ext/lang/zh-cn/lite.php
+++ b/extension/lite/install/ext/lang/zh-cn/lite.php
@@ -13,7 +13,7 @@ $lang->install->links = <<https://weibo.com/easysoft
-
+您现在正在安装的版本是 %s。
EOT;
$lang->install->successLabel = "
Date: Thu, 31 Mar 2022 10:43:09 +0800
Subject: [PATCH 24/26] * adjust code for update kanban.
---
module/kanban/model.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/module/kanban/model.php b/module/kanban/model.php
index 3646c208db..ba9b1b2a80 100644
--- a/module/kanban/model.php
+++ b/module/kanban/model.php
@@ -2526,6 +2526,7 @@ class kanbanModel extends model
->fetchPairs();
if(empty($cardPairs)) return;
+ $sourceCards = $cardPairs;
if($laneType == 'story')
{
@@ -2624,13 +2625,17 @@ class kanbanModel extends model
->andWhere('t1.lane')->eq($lane->id)
->fetchPairs();
+ $updated = false;
foreach($cardPairs as $colType => $cards)
{
if(!isset($colPairs[$colType])) continue;
+ if($sourceCards[$colType] == $cards) continue;
+
$this->dao->update(TABLE_KANBANCELL)->set('cards')->eq($cards)->where('lane')->eq($lane->id)->andWhere('`column`')->eq($colPairs[$colType])->exec();
+ if(!$updated) $updated = true;
}
- $this->dao->update(TABLE_KANBANLANE)->set('lastEditedTime')->eq(helper::now())->where('id')->eq($lane->id)->exec();
+ if($updated) $this->dao->update(TABLE_KANBANLANE)->set('lastEditedTime')->eq(helper::now())->where('id')->eq($lane->id)->exec();
}
/**
From 2dc5aec4229eb2dac9db4a67dcc997d7366497e0 Mon Sep 17 00:00:00 2001
From: liyang <“liyang@easycorp.ltd”>
Date: Thu, 31 Mar 2022 10:46:48 +0800
Subject: [PATCH 25/26] update kanban data
---
test/data/kanban.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/data/kanban.yaml b/test/data/kanban.yaml
index 54f26af451..0df05382ee 100644
--- a/test/data/kanban.yaml
+++ b/test/data/kanban.yaml
@@ -61,6 +61,7 @@ fields:
range: "0"
- field: object
range: ""
+ prefix: "plans,releases,builds,executions,cards"
- field: createdBy
range: "admin"
- field: createdDate
From 8efcc37f4bafe86b1feae138613936d99bf57313 Mon Sep 17 00:00:00 2001
From: zhouxudong
Date: Thu, 31 Mar 2022 11:02:59 +0800
Subject: [PATCH 26/26] * Fix bug #18083.
---
module/task/lang/en.php | 4 ++--
module/task/lang/zh-cn.php | 4 ++--
module/task/model.php | 14 +++++++-------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/module/task/lang/en.php b/module/task/lang/en.php
index 4c7464d2d1..b6eacee3be 100644
--- a/module/task/lang/en.php
+++ b/module/task/lang/en.php
@@ -246,8 +246,8 @@ $lang->task->error->finishedDateEmpty = '"Finished Date" should not be empty.';
$lang->task->error->finishedDateSmall = '"Finished Date" should be > "Real Started"';
$lang->task->error->alreadyConsumed = 'The currently selected parent task has been consumed.';
$lang->task->error->date = 'The date should be >= today.';
-$lang->task->error->leftEmpty = 'When the task status is %s, "Hours Left" cannot be 0';
-$lang->task->error->leftEmptyAB = 'task#%sWhen the task status is %s, "Left" cannot be 0';
+$lang->task->error->leftEmptyAB = 'When the task status is %s, "Hours Left" cannot be 0';
+$lang->task->error->leftEmpty = 'Task#%sWhen the task status is %s, "Left" cannot be 0';
/* Report. */
$lang->task->report = new stdclass();
diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php
index b289c2171b..f1a9a910b1 100644
--- a/module/task/lang/zh-cn.php
+++ b/module/task/lang/zh-cn.php
@@ -246,8 +246,8 @@ $lang->task->error->finishedDateEmpty = '实际完成不能为空';
$lang->task->error->finishedDateSmall = '实际完成不能小于实际开始';
$lang->task->error->alreadyConsumed = '当前选中的父任务已有消耗。';
$lang->task->error->date = '日期不能大于今天';
-$lang->task->error->leftEmpty = '任务状态为%s时,预计剩余不能为0';
-$lang->task->error->leftEmptyAB = 'task#%s任务状态为%s时,剩余不能为0';
+$lang->task->error->leftEmptyAB = '任务状态为%s时,预计剩余不能为0';
+$lang->task->error->leftEmpty = 'Task#%s任务状态为%s时,剩余不能为0';
/* Report. */
$lang->task->report = new stdclass();
diff --git a/module/task/model.php b/module/task/model.php
index 4ffc3f2522..93ed0af681 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -998,9 +998,9 @@ class taskModel extends model
$requiredFields = str_replace(',estimate,', ',', $requiredFields);
}
- if(strpos(',done,wait,cancel,closed,', $task->status) === false && empty($teams) && empty($task->left))
+ if(strpos(',doing,pause,', $task->status) && empty($teams) && empty($task->left))
{
- dao::$errors[] = sprintf($this->lang->task->error->leftEmpty, $this->lang->task->statusList[$task->status]);
+ dao::$errors[] = sprintf($this->lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]);
return false;
}
@@ -1263,13 +1263,13 @@ class taskModel extends model
if($task->status == 'cancel') continue;
if($task->status == 'done' and $task->consumed == false)
{
- dao::$errors[] = 'task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime);
+ dao::$errors[] = 'Task#' . $taskID . sprintf($this->lang->error->notempty, $this->lang->task->consumedThisTime);
return false;
}
if(!empty($task->deadline) and $task->estStarted > $task->deadline)
{
- dao::$errors[] = 'task#' . $taskID . $this->lang->task->error->deadlineSmall;
+ dao::$errors[] = 'Task#' . $taskID . $this->lang->task->error->deadlineSmall;
return false;
}
@@ -1289,9 +1289,9 @@ class taskModel extends model
foreach($tasks as $taskID => $task)
{
- if(strpos(',done,wait,cancel,closed,', $task->status) === false && empty($teams) && $task->parent >= 0 && empty($task->left))
+ if(strpos(',doing,pause,', $task->status) && empty($teams) && $task->parent >= 0 && empty($task->left))
{
- dao::$errors[] = sprintf($this->lang->task->error->leftEmptyAB, $taskID, $this->lang->task->statusList[$task->status]);
+ dao::$errors[] = sprintf($this->lang->task->error->leftEmpty, $taskID, $this->lang->task->statusList[$task->status]);
return false;
}
@@ -1315,7 +1315,7 @@ class taskModel extends model
->exec();
if(dao::isError())
{
- dao::$errors[] = 'task#' . $taskID . dao::getError(true);
+ dao::$errors[] = 'Task#' . $taskID . dao::getError(true);
return false;
}
您已经成功安装禅道迅捷版%s。
"; From 6e608e291144f4202e6dd40aeb953956a324eb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?=