* Fix bug #41440.
This commit is contained in:
@@ -1,48 +1,8 @@
|
||||
$(function()
|
||||
$(document).off('click', '#involved').on('click', '#involved', function()
|
||||
{
|
||||
$(document).on('click', '#involved', function()
|
||||
{
|
||||
var involved = $(this).prop('checked') ? 1 : 0;
|
||||
$.cookie.set('involved', involved, {expires:config.cookieLife, path:config.webRoot});
|
||||
loadCurrentPage();
|
||||
});
|
||||
|
||||
$(document).on('click', '#link2Project #saveButton', function()
|
||||
{
|
||||
var $link2Project = $(this).closest('#link2Project');
|
||||
var selectProjectID = $link2Project.find('#project').val();
|
||||
var currentProductID = $link2Project.find('#product').val();
|
||||
var currentBranchID = $link2Project.find('#branch').val();
|
||||
|
||||
$.get($.createLink('project', 'ajaxGetLinkedProducts', 'projectID=' + selectProjectID), function(product)
|
||||
{
|
||||
var products = [];
|
||||
var branches = [];
|
||||
|
||||
var linkedProducts = JSON.parse(product);
|
||||
for(var productID in linkedProducts)
|
||||
{
|
||||
for(var branchID in linkedProducts[productID])
|
||||
{
|
||||
products.push(productID);
|
||||
branches.push(branchID);
|
||||
}
|
||||
}
|
||||
|
||||
products.push(currentProductID);
|
||||
branches.push(currentBranchID);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('products', products);
|
||||
formData.append('branch', branches);
|
||||
|
||||
$.ajaxSubmit({
|
||||
url: $.createLink('project', 'manageProducts', 'projectID=' + selectProjectID),
|
||||
data: formData,
|
||||
load: true
|
||||
});
|
||||
});
|
||||
});
|
||||
var involved = $(this).prop('checked') ? 1 : 0;
|
||||
$.cookie.set('involved', involved, {expires:config.cookieLife, path:config.webRoot});
|
||||
loadCurrentPage();
|
||||
});
|
||||
|
||||
window.renderCustomCell = function(result, {col, row})
|
||||
@@ -53,3 +13,41 @@ window.renderCustomCell = function(result, {col, row})
|
||||
if(col.name == 'status') result = [row.data.statusTitle];
|
||||
return result;
|
||||
}
|
||||
|
||||
window.link2Project = function(e)
|
||||
{
|
||||
let $link2Project = $(e.target).closest('#link2Project');
|
||||
let selectProjectID = $link2Project.find('#project').val();
|
||||
let currentProductID = $link2Project.find('#product').val();
|
||||
let currentBranchID = $link2Project.find('#branch').val();
|
||||
console.log('')
|
||||
|
||||
$.get($.createLink('project', 'ajaxGetLinkedProducts', 'projectID=' + selectProjectID), function(product)
|
||||
{
|
||||
var products = [];
|
||||
var branches = [];
|
||||
|
||||
var linkedProducts = JSON.parse(product);
|
||||
for(var productID in linkedProducts)
|
||||
{
|
||||
for(var branchID in linkedProducts[productID])
|
||||
{
|
||||
products.push(productID);
|
||||
branches.push(branchID);
|
||||
}
|
||||
}
|
||||
|
||||
products.push(currentProductID);
|
||||
branches.push(currentBranchID);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('products', products);
|
||||
formData.append('branch', branches);
|
||||
|
||||
$.ajaxSubmit({
|
||||
url: $.createLink('project', 'manageProducts', 'projectID=' + selectProjectID),
|
||||
data: formData,
|
||||
load: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ modal
|
||||
set::title($lang->product->link2Project),
|
||||
set::footerClass('form-actions'),
|
||||
setData('size', '500px'),
|
||||
on::click('#saveButton', 'link2Project(e)'),
|
||||
to::footer
|
||||
(
|
||||
btn(setClass('primary'), set::id('saveButton'), $lang->save),
|
||||
|
||||
Reference in New Issue
Block a user