diff --git a/module/action/control.php b/module/action/control.php index 814363db4f..e9e20de12b 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -374,6 +374,11 @@ class action extends control $hasCreatedTask = $this->loadModel('programplan')->isCreateTask($execution->parent); if(!$hasCreatedTask) die(js::alert($this->lang->action->hasCreatedTask)); + /* Check type of siblings. */ + $siblings = $this->dao->select('DISTINCT type')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('parent')->eq($execution->parent)->fetchPairs('type'); + if($execution->type == 'stage' and (isset($bsiblings['sprint']) or isset($siblings['kanban']))) die(js::alert($this->lang->action->hasOtherType[$execution->type])); + if(($execution->type == 'sprint' or $execution->type == 'kanban') and isset($siblings['stage'])) die(js::alert($this->lang->action->hasOtherType[$execution->type])); + /* If parent stage is not exists, you should recover its parent stages, refresh status. */ $stagePathList = explode(',', trim($execution->path, ',')); $deletedStageList = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->in($stagePathList)->andWhere('deleted')->eq(1)->andWhere('type')->eq('stage')->orderBy('id_asc')->fetchAll('id'); diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 37e0d209a5..5baa365302 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the $lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type."; $lang->action->whetherToRestore = 'Confirm to restore?'; +$lang->action->hasOtherType = array(); +$lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored."; +$lang->action->hasOtherType['sprint'] = "Only subtypes of Stage types can be created at this parent stage, so the current {$lang->executionCommon} cannot be restored."; +$lang->action->hasOtherType['kanban'] = "Only subtypes of Stage types can be created at this parent stage, so the current Kanban cannot be restored."; + $lang->action->repeatChange = '%s with the same name and code already exists in the system, After recovery, the name are \"%s\",the code are \"%s\".'; $lang->action->nameRepeatChange = '%s with the same name already exists in the system, After recovery, the name are \"%s\".'; $lang->action->codeRepeatChange = '%s with the same code already exists in the system, After recovery, the code are \"%s\".'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 4b6a9032eb..e8f6886579 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the $lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type."; $lang->action->whetherToRestore = 'Confirm to restore?'; +$lang->action->hasOtherType = array(); +$lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored."; +$lang->action->hasOtherType['sprint'] = "Only subtypes of Stage types can be created at this parent stage, so the current {$lang->executionCommon} cannot be restored."; +$lang->action->hasOtherType['kanban'] = "Only subtypes of Stage types can be created at this parent stage, so the current Kanban cannot be restored."; + $lang->action->repeatChange = '%s with the same name and code already exists in the system, After recovery, the name are \"%s\",the code are \"%s\".'; $lang->action->nameRepeatChange = '%s with the same name already exists in the system, After recovery, the name are \"%s\".'; $lang->action->codeRepeatChange = '%s with the same code already exists in the system, After recovery, the code are \"%s\".'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 01fa888374..60f0f61ab0 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = 'Restoring this phase requires restoring the $lang->action->hasChangedAttr = "After recovery, the phase type will be adjusted to '%s' according to the parent phase type."; $lang->action->whetherToRestore = 'Confirm to restore?'; +$lang->action->hasOtherType = array(); +$lang->action->hasOtherType['stage'] = "Only subtypes of {$lang->executionCommon} / Kanban types can be created at this parent stage, so the current stage cannot be restored."; +$lang->action->hasOtherType['sprint'] = "Only subtypes of Stage types can be created at this parent stage, so the current {$lang->executionCommon} cannot be restored."; +$lang->action->hasOtherType['kanban'] = "Only subtypes of Stage types can be created at this parent stage, so the current Kanban cannot be restored."; + $lang->action->repeatChange = '%s with the same name and code already exists in the system, After recovery, the name are \"%s\",the code are \"%s\".'; $lang->action->nameRepeatChange = '%s with the same name already exists in the system, After recovery, the name are \"%s\".'; $lang->action->codeRepeatChange = '%s with the same code already exists in the system, After recovery, the code are \"%s\".'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 7680a7488a..634551857f 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -63,6 +63,11 @@ $lang->action->hasDeletedParent = '恢复该阶段需要同时恢复已删除 $lang->action->hasChangedAttr = '恢复后阶段类型将根据父阶段类型均调整为“%s”,'; $lang->action->whetherToRestore = '是否恢复?'; +$lang->action->hasOtherType = array(); +$lang->action->hasOtherType['stage'] = "当前阶段的父级现在只允许创建{$lang->executionCommon}/看板类型的子级,故无法恢复当前阶段。"; +$lang->action->hasOtherType['sprint'] = "当前{$lang->executionCommon}的父级现在只允许创建阶段类型的子级,故无法恢复当前{$lang->executionCommon}。"; +$lang->action->hasOtherType['kanban'] = "当前看板的父级现在只允许创建阶段类型的子级,故无法恢复当前看板。"; + $lang->action->repeatChange = '系统内已有同名、同代号的%s,恢复后名称为\"%s\"、代号为\"%s\"。'; $lang->action->nameRepeatChange = '系统内已有同名的%s,恢复后名称为\"%s\"。'; $lang->action->codeRepeatChange = '系统内已有同代号的%s,恢复后代号为\"%s\"。'; diff --git a/module/programplan/config.php b/module/programplan/config.php index 8fdbe078b2..3136c4559d 100644 --- a/module/programplan/config.php +++ b/module/programplan/config.php @@ -58,10 +58,10 @@ $config->programplan->customCreateFields = 'PM,percent,attribute,acl,milestone,r $config->programplan->custom = new stdclass(); $config->programplan->custom->createFields = 'PM,percent,attribute,acl,milestone'; -$config->programplan->customAgilePlusCreateFields = 'PM,milestone,acl,desc'; +$config->programplan->customAgilePlusCreateFields = 'PM,milestone,acl,desc,attribute'; $config->programplan->customAgilePlus = new stdclass(); -$config->programplan->customAgilePlus->createFields = 'PM,milestone,acl,desc'; +$config->programplan->customAgilePlus->createFields = 'PM,milestone,acl,desc,attribute'; $config->programplan->custom->customGanttFields = 'PM,deadline,status,realBegan,realEnd,progress,taskProgress,estimate,consumed,delay,delayDays'; $config->programplan->ganttCustom = new stdclass(); diff --git a/module/programplan/control.php b/module/programplan/control.php index c862db743f..fa962f44f0 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -168,13 +168,13 @@ class programplan extends control $executions = !empty($planID) ? $this->loadModel('execution')->getChildExecutions($planID) : array(); $plans = $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent'); - if(!empty($planID) and !empty($plans)) + if(!empty($planID) and !empty($plans) and $project->model == 'waterfallplus') { $executionType = 'stage'; unset($this->lang->programplan->typeList['agileplus']); } - if(!empty($planID) and !empty($executions) and empty($plans)) + if(!empty($planID) and !empty($executions) and empty($plans) and $project->model == 'waterfallplus') { $executionType = 'agileplus'; unset($this->lang->programplan->typeList['stage']); @@ -208,7 +208,7 @@ class programplan extends control $this->view->productID = $productID ? $productID : key($productList); $this->view->stages = empty($planID) ? $this->loadModel('stage')->getStages('id_asc') : array(); $this->view->programPlan = $programPlan; - $this->view->plans = empty($executions) ? $this->programplan->getStage($planID ? $planID : $projectID, $this->productID, 'parent', 'order_asc') : $executions; + $this->view->plans = empty($executions) ? $plans : $executions; $this->view->planID = $planID; $this->view->type = 'lists'; $this->view->executionType = $executionType; diff --git a/module/programplan/view/create.html.php b/module/programplan/view/create.html.php index 4b6448a348..6dbe87463f 100644 --- a/module/programplan/view/create.html.php +++ b/module/programplan/view/create.html.php @@ -43,7 +43,7 @@