* Fix bug of task #83954.
This commit is contained in:
@@ -372,7 +372,7 @@ class action extends control
|
||||
/* Check parent stage isCreateTask. */
|
||||
$execution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($action->objectID)->fetch();
|
||||
$hasCreatedTask = $this->loadModel('programplan')->isCreateTask($execution->parent);
|
||||
if(!$hasCreatedTask) return print(js::alert($this->lang->action->hasCreatedTask));
|
||||
if(!$hasCreatedTask) die(js::alert($this->lang->action->hasCreatedTask));
|
||||
|
||||
/* If parent stage is not exists, you should recover its parent stages, refresh status. */
|
||||
$stagePathList = explode(',', trim($execution->path, ','));
|
||||
@@ -407,7 +407,8 @@ class action extends control
|
||||
{
|
||||
$this->app->loadLang('stage');
|
||||
|
||||
$confirmLang = sprintf($this->lang->action->hasDeletedParent, trim($deletedTitle, ',')) . $this->lang->action->whetherToRestore;
|
||||
$deletedTitle = trim($deletedTitle, ',');
|
||||
$confirmLang = sprintf($this->lang->action->hasDeletedParent, $deletedTitle) . $this->lang->action->whetherToRestore;
|
||||
if($needChangeAttr) $confirmLang = sprintf($this->lang->action->hasChangedAttr, zget($this->lang->stage->typeList, $parentAttr)) . $this->lang->action->whetherToRestore;
|
||||
if(!empty($deletedTitle) and $needChangeAttr) $confirmLang = sprintf($this->lang->action->hasDeletedParent, $deletedTitle) . sprintf($this->lang->action->hasChangedAttr, zget($this->lang->stage->typeList, $parentAttr)) . $this->lang->action->whetherToRestore;
|
||||
|
||||
@@ -418,7 +419,12 @@ class action extends control
|
||||
else
|
||||
{
|
||||
if(!empty($deletedTitle)) $this->action->restoreStages($deletedParents);
|
||||
if($needChangeAttr) $this->programplan->updateSubStageAttr($startChangedStage->parent, $parentAttr, true);
|
||||
if($needChangeAttr)
|
||||
{
|
||||
$needChangedStages = substr($execution->path, strpos($execution->path, ",{$startChangedStage->id},"));
|
||||
$needChangedStages = explode(',', trim($needChangedStages, ','));
|
||||
$this->dao->update(TABLE_EXECUTION)->set('attribute')->eq($parentAttr)->where('id')->in($needChangedStages)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -275,6 +275,7 @@ class programplan extends control
|
||||
$this->view->parentStageList = $this->programplan->getParentStageList($this->session->project, $planID, $plan->product);
|
||||
$this->view->enableOptionalAttr = (empty($parentStage) or (!empty($parentStage) and $parentStage->attribute == 'mix'));
|
||||
$this->view->isTopStage = $this->programplan->checkTopStage($planID);
|
||||
$this->view->isLeafStage = $this->programplan->checkLeafStage($planID);
|
||||
$this->view->PMUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst', $plan->PM);
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -50,7 +50,7 @@ $(function()
|
||||
var currentParent = $('#parent').val();
|
||||
var hasChangedAttribute = (currentAttribute && currentAttribute != 'mix' && plan.attribute != currentAttribute);
|
||||
var hasChangedParent = ((isTopStage && $('#parent').val() != 0) || (!isTopStage && plan.parent != $('#parent').val()));
|
||||
if(hasChangedAttribute && !hasChangedParent)
|
||||
if(hasChangedAttribute && !hasChangedParent && !isLeafStage)
|
||||
{
|
||||
var result = confirm(changeAttrLang.replace('%s', stageTypeList[currentAttribute]));
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<?php js::set('stageTypeList', $lang->stage->typeList);?>
|
||||
<?php js::set('changeAttrLang', $lang->programplan->confirmChangeAttr);?>
|
||||
<?php js::set('isTopStage', $isTopStage);?>
|
||||
<?php js::set('isLeafStage', $isLeafStage);?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
<div class="main-header">
|
||||
|
||||
Reference in New Issue
Block a user