products = $this->product->getProductPairsByProject($projectID); if(empty($this->products)) $this->locate($this->createLink('product', 'showErrorNone', 'moduleName=project&activeMenu=projectrelease&projectID=' . $projectID)); /* 获取当前的产品。*/ /* Get current product. */ if(!$productID) $productID = key($this->products); $this->loadModel('product')->checkAccess($productID, $this->products); $product = $this->product->getByID($productID); $this->view->products = $this->products; $this->view->product = $product; $this->view->branches = (isset($product->type) and $product->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID, 'active', $projectID); $this->view->branch = $branch; $this->view->project = $this->project->getByID($projectID); } }