diff --git a/module/action/lang/en.php b/module/action/lang/en.php
index 28d8adc3e8..582cec1915 100755
--- a/module/action/lang/en.php
+++ b/module/action/lang/en.php
@@ -325,6 +325,7 @@ $lang->action->label->startedbychild = 'started';
$lang->action->label->finishedbychild = 'finished';
$lang->action->label->closedbychild = 'closed';
$lang->action->label->activatedbychild = 'activated';
+$lang->action->label->createchild = 'activated';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php
index edd3f69f31..f59b472f70 100755
--- a/module/action/lang/zh-cn.php
+++ b/module/action/lang/zh-cn.php
@@ -325,6 +325,7 @@ $lang->action->label->startedbychild = '开始了';
$lang->action->label->finishedbychild = '完成了';
$lang->action->label->closedbychild = '关闭了';
$lang->action->label->activatedbychild = '激活了';
+$lang->action->label->createchild = '激活了';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass();
diff --git a/module/action/model.php b/module/action/model.php
index ca1ef97a30..f7ee21a64f 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -707,7 +707,7 @@ class actionModel extends model
{
$desc = $this->lang->$objectType->action->rejectreviewed;
}
- elseif($action->objectType == 'productplan' and in_array($action->action, array('startedbychild','finishedbychild','closedbychild','activatedbychild')))
+ elseif($action->objectType == 'productplan' and in_array($action->action, array('startedbychild','finishedbychild','closedbychild','activatedbychild', 'createchild')))
{
$desc = $this->lang->$objectType->action->changebychild;
}
diff --git a/module/productplan/control.php b/module/productplan/control.php
index 9bfee95a7a..427733e5cd 100644
--- a/module/productplan/control.php
+++ b/module/productplan/control.php
@@ -66,6 +66,9 @@ class productplan extends control
$this->executeHooks($planID);
+ if($parent > 0) $this->productplan->updateParentStatus($parent);
+ if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
+
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $planID));
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => 'parent.refreshPlan()'));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('productplan', 'browse', "productID=$productID&branch=$branchID&browseType=wait")));
@@ -357,6 +360,8 @@ class productplan extends control
if($plan->parent > 0) $this->view->parentPlan = $this->productplan->getById($plan->parent);
if($plan->parent == '-1') $this->view->childrenPlans = $this->productplan->getChildren($plan->id);
+ if($plan->branch > 0) $this->view->branchStatus = $this->loadModel('branch')->getById($plan->branch, $plan->product, 'status');
+
$this->loadModel('datatable');
$this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
$this->view->title = "PLAN #$plan->id $plan->title/" . zget($products, $plan->product, '');
diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php
index a8abcabed2..5fd0639707 100644
--- a/module/productplan/lang/en.php
+++ b/module/productplan/lang/en.php
@@ -18,12 +18,11 @@ $lang->productplan->delete = "Delete Plan";
$lang->productplan->start = "Start Plan";
$lang->productplan->finish = "Finish Plan";
$lang->productplan->close = "Close Plan";
+$lang->productplan->activate = "Activate Plan";
$lang->productplan->startAB = "Start";
$lang->productplan->finishAB = "Finish";
$lang->productplan->closeAB = "Close";
$lang->productplan->activateAB = "Activate";
-$lang->productplan->view = "Plan Detail";
-$lang->productplan->activate = "Activate Plan";
$lang->productplan->view = "View";
$lang->productplan->bugSummary = "Total %s Bugs on this page.";
$lang->productplan->basicInfo = 'Basic Info';
@@ -102,6 +101,7 @@ $lang->productplan->parentActionList['startedbychild'] = 'starting productplan->parentActionList['finishedbychild'] = 'finishing all productplan sets the plan status as Done.';
$lang->productplan->parentActionList['closedbychild'] = 'closing all productplan sets the plan status as Closed.';
$lang->productplan->parentActionList['activatedbychild'] = 'activating the productplan sets the plan status as Doing.';
+$lang->productplan->parentActionList['createchild'] = 'creating a child productplan sets the plan status as Doing.';
$lang->productplan->endList[7] = '1 Week';
$lang->productplan->endList[14] = '2 Weeks';
diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php
index ac6197f574..9cb4d9e489 100644
--- a/module/productplan/lang/zh-cn.php
+++ b/module/productplan/lang/zh-cn.php
@@ -101,6 +101,7 @@ $lang->productplan->parentActionList['startedbychild'] = '系统判断由于
$lang->productplan->parentActionList['finishedbychild'] = '系统判断由于子计划 全部完成 ,将计划状态置为 已完成 。';
$lang->productplan->parentActionList['closedbychild'] = '系统判断由于子计划 全部关闭 ,将计划状态置为 已关闭 。';
$lang->productplan->parentActionList['activatedbychild'] = '系统判断由于子计划 激活 ,将计划状态置为 进行中 。';
+$lang->productplan->parentActionList['createchild'] = '系统判断由于 创建 子计划 ,将计划状态置为 进行中 。';
$lang->productplan->endList[7] = '一星期';
$lang->productplan->endList[14] = '两星期';
diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php
index f86a8d11d1..236571474e 100644
--- a/module/productplan/view/browsebylist.html.php
+++ b/module/productplan/view/browsebylist.html.php
@@ -78,7 +78,6 @@
loadModel('file');?>
-
end < $today and in_array($plan->status, array('wait', 'doing')))
+ if($plan->expired and in_array($plan->status, array('wait', 'doing')))
{
$class .= ' expired';
$expired = "{$this->lang->productplan->expired}";
@@ -164,7 +163,8 @@
common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr);
}
- $attr = $plan->expired ? "disabled='disabled'" : '';
+ $attr = $plan->expired ? "disabled='disabled'" : '';
+ $disabled = '';
if(common::hasPriv('execution', 'create', $plan) and $plan->parent >= 0)
{
$disabled = '';
@@ -197,7 +197,7 @@
}
else
{
- echo html::a($this->createLink('productplan', 'create', "product=$productID&branch=$branch&parent={$plan->id}"), "", '', "class='btn' title='{$this->lang->productplan->children}'");
+ echo html::a($this->createLink('productplan', 'create', "product=$productID&branch=$branch&parent={$plan->id}"), "", '', "class='btn {$disabled}' title='{$this->lang->productplan->children}'");
}
}
diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php
index 74e0cd9add..23c5979e8c 100644
--- a/module/productplan/view/view.html.php
+++ b/module/productplan/view/view.html.php
@@ -63,7 +63,8 @@
common::printLink('productplan', 'activate', "planID=$plan->id", "{$lang->productplan->activateAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->activate}'", '', false, $plan);
}
- if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= 0) echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link' title='{$this->lang->productplan->children}'");
+ $class= (isset($branchStatus) and $branchStatus == 'closed') ? 'disabled' : '';
+ if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= 0) echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link {$class}' title='{$this->lang->productplan->children}'");
if(common::hasPriv('productplan', 'edit', $plan)) echo html::a($this->createLink('productplan', 'edit', "planID=$plan->id"), " " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'");
if(common::hasPriv('productplan', 'delete', $plan) and $plan->parent >= 0) echo html::a($this->createLink('productplan', 'delete', "planID=$plan->id"), " " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'");
}