From da5249b3c754929ecdabc32f2049d049239c745e Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Sat, 25 Jul 2020 20:50:38 -0700 Subject: [PATCH 1/4] * Finish task#7549. --- module/story/control.php | 8 ++++++++ module/story/lang/zh-cn.php | 2 +- module/story/model.php | 9 +-------- module/story/view/batchclose.html.php | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 2a58fdf81b..12ada3ffd5 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -945,6 +945,7 @@ class story extends control { if($this->post->comments) { + $data = fixer::input('post')->get(); $allChanges = $this->story->batchClose(); if($allChanges) @@ -955,6 +956,13 @@ class story extends control $this->action->logHistory($actionID, $changes); } } + + foreach($data->storyParentList as $storyID => $parent) + { + if($parent == -1) $skipStory[$storyID] = $data->storyIdList[$storyID]; + } + if(isset($skipStory)) echo js::alert(sprintf($this->lang->story->parentSkip, join(',', $skipStory))); + if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); die(js::locate($this->session->storyList, 'parent')); } diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 655f0ca508..14a0c2ccbf 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -58,7 +58,7 @@ $lang->story->batchChangeStage = "批量修改阶段"; $lang->story->batchAssignTo = "批量指派"; $lang->story->batchChangeModule = "批量修改模块"; $lang->story->viewAll = '查看全部'; -$lang->story->parentClose = '需求:%s 为父需求,将不会被关闭。'; +$lang->story->parentSkip = '需求:%s 为父需求,将不会被关闭。'; $lang->story->common = $lang->storyCommon; $lang->story->id = '编号'; diff --git a/module/story/model.php b/module/story/model.php index d7263016f3..a4cd949dfc 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1136,11 +1136,10 @@ class storyModel extends model $storyIdList = $data->storyIdList ? $data->storyIdList : array(); $oldStories = $this->getByList($storyIdList); - $parentIdList = array(); foreach($storyIdList as $storyID) { $oldStory = $oldStories[$storyID]; - if($oldStory->parent == -1) $parentIdList[] = $oldStory->id; + if($oldStory->parent == -1) continue; if($oldStory->status == 'closed') continue; $story = new stdclass(); @@ -1163,12 +1162,6 @@ class storyModel extends model unset($story); } - if(count($parentIdList)) - { - $noticeParentID = implode(',', $parentIdList); - die(js::alert(sprintf($this->lang->story->parentClose, $noticeParentID))); - } - foreach($stories as $storyID => $story) { if(!$story->closedReason) continue; diff --git a/module/story/view/batchclose.html.php b/module/story/view/batchclose.html.php index 2815cf19f4..e1812d2256 100755 --- a/module/story/view/batchclose.html.php +++ b/module/story/view/batchclose.html.php @@ -32,6 +32,7 @@ $story):?> + parent);?> title;?> processStatus('story', $story);?> From 69ffb2d3c4f78d42e5f8ba025b333bee9b30130e Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Sun, 26 Jul 2020 14:44:40 +0800 Subject: [PATCH 2/4] * Finish task #7527. --- module/testreport/control.php | 34 ++++++++++++++++---------- module/testreport/js/common.js | 5 ++++ module/testreport/model.php | 14 ++--------- module/testreport/view/create.html.php | 31 ++++++++++++++++++++--- module/testreport/view/edit.html.php | 29 ++++++++++++++++++++-- 5 files changed, 83 insertions(+), 30 deletions(-) diff --git a/module/testreport/control.php b/module/testreport/control.php index 93f290af85..ef45d3ca46 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -117,10 +117,12 @@ class testreport extends control * @param int $objectID * @param string $objectType * @param string $extra + * @param string $begin + * @param string $end * @access public * @return void */ - public function create($objectID = 0, $objectType = 'testtask', $extra = '') + public function create($objectID = 0, $objectType = 'testtask', $extra = '', $begin = '', $end = '') { if($_POST) { @@ -165,8 +167,8 @@ class testreport extends control if($productID != $task->product) die(js::error($this->lang->error->accessDenied) . js::locate('back')); $productIdList[$productID] = $productID; - $begin = $task->begin; - $end = $task->end; + $begin = !empty($begin) ? date("Y-m-d", strtotime($begin)) : $task->begin; + $end = !empty($end) ? date("Y-m-d", strtotime($end)) : $task->end; $project = $this->project->getById($task->project); $builds = array(); if($task->build == 'trunk') @@ -225,8 +227,8 @@ class testreport extends control $builds = $this->build->getByList($buildIdList); $stories = !empty($builds) ? $this->testreport->getStories4Test($builds) : $this->story->getProjectStories($project->id);; - $begin = $project->begin; - $end = $project->end; + $begin = !empty($begin) ? date("Y-m-d", strtotime($begin)) : $project->begin; + $end = !empty($end) ? date("Y-m-d", strtotime($end)) : $project->end; $owner = current($owners); $bugs = $this->testreport->getBugs4Test($builds, $productIdList, $begin, $end, 'project'); @@ -267,6 +269,7 @@ class testreport extends control $this->view->objectID = $objectID; $this->view->objectType = $objectType; + $this->view->extra = $extra; $this->display(); } @@ -278,7 +281,7 @@ class testreport extends control * @access public * @return void */ - public function edit($reportID, $from = 'product') + public function edit($reportID, $from = 'product', $begin = '', $end ='') { if($_POST) { @@ -295,6 +298,8 @@ class testreport extends control $report = $this->testreport->getById($reportID); $project = $this->project->getById($report->project); + $begin = !empty($begin) ? date("Y-m-d", strtotime($begin)) : $report->begin; + $end = !empty($end) ? date("Y-m-d", strtotime($end)) : $report->end; if($from == 'product' and is_numeric($report->product)) { $product = $this->product->getById($report->product); @@ -333,7 +338,7 @@ class testreport extends control $stories = empty($build->stories) ? array() : $this->story->getByList($build->stories); if(!empty($build->id)) $builds[$build->id] = $build; - $bugs = $this->testreport->getBugs4Test($builds, $report->product, $report->begin, $report->end); + $bugs = $this->testreport->getBugs4Test($builds, $report->product, $begin, $end); } $tasks = array($task->id => $task); @@ -346,15 +351,18 @@ class testreport extends control $builds = $this->build->getByList($report->builds); $stories = !empty($builds) ? $this->testreport->getStories4Test($builds) : $this->story->getProjectStories($project->id);; - $bugs = $this->testreport->getBugs4Test($builds, $productIdList, $report->begin, $report->end, 'project'); + $bugs = $this->testreport->getBugs4Test($builds, $productIdList, $begin, $end, 'project'); } - $cases = $this->testreport->getTaskCases($tasks, $report->begin, $report->end); - $bugInfo = $this->testreport->getBugInfo($tasks, $productIdList, $report->begin, $report->end, $builds); + $cases = $this->testreport->getTaskCases($tasks, $begin, $end); + $bugInfo = $this->testreport->getBugInfo($tasks, $productIdList, $begin, $end, $builds); $this->view->title = $report->title . $this->lang->testreport->edit; $this->view->report = $report; + $this->view->from = $from; + $this->view->begin = $begin; + $this->view->end = $end; $this->view->stories = $stories; $this->view->bugs = $bugs; $this->view->project = $project; @@ -366,10 +374,10 @@ class testreport extends control $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted'); $this->view->cases = $cases; - $this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases, $report->begin, $report->end); + $this->view->caseSummary = $this->testreport->getResultSummary($tasks, $cases, $begin, $end); - $perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $cases, $report->begin, $report->end); - $perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $report->begin, $report->end); + $perCaseResult = $this->testreport->getPerCaseResult4Report($tasks, $cases, $begin, $end); + $perCaseRunner = $this->testreport->getPerCaseRunner4Report($tasks, $cases, $begin, $end); $this->view->datas['testTaskPerRunResult'] = $this->loadModel('report')->computePercent($perCaseResult); $this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner); diff --git a/module/testreport/js/common.js b/module/testreport/js/common.js index 98c185744f..cf98a23558 100644 --- a/module/testreport/js/common.js +++ b/module/testreport/js/common.js @@ -10,3 +10,8 @@ $(function() }; resizeChartTable(); }); + +function changeDate() +{ + $("#refresh").removeAttr("style"); +} diff --git a/module/testreport/model.php b/module/testreport/model.php index ce29d7e2bf..2f8c4df39e 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -95,18 +95,13 @@ class testreportModel extends model ->add('createdDate', helper::now()) ->join('stories', ',') ->join('builds', ',') + ->join('bugs', ',') ->join('cases', ',') ->join('members', ',') ->remove('files,labels,uid') ->get(); $data->members = trim($data->members, ','); - $builds = array(); - $build = $this->loadModel('build')->getById($data->builds); - if(!empty($build->id)) $builds[$build->id] = $build; - $bugs = $this->getBugs4Test($builds, $data->product, $data->begin, $data->end); - if(!empty($bugs)) $data->bugs = implode(",", array_keys($bugs)); - $data = $this->loadModel('file')->processImgURL($data, $this->config->testreport->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_TESTREPORT)->data($data)->autocheck() ->batchCheck($this->config->testreport->create->requiredFields, 'notempty') @@ -134,18 +129,13 @@ class testreportModel extends model ->stripTags($this->config->testreport->editor->edit['id'], $this->config->allowedTags) ->join('stories', ',') ->join('builds', ',') + ->join('bugs', ',') ->join('cases', ',') ->join('members', ',') ->remove('files,labels,uid') ->get(); $data->members = trim($data->members, ','); - $builds = array(); - $build = $this->loadModel('build')->getById($data->builds); - if(!empty($build->id)) $builds[$build->id] = $build; - $bugs = $this->getBugs4Test($builds, $data->product, $data->begin, $data->end); - $data->bugs = !empty($bugs) ? implode(",", array_keys($bugs)) : ''; - $data = $this->loadModel('file')->processImgURL($data, $this->config->testreport->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_TESTREPORT)->data($data)->autocheck() ->batchCheck($this->config->testreport->edit->requiredFields, 'notempty') diff --git a/module/testreport/view/create.html.php b/module/testreport/view/create.html.php index 80585a6c07..de68eb26d2 100644 --- a/module/testreport/view/create.html.php +++ b/module/testreport/view/create.html.php @@ -37,10 +37,12 @@ testreport->startEnd?>
- + ~ - - + "?> + refresh?> + "; echo html::hidden('product', $productIdList) . ($config->global->flow != 'onlyTest' ? html::hidden('project', isset($project->id) ? $project->id : 0) : '') . html::hidden('tasks', $tasks); echo html::hidden('objectID', $objectID) . html::hidden('objectType', $objectType); ?> @@ -136,4 +138,27 @@
+ diff --git a/module/testreport/view/edit.html.php b/module/testreport/view/edit.html.php index d71267ec87..3b9ba5f305 100644 --- a/module/testreport/view/edit.html.php +++ b/module/testreport/view/edit.html.php @@ -28,9 +28,12 @@ testreport->startEnd?>
- begin, "class='form-control form-date'")?> + ~ - end, "class='form-control form-date'")?> + + "?> + refresh?> + "?> global->flow != 'onlyTest' ? html::hidden('project', $project->id) : '') . html::hidden('tasks', $tasks);?>
@@ -113,4 +116,26 @@ + From d4d49466b4d275e8797632b41d39fbb39e91911d Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Sun, 26 Jul 2020 21:16:48 +0800 Subject: [PATCH 3/4] * Finish task #7521. --- config/filter.php | 2 ++ module/bug/control.php | 21 ++++++++++++++++----- module/product/control.php | 25 ++++++++++++++++++------- module/product/model.php | 2 +- module/tree/model.php | 2 +- 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/config/filter.php b/config/filter.php index 7e012a7302..1fc570d8dc 100644 --- a/config/filter.php +++ b/config/filter.php @@ -99,6 +99,7 @@ $filter->webhook->bind = new stdclass(); $filter->bug->batchcreate->cookie['preBranch'] = 'int'; $filter->bug->browse->cookie['bugModule'] = 'int'; $filter->bug->browse->cookie['bugBranch'] = 'int'; +$filter->bug->browse->cookie['treeBranch'] = 'int'; $filter->bug->browse->cookie['preBranch'] = 'int'; $filter->bug->browse->cookie['qaBugOrder'] = 'reg::orderBy'; $filter->bug->browse->cookie['windowWidth'] = 'int'; @@ -127,6 +128,7 @@ $filter->product->browse->cookie['preProductID'] = 'int'; $filter->product->browse->cookie['productStoryOrder'] = 'reg::orderBy'; $filter->product->browse->cookie['storyModule'] = 'int'; $filter->product->browse->cookie['storyBranch'] = 'int'; +$filter->product->browse->cookie['treeBranch'] = 'int'; $filter->product->default->cookie['lastProduct'] = 'int'; $filter->product->default->cookie['preProductID'] = 'int'; $filter->product->index->cookie['preBranch'] = 'int'; diff --git a/module/bug/control.php b/module/bug/control.php index 373f1ddaa7..8de1490270 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -77,7 +77,6 @@ class bug extends control /* Set productID, moduleID, queryID and branch. */ $productID = $this->product->saveState($productID, $this->products); $branch = ($branch == '') ? (int)$this->cookie->preBranch : (int)$branch; - $branchID = $browseType == '' ? $branch : ($browseType == 'bybranch' ? (int)$param : ($this->cookie->bugBranch ? $this->cookie->bugBranch : $branch)); setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true); setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true); @@ -91,9 +90,9 @@ class bug extends control setcookie('bugModule', (int)$param, 0, $this->config->webRoot, '', false, false); $_COOKIE['bugBranch'] = 0; setcookie('bugBranch', 0, 0, $this->config->webRoot, '', false, false); - if($browseType == '') $browseType = 'unclosed'; + if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); } - if($browseType == 'bybranch') setcookie('bugBranch', (int)$param, 0, $this->config->webRoot, '', false, false); + if($browseType == 'bybranch') setcookie('bugBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('bugBrowseType', $browseType); $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->bugModule ? $this->cookie->bugModule : 0)); @@ -103,6 +102,18 @@ class bug extends control $this->bug->setMenu($this->products, $productID, $branch, $moduleID, $browseType, $orderBy); $this->session->set('bugList', $this->app->getURI(true)); + /* Set moduleTree. */ + if($browseType == '') + { + setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); + $browseType = 'unclosed'; + $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', $branch); + } + else + { + $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', (int)$this->cookie->treeBranch); + } + /* Process the order by field. */ if(!$orderBy) $orderBy = $this->cookie->qaBugOrder ? $this->cookie->qaBugOrder : 'id_desc'; setcookie('qaBugOrder', $orderBy, 0, $this->config->webRoot, '', false, true); @@ -119,7 +130,7 @@ class bug extends control $projects = $this->loadModel('project')->getPairs('empty|withdelete'); /* Get bugs. */ - $bugs = $this->bug->getBugs($productID, $projects, $branchID, $browseType, $moduleID, $queryID, $sort, $pager); + $bugs = $this->bug->getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager); /* Process the sql, get the conditon partion, save it to session. */ $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true); @@ -157,7 +168,7 @@ class bug extends control $this->view->productName = $this->products[$productID]; $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); $this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); - $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'bug', $startModuleID = 0, array('treeModel', 'createBugLink'), '', $branch); + $this->view->moduleTree = $moduleTree; $this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all; $this->view->summary = $this->bug->summary($bugs); $this->view->browseType = $browseType; diff --git a/module/product/control.php b/module/product/control.php index 508191967e..171e438725 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -116,7 +116,6 @@ class product extends control /* Set product, module and query. */ $productID = $this->product->saveState($productID, $this->products); $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; - $branchID = $browseType == '' ? $branch : ($browseType == 'bybranch' ? (int)$param : ($this->cookie->storyBranch ? $this->cookie->storyBranch : $branch)); setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true); setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true); @@ -125,14 +124,15 @@ class product extends control $_COOKIE['storyModule'] = 0; setcookie('storyModule', 0, 0, $this->config->webRoot, '', false, false); } + if($browseType == 'bymodule' or $browseType == '') { setcookie('storyModule', (int)$param, 0, $this->config->webRoot, '', false, false); $_COOKIE['storyBranch'] = 0; setcookie('storyBranch', 0, 0, $this->config->webRoot, '', false, false); - if($browseType == '') $browseType = 'unclosed'; + if($browseType == '') setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); } - if($browseType == 'bybranch') setcookie('storyBranch', (int)$param, 0, $this->config->webRoot, '', false, false); + if($browseType == 'bybranch') setcookie('storyBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType); $moduleID = ($browseType == 'bymodule') ? (int)$param : (($browseType == 'bysearch' or $browseType == 'bybranch') ? 0 : ($this->cookie->storyModule ? $this->cookie->storyModule : 0)); @@ -141,6 +141,19 @@ class product extends control /* Set menu. */ $this->product->setMenu($this->products, $productID, $branch); + /* Set moduleTree. */ + $createModuleLink = $storyType == 'story' ? 'createStoryLink' : 'createRequirementLink'; + if($browseType == '') + { + setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); + $browseType = 'unclosed'; + $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch); + } + else + { + $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch); + } + /* Process the order by field. */ if(!$orderBy) $orderBy = $this->cookie->productStoryOrder ? $this->cookie->productStoryOrder : 'id_desc'; setcookie('productStoryOrder', $orderBy, 0, $this->config->webRoot, '', false, true); @@ -154,7 +167,7 @@ class product extends control $pager = new pager($recTotal, $recPerPage, $pageID); /* Get stories. */ - $stories = $this->product->getStories($productID, $branchID, $browseType, $queryID, $moduleID, $storyType, $sort, $pager); + $stories = $this->product->getStories($productID, $branch, $browseType, $queryID, $moduleID, $storyType, $sort, $pager); /* Process the sql, get the conditon partion, save it to session. */ $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', $browseType != 'bysearch'); @@ -188,8 +201,6 @@ class product extends control $showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : ''; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array(); - $createModuleLink = $storyType == 'story' ? 'createStoryLink' : 'createRequirementLink'; - /* Assign. */ $this->view->title = $this->products[$productID]. $this->lang->colon . $this->lang->product->browse; $this->view->position[] = $this->products[$productID]; @@ -201,7 +212,7 @@ class product extends control $this->view->stories = $stories; $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $branch); $this->view->summary = $this->product->summary($stories, $storyType); - $this->view->moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch); + $this->view->moduleTree = $moduleTree; $this->view->parentModules = $this->tree->getParents($moduleID); $this->view->pager = $pager; $this->view->users = $this->user->getPairs('noletter|pofirst|nodeleted'); diff --git a/module/product/model.php b/module/product/model.php index 19af388b34..86c235e4d7 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -561,8 +561,8 @@ class productModel extends model /* Set modules and browse type. */ $modules = $moduleID ? $this->loadModel('tree')->getAllChildID($moduleID) : '0'; - $browseType = ($browseType == 'bymodule' and $this->session->storyBrowseType and $this->session->storyBrowseType != 'bysearch') ? $this->session->storyBrowseType : $browseType; $browseType = $browseType == 'bybranch' ? 'bymodule' : $browseType; + $browseType = ($browseType == 'bymodule' and $this->session->storyBrowseType and $this->session->storyBrowseType != 'bysearch') ? $this->session->storyBrowseType : $browseType; /* Get stories by browseType. */ $stories = array(); diff --git a/module/tree/model.php b/module/tree/model.php index f7027d9b94..8b6de3f1ba 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -408,7 +408,7 @@ class treeModel extends model { $linkHtml = ($type == 'case' and !empty($extra)) ? '' . $branch . '' : $this->createBranchLink($type, $rootID, $branchID, $branch); $linkHtml = $manage ? html::a(inlink('browse', "root=$rootID&viewType=$type¤tModuleID=0&branch=$branchID"), $branch) : $linkHtml; - if($type == 'story' or $type == 'bug') $linkHtml = html::a(inlink('browse', "productID=$rootID&branch=&browseType=bybranch¶m=$branchID"), $branch, "", "id=branch" . $branchID); + if($type == 'story' or $type == 'bug') $linkHtml = html::a(inlink('browse', "productID=$rootID&branch=$branchID&browseType=bybranch"), $branch, "", "id=branch" . $branchID); if($firstBranch and $product->type != 'normal') { $linkHtml = '' . $this->lang->product->branchName[$product->type] . '