This commit is contained in:
tianshujie
2021-11-11 15:20:01 +08:00
parent 15196aca58
commit 4f4b683dbd
2 changed files with 18 additions and 3 deletions
+17 -2
View File
@@ -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)
+1 -1
View File
@@ -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();});
}