* Fix bug#17503.

This commit is contained in:
xieqiyu
2021-12-14 14:27:26 +08:00
parent efdadc07a7
commit ed9eedf543
2 changed files with 11 additions and 10 deletions
+3 -8
View File
@@ -223,15 +223,10 @@ class productplan extends control
$sort = $this->loadModel('common')->appendOrder($orderBy);
$this->session->set('productPlanList', $this->app->getURI(true), 'product');
if(isset($products[$productID])) $productName = $products[$productID];
if(!isset($products[$productID]))
{
$product = $this->loadModel('product')->getById($productID);
$productName = empty($product) ? '' : $product->name;
}
$this->commonAction($productID, $branch);
$products = $this->product->getPairs();
$product = $this->loadModel('product')->getById($productID);
$productName = empty($product) ? '' : $product->name;
$this->view->title = $productName . $this->lang->colon . $this->lang->productplan->browse;
$this->view->position[] = $this->lang->productplan->browse;
$this->view->productID = $productID;
+8 -2
View File
@@ -133,9 +133,15 @@
$attr = $plan->expired ? "disabled='disabled'" : '';
if(common::hasPriv('execution', 'create', $plan) and $plan->parent >= 0)
{
$branchStatus = $this->branch->getByID($plan->branch, 0, 'status');
$disabled = $branchStatus == 'closed' ? 'disabled' : '';
$disabled = '';
$executionLink = $config->systemMode == 'new' ? '#projects' : $this->createLink('execution', 'create', "projectID=0&executionID=0&copyExecutionID=0&plan=$plan->id&confirm=no&productID=$productID");
if($product->type != 'normal')
{
$branchStatus = $this->branch->getByID($plan->branch, 0, 'status');
$disabled = $branchStatus == 'closed' ? 'disabled' : '';
}
if($config->systemMode == 'new')
{
echo html::a($executionLink, '<i class="icon-plus"></i>', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this, $plan->branch)' class='btn {$disabled}' title='{$lang->productplan->createExecution}' $attr");