* Fix bug.

This commit is contained in:
hufangzhou
2023-02-09 15:15:44 +08:00
parent 0d8410cdca
commit 6f10625f57
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -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));
}
}
+1 -1
View File
@@ -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();