Merge branch 'master_xieqiyu_29896' into 'master'

* Fix bug#29896.

See merge request easycorp/zentaopms!6199
This commit is contained in:
孙广明
2022-11-16 08:21:42 +00:00
2 changed files with 4 additions and 1 deletions
+2 -1
View File
@@ -88,6 +88,7 @@ class programModel extends model
$dao = $this->dao->select('id, name, program')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->beginIF($programID !== '')->andWhere('program')->eq($programID)->fi()
->beginIF($shadow !== 'all')->andWhere('shadow')->eq((int)$shadow)->fi()
->beginIF($mode == 'assign')->andWhere('program')->eq($programID)->fi()
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
@@ -99,7 +100,7 @@ class programModel extends model
$productPrograms = $this->dao->select('id, name')->from(TABLE_PROJECT)->where('type')->eq('program')->andWhere('deleted')->eq('0')->fetchPairs();
/* Put products of current program first.*/
if($mode != 'assign' && $programID)
if(!empty($products) and $mode != 'assign' and $programID)
{
$currentProgramProducts = $products[$programID];
unset($products[$programID]);
+2
View File
@@ -160,8 +160,10 @@ function setParentProgram(parentProgram)
var selectedProduct = $(this).find('[name^=products]').val();
var selectedBranch = $(this).find('[name^=branch]').val();
var selectedPlan = $('#plan' + index ).find('[name^=plans]').val();
var newProductHtml = $(this).find('span.input-group-addon');
$(this).html(productSelectHtml);
$(this).append(newProductHtml);
$(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan);
$(this).find('[name^=products]').val(selectedProduct).chosen().change();
});