diff --git a/module/productplan/control.php b/module/productplan/control.php index f319189190..cb09c8ac81 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -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; diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 9ae112d310..3847f1ca85 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -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©ExecutionID=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, '', '', "data-toggle='modal' data-id='$plan->id' onclick='getPlanID(this, $plan->branch)' class='btn {$disabled}' title='{$lang->productplan->createExecution}' $attr");