* Fix bug #16190.
This commit is contained in:
@@ -970,12 +970,27 @@ class product extends control
|
||||
* @param int $planID
|
||||
* @param bool $needCreate
|
||||
* @param string $expired
|
||||
* @param string $from
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetPlans($productID, $branch = 0, $planID = 0, $fieldID = '', $needCreate = false, $expired = '')
|
||||
public function ajaxGetPlans($productID, $branch = 0, $planID = 0, $fieldID = '', $needCreate = false, $expired = '', $from = '')
|
||||
{
|
||||
$plans = $this->loadModel('productplan')->getPairs($productID, $branch, $expired);
|
||||
$loadModel('productplan');
|
||||
if($from == 'story' and $branch == BRANCH_MAIN)
|
||||
{
|
||||
$plans = $this->productplan->getPairs($productID, '', $expired);
|
||||
}
|
||||
elseif($from == 'story' and $branch)
|
||||
{
|
||||
$plans = $this->productplan->getPairs($productID, 0, $expired);
|
||||
$plans += $this->productplan->getPairs($productID, $branch, $expired);
|
||||
}
|
||||
else
|
||||
{
|
||||
$plans = $this->productplan->getPairs($productID, $branch, $expired);
|
||||
}
|
||||
|
||||
$field = $fieldID ? "plans[$fieldID]" : 'plan';
|
||||
$output = html::select($field, $plans, $planID, "class='form-control chosen'");
|
||||
if(count($plans) == 1 and $needCreate)
|
||||
|
||||
@@ -34,7 +34,7 @@ function loadBranches(product, branch, storyID)
|
||||
$('#modules' + storyID).parent('td').load(moduleLink, function(){$('#modules' + storyID).chosen();});
|
||||
|
||||
planID = $('#plans' + storyID).val();
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + product + '&branch=' + branch + '&planID=' + planID + '&fieldID=' + storyID);
|
||||
planLink = createLink('product', 'ajaxGetPlans', 'productID=' + product + '&branch=' + branch + '&planID=' + planID + '&fieldID=' + storyID + '&needCreate=false&expired=&from=story');
|
||||
$('#plans' + storyID).parent('td').load(planLink, function(){$('#plans' + storyID).chosen();});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user