diff --git a/module/branch/lang/zh-cn.php b/module/branch/lang/zh-cn.php index 0d571b9252..3310b5bb14 100644 --- a/module/branch/lang/zh-cn.php +++ b/module/branch/lang/zh-cn.php @@ -3,6 +3,7 @@ $lang->branch->common = '分支'; $lang->branch->manage = '分支管理'; $lang->branch->delete = '分支删除'; -$lang->branch->all = '所有'; +$lang->branch->manageTitle = '%s管理'; +$lang->branch->all = '所有'; $lang->branch->confirmDelete = '分支删除,会影响关联该分支的需求、模块、计划、发布、Bug、用例等等,请慎重考虑。是否删除改分支?'; diff --git a/module/branch/model.php b/module/branch/model.php index 834b79e34f..7ef8595578 100644 --- a/module/branch/model.php +++ b/module/branch/model.php @@ -18,9 +18,14 @@ class branchModel extends model * @access public * @return string */ - public function getById($branchID) + public function getById($branchID, $productID = 0) { - if(empty($branchID)) return $this->lang->branch->all; + if(empty($branchID)) + { + if(empty($productID)) $productID = $this->session->product; + $product = $this->loadModel('product')->getById($productID); + return $this->lang->branch->all . $this->lang->product->branchName[$product->type]; + } return $this->dao->select('*')->from(TABLE_BRANCH)->where('id')->eq($branchID)->fetch('name'); } @@ -35,7 +40,11 @@ class branchModel extends model public function getPairs($productID, $params = '') { $branches = $this->dao->select('*')->from(TABLE_BRANCH)->where('product')->eq($productID)->andWhere('deleted')->eq(0)->orderBy('id_asc')->fetchPairs('id', 'name'); - if(strpos($params, 'noempty') === false) $branches = array('0' => $this->lang->branch->all) + $branches; + if(strpos($params, 'noempty') === false) + { + $product = $this->loadModel('product')->getById($productID); + $branches = array('0' => $this->lang->branch->all . $this->lang->product->branchName[$product->type]) + $branches; + } return $branches; } @@ -77,11 +86,12 @@ class branchModel extends model public function getByProducts($products, $params = '') { $branches = $this->dao->select('*')->from(TABLE_BRANCH)->where('product')->in($products)->andWhere('deleted')->eq(0)->fetchAll(); + $products = $this->loadModel('product')->getByIdList($products); $branchGroups = array(); foreach($branches as $branch) { - if(!isset($branchGroups[$branch->product]) and strpos($params, 'noempty') === false) $branchGroups[$branch->product][0] = $this->lang->branch->all; + if(!isset($branchGroups[$branch->product]) and strpos($params, 'noempty') === false) $branchGroups[$branch->product][0] = $this->lang->branch->all . $this->lang->product->branchName[$products[$branch->product]->type]; $branchGroups[$branch->product][$branch->id] = $branch->name; } diff --git a/module/branch/view/manage.html.php b/module/branch/view/manage.html.php index 08950c3312..db9aa993db 100644 --- a/module/branch/view/manage.html.php +++ b/module/branch/view/manage.html.php @@ -13,7 +13,7 @@