* Add param defaule value.

This commit is contained in:
liumengyi
2024-01-19 15:13:27 +08:00
parent ab30c1145e
commit c81ebf583d
4 changed files with 15 additions and 1 deletions
+12
View File
@@ -93,3 +93,15 @@ window.waitDom('[name^=products]', function()
{
if($('.newProductBox').length > 0) productChange($('[name^=products]').eq(0));
});
window.productChange = function(e)
{
let chosenProducts = 0;
$(".productsBox [name^='products']").each(function()
{
if($(e.target).val() > 0) chosenProducts ++;
});
if(chosenProducts > 1) $('.stageByBox').removeClass('hidden');
if(chosenProducts <= 1) $('.stageByBox').addClass('hidden');
}
+1 -1
View File
@@ -1745,7 +1745,7 @@ class projectModel extends model
* @access public
* @return bool
*/
public function updateProducts(int $projectID, array $products = array(), object|array $postProductData): bool
public function updateProducts(int $projectID, array $products = array(), object|array $postProductData = array()): bool
{
$this->loadModel('user');
$teams = array_keys($this->getTeamMembers($projectID));
+1
View File
@@ -71,6 +71,7 @@ $fields->field('productsBox')
if($model == 'waterfall' || $model == 'waterfallplus')
{
$fields->field('stageBy')
->className('stageByBox')
->control('radioListInline')
->labelHint($lang->project->stageByTips)
->label($lang->project->stageBy)
+1
View File
@@ -60,6 +60,7 @@ formGridPanel
on::change('[name=hasProduct]', 'changeType'),
on::change('[name=future]', 'toggleBudget'),
on::change('[name=begin], [name=end]', 'computeWorkDays'),
on::change('[name^=products]', 'productChange'),
on::change('#parent, #budget', "checkBudget(0)"),
set::title($lang->project->create),
set::fullModeOrders(array('begin,days,PM,budget', !empty($config->setCode) ? 'parent,hasProduct,name,code,begin' : 'parent,name,hasProduct,begin')),