* finish task #53651.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
function changeProject(obj, executionID, projectID)
|
||||
{
|
||||
var $td = $(obj).closest('td');
|
||||
|
||||
if($td.find('[id^="syncStories"]').length == 0)
|
||||
{
|
||||
$td.append("<input type='hidden' id='syncStories" + executionID + "' name='syncStories[" + executionID + "]' value='no' />");
|
||||
}
|
||||
|
||||
var confirmVal = confirm(confirmSync);
|
||||
$("#syncStories" + executionID).val(confirmVal ? 'yes' : 'no');
|
||||
|
||||
if(!confirmVal)
|
||||
{
|
||||
$(obj).val(projectID).trigger("chosen:updated");
|
||||
|
||||
+17
-10
@@ -63,14 +63,21 @@ $(function()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
oldProject = $("#project").val();
|
||||
$('#project').change(function()
|
||||
{
|
||||
if($('#submit').closest('td').find('#syncStories').length == 0)
|
||||
{
|
||||
$('#submit').after("<input type='hidden' id='syncStories' name='syncStories' value='no' />");
|
||||
}
|
||||
$("#syncStories").val(confirm(confirmSyncStories) ? 'yes' : 'no');
|
||||
});
|
||||
})
|
||||
|
||||
function changeProject(projectID)
|
||||
{
|
||||
if($('#submit').closest('td').find('#syncStories').length == 0)
|
||||
{
|
||||
$('#submit').after("<input type='hidden' id='syncStories' name='syncStories' value='no' />");
|
||||
}
|
||||
|
||||
var confirmVal = confirm(confirmSync);
|
||||
$("#syncStories").val(confirmVal ? 'yes' : 'no');
|
||||
|
||||
if(!confirmVal)
|
||||
{
|
||||
$('#project').val(projectID).trigger("chosen:updated");
|
||||
console.log($('#project').val(projectID));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -565,6 +565,27 @@ class executionModel extends model
|
||||
/* Fix bug#3074, Update views for team members. */
|
||||
if($execution->acl != 'open') $this->updateUserView($executionID, 'sprint', $changedAccounts);
|
||||
|
||||
if(isset($execution->project))
|
||||
{
|
||||
$executionProductList = $this->loadModel('product')->getProducts($executionID);
|
||||
$projectProductList = $this->product->getProducts($execution->project);
|
||||
$executionProductIdList = array_keys($executionProductList);
|
||||
$projectProductIdList = array_keys($projectProductList);
|
||||
$diffProductIdList = array_diff($executionProductIdList, $projectProductIdList);
|
||||
if(!empty($diffProductIdList))
|
||||
{
|
||||
foreach($diffProductIdList as $key => $newProductID)
|
||||
{
|
||||
$data = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)
|
||||
->where('project')->eq($executionID)
|
||||
->andWhere('product')->eq($newProductID)
|
||||
->fetch();
|
||||
$data->project = $execution->project;
|
||||
$this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
if(isset($execution->project) and $execution->project != $oldExecution->project)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<tr>
|
||||
<th class='w-120px'><?php echo $lang->execution->projectName;?></th>
|
||||
<td><?php echo html::select('project', $allProjects, $execution->project, "class='form-control chosen' required");?></td><td></td>
|
||||
<td><?php echo html::select('project', $allProjects, $execution->project, "class='form-control chosen' onchange='changeProject($execution->project)' required");?></td><td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
@@ -220,6 +220,6 @@
|
||||
<?php js::set('unmodifiableBranches', $unmodifiableBranches)?>
|
||||
<?php js::set('multiBranchProducts', $multiBranchProducts);?>
|
||||
<?php js::set('tip', $lang->execution->notAllowRemoveProducts);?>
|
||||
<?php js::set('confirmSyncStories', $lang->execution->confirmSyncStories);?>
|
||||
<?php js::set('confirmSync', $lang->execution->confirmSync);?>
|
||||
<?php js::set('systemMode', $config->systemMode);?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user