diff --git a/module/programplan/control.php b/module/programplan/control.php index 1d11bb6cf9..5868e95c40 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -346,21 +346,22 @@ class programplan extends control * AJAX: Get attributes. * * @param int $stageID + * @param string $attribute * @access public * @return int */ - public function ajaxGetAttribute($stageID) + public function ajaxGetAttribute($stageID, $attribute) { $this->app->loadLang('stage'); - $attribute = $this->dao->select('attribute')->from(TABLE_EXECUTION)->where('id')->eq($stageID)->fetch('attribute'); - if(empty($attribute) or $attribute == 'mix') + $parentAttribute = $this->dao->select('attribute')->from(TABLE_EXECUTION)->where('id')->eq($stageID)->fetch('attribute'); + if(empty($parentAttribute) or $parentAttribute == 'mix') { return print(html::select('attribute', $this->lang->stage->typeList, $attribute, "class='form-control chosen'")); } else { - return print(zget($this->lang->stage->typeList, $attribute)); + return print(zget($this->lang->stage->typeList, $parentAttribute)); } } diff --git a/module/programplan/js/edit.js b/module/programplan/js/edit.js index 0eb9d72561..7533b4c016 100644 --- a/module/programplan/js/edit.js +++ b/module/programplan/js/edit.js @@ -1,6 +1,6 @@ function changeParentStage(stageID) { - $.get(createLink('programplan', 'ajaxGetAttribute', 'stageID=' + stageID), function(attribute) + $.get(createLink('programplan', 'ajaxGetAttribute', 'stageID=' + stageID + '&attribute=' + plan.attribute), function(attribute) { $('#attributeType td').html(attribute); $("#attribute" + "_chosen").remove();