* Fix bug#45287.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
window.setModuleByBranch = function(e)
|
||||
window.setModuleAndPlanByBranch = function(e)
|
||||
{
|
||||
const $branch = $(e.target);
|
||||
const branchID = $branch.val();
|
||||
@@ -19,4 +19,20 @@ window.setModuleByBranch = function(e)
|
||||
$row = $row.next('tr');
|
||||
if(!$row.find('td[data-name="module"][data-ditto="on"]').length) break;
|
||||
}
|
||||
|
||||
var planLink = $.createLink('productPlan', 'ajaxGetProductPlans', 'productID=' + productID + '&branch=' + branchID);
|
||||
let $rows = $branch.closest('tr');
|
||||
while($rows.length)
|
||||
{
|
||||
const $planPicker = $rows.find('[name^=plan]').zui('picker');
|
||||
const planID = $rows.find('[name^=plan]').val();
|
||||
$.getJSON(planLink, function(data)
|
||||
{
|
||||
$planPicker.render({items: data})
|
||||
$planPicker.$.setValue(planID);
|
||||
});
|
||||
|
||||
$rows = $rows.next('tr');
|
||||
if(!$rows.find('td[data-name="plan"][data-ditto="on"]').length) break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ $fnGenerateFields = function() use ($lang, $fields, $stories, $customFields, $sh
|
||||
formBatchPanel
|
||||
(
|
||||
setID('dataform'),
|
||||
on::change('[data-name="branch"]', 'setModuleByBranch'),
|
||||
on::change('[data-name="branch"]', 'setModuleAndPlanByBranch'),
|
||||
$stories ? set::data($stories) : null,
|
||||
set::ajax(array('beforeSubmit' => jsRaw('clickSubmit'))),
|
||||
set::title($storyID ? $storyTitle . $lang->colon . $this->lang->story->subdivide : $this->lang->story->batchCreate),
|
||||
|
||||
Reference in New Issue
Block a user