* Refactor link product of the create execution.

This commit is contained in:
tianshujie
2023-06-28 16:49:08 +08:00
parent d5a4abf0f3
commit 6effa67db4
5 changed files with 20 additions and 17 deletions
+10 -8
View File
@@ -1651,12 +1651,14 @@ class execution extends control
$importPlanStoryTips = $multiBranchProduct ? $this->lang->execution->importBranchPlanStory : $this->lang->execution->importPlanStory;
return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID&copyExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
$confirmURL = inlink('create', "projectID=$projectID&executionID=$executionID&copyExecutionID=&planID=$planID&confirm=yes");
$cancelURL = inlink('create', "projectID=$projectID&executionID=$executionID");
return $this->send(array('result' => 'success', 'load' => array('confirm' => $importPlanStoryTips, 'confirmed' => $confirmURL, 'canceled' => $cancelURL)));
}
}
if(!empty($projectID) and $execution->type == 'kanban' and $this->app->tab == 'project') return $this->send(array('result' => 'success', 'locate' => $this->createLink('project', 'index', "projectID=$projectID")));
if(!empty($projectID) and $execution->type == 'kanban') return $this->send(array('result' => 'success', 'locate' => inlink('kanban', "executionID=$executionID")));
if(!empty($projectID) and $execution->type == 'kanban' and $this->app->tab == 'project') return $this->send(array('result' => 'success', 'load' => $this->createLink('project', 'index', "projectID=$projectID")));
if(!empty($projectID) and $execution->type == 'kanban') return $this->send(array('result' => 'success', 'load' => inlink('kanban', "executionID=$executionID")));
$this->execution->setMenu($executionID); // Fix bug #22897.
@@ -1742,7 +1744,7 @@ class execution extends control
if($this->app->tab == 'doc')
{
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('doc', 'projectSpace', "objectID=$executionID")));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $this->createLink('doc', 'projectSpace', "objectID=$executionID")));
}
if(!empty($projectID) and strpos(',kanban,agileplus,waterfallplus,', ",$project->model,") !== false)
@@ -1753,7 +1755,7 @@ class execution extends control
if(!empty($_POST['plans']))
{
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID&copyExecutionID=&planID=1&confirm=no")));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('create', "projectID=$projectID&executionID=$executionID&copyExecutionID=&planID=1&confirm=no")));
}
else
{
@@ -1762,11 +1764,11 @@ class execution extends control
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$link = $this->config->vision != 'lite' ? $this->createLink('project', 'index', "projectID=$projectID") : $this->createLink('project', 'execution', "status=all&projectID=$projectID");
if($this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
if($this->app->tab == 'project') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => $link));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('kanban', "executionID=$executionID")));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('kanban', "executionID=$executionID")));
}
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('create', "projectID=$projectID&executionID=$executionID")));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('create', "projectID=$projectID&executionID=$executionID")));
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
.methodTip {width: 200px !important;}
#lifeTimeTips {padding-left: 1rem; align-items: center;}
.team-hr {margin-top: 0 !important;}
#productsBox .line-btn {width: 48px; margin-right: 32px;}
.productsBox .line-btn {width: 48px; margin-right: 32px;}
#copyExecutionModal .modal-dialog {max-height: unset;}
#copyExecutionModal .copy-title {min-width: 130px;}
+4 -4
View File
@@ -258,16 +258,16 @@ function hidePlanBox(attribute)
{
if(attribute == 'request' || attribute == 'review')
{
$('#productsBox .planBox').addClass('hidden');
$('#productsBox .planBox select').attr('disabled', 'disabled');
$('.productsBox .planBox').addClass('hidden');
$('.productsBox .planBox select').attr('disabled', 'disabled');
$('#plansBox').closest('.form-row').addClass('hidden');
$('#plansBox').attr('disabled', 'disabled');
}
else
{
$('#productsBox .planBox').removeClass('hidden');
$('#productsBox .planBox select').removeAttr('disabled');
$('.productsBox .planBox').removeClass('hidden');
$('.productsBox .planBox select').removeAttr('disabled');
$('#plansBox').closest('.form-row').removeClass('hidden');
$('#plansBox').removeAttr('disabled');
+1 -1
View File
@@ -23,7 +23,7 @@ $(function()
let existedBranch = false;
/* Determine whether the products of the same branch are linked. */
$("#productsBox select[name^='products']").each(function()
$(".productsBox select[name^='products']").each(function()
{
let productID = $(this).val();
if(typeof(products[productID]) == 'undefined') products[productID] = new Array();
+4 -3
View File
@@ -102,7 +102,7 @@ if(isset($project->hasProduct) and !empty($project->hasProduct) and $products)
$productsBox[] = formRow
(
set::id('productsBox'),
set::class('productsBox'),
formGroup
(
set::width($hasBranch ? '1/4' : '1/2'),
@@ -159,7 +159,8 @@ if(isset($project->hasProduct) and !empty($project->hasProduct) and $products)
(
set::name("plans[$product->id][]"),
set::items($plans),
set::value($planID)
set::value($planID),
set::multiple(true)
)
),
$isStage && $project->stageBy == 'project' ? null : div
@@ -209,7 +210,7 @@ else
{
$productsBox [] = formRow
(
set::id('productsBox'),
set::class('productsBox'),
formGroup
(
set::width('1/2'),