* Code for task#45536.

This commit is contained in:
xieqiyu
2021-12-10 13:11:37 +08:00
parent ad8ed52f22
commit c33000b578
5 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ $(function()
var currentProductID = $('#product').val();
var currentBranchID = $('#branch').val();
$.get(createLink('project', 'ajaxGetLinkedProductsWithBranch', 'projectID=' + selectProjectID), function(product)
$.get(createLink('project', 'ajaxGetLinkedProducts', 'projectID=' + selectProjectID), function(product)
{
var products = [];
var branches = [];
+3 -3
View File
@@ -72,11 +72,11 @@ function getPlanID(obj, branch)
{
$("#project").attr('disabled', true);
$("#project").trigger('chosen:updated');
$("#project").closest('td').append("<span style='color: red'>" + noLinkedProject + "</span>");
$(".tips").removeClass('hidden');
var locateLink = createLink('product', 'project', 'status=all&productID=' + productID);
var locateButton = "<a href=" + locateLink + " class='btn btn-primary' data-app='product'>" + enterProjectList + "</a>";
$(".btn-primary").replaceWith(locateButton);
};
$("#projects .btn-primary").replaceWith(locateButton);
}
});
}
+2
View File
@@ -85,6 +85,8 @@ $lang->productplan->errorNoEnd = 'ID %s end time should not be empty.';
$lang->productplan->beginGeEnd = 'ID %s begin time should not be >= end time.';
$lang->productplan->beginLetterParent = "The start date of the parent plan: %s, the start date cannot be less than the start date of the parent plan.";
$lang->productplan->endGreaterParent = "The completion date of the parent plan: %s, the completion date cannot be greater than the completion date of the parent plan.";
$lang->productplan->noLinkedProject = "The current product has not been linked with a project. Please enter the list of the product to link or create a project.";
$lang->productplan->enterProjectList = "Enter the list of the product";
$lang->productplan->featureBar['browse']['all'] = 'All';
$lang->productplan->featureBar['browse']['unexpired'] = 'Unexpired';
+4
View File
@@ -193,6 +193,10 @@
<th><?php echo $lang->productplan->project?></th>
<td><?php echo html::select('project', $projects, '', "class='form-control chosen'");?></td>
</tr>
<tr class='tips hidden'>
<th></th>
<td><span class='text-red'><?php echo $lang->productplan->noLinkedProject;?></span></td>
</tr>
<tr>
<td colspan='2' class='text-center'>
<?php echo html::hidden('planID', '');?>
+4 -4
View File
@@ -215,13 +215,13 @@ class project extends control
}
/**
* Ajax get linked products with branch.
* AJAX: Get linked products with branch.
*
* @param int $projectID
* @param int $projectID
* @access public
* @return void
*/
public function ajaxGetLinkedProductsWithBranch($projectID)
public function ajaxGetLinkedProducts($projectID)
{
$productsWithBranch = array();
$linkedProducts = $this->project->getBranchesByProject($projectID);
@@ -230,7 +230,7 @@ class project extends control
foreach($branches as $branchID => $branchInfo) $productsWithBranch[$productID][$branchID] = $branchID;
}
die(json_encode($productsWithBranch));
echo json_encode($productsWithBranch);
}
/**