diff --git a/trunk/module/product/control.php b/trunk/module/product/control.php index f705c266e6..a287b01d93 100644 --- a/trunk/module/product/control.php +++ b/trunk/module/product/control.php @@ -40,8 +40,6 @@ class product extends control $this->products = $this->product->getPairs(); if(empty($this->products)) $this->locate($this->createLink('product', 'create')); $this->assign('products', $this->products); - - } /* 产品视图首页。*/ @@ -53,10 +51,8 @@ class product extends control /* 浏览某一个产品。*/ public function browse($productID = 0, $moduleID = 0, $orderBy = 'id|desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { - - $this->lang->product->menu[] = html::select('product', $this->products, $productID). $this->lang->arrow; - $this->lang->product->menu[] = "需求列表|product|browse|productID=$productID"; - $this->lang->product->menu[] = '新增产品|product|create||right|'; + $this->config->product->search['actionURL'] = $this->createLink('product', 'browse', "productID=$productID&type=byQuery"); + $this->assign('searchForm', $this->fetch('search', 'buildForm', $this->config->product->search)); /* 设置当前的产品id和模块id。*/ $this->session->set('storyList', $this->app->getURI(true)); @@ -64,6 +60,9 @@ class product extends control $moduleID = (int)$moduleID; $childModuleIds = $this->tree->getAllChildID($moduleID); + /* 设置菜单。*/ + $this->product->setMenu($this->products, $productID); + /* 设置header和导航条信息。*/ $header['title'] = $this->lang->product->index . $this->lang->colon . $this->products[$productID]; $position[] = $this->products[$productID]; @@ -73,6 +72,9 @@ class product extends control $pager = new pager($recTotal, $recPerPage, $pageID); $stories = $this->story->getProductStories($productID, $childModuleIds, 'all', $orderBy, $pager); + /* 设置浏览模式。*/ + $browseType = $moduleID > 0 ? 'module' : 'all'; + $this->assign('header', $header); $this->assign('position', $position); $this->assign('productID', $productID); @@ -86,6 +88,7 @@ class product extends control $this->assign('recPerPage', $pager->recPerPage); $this->assign('users', $this->user->getPairs($this->app->company->id, 'noletter')); $this->assign('orderBy', $orderBy); + $this->assign('browseType', $browseType); $this->display(); } @@ -100,6 +103,9 @@ class product extends control die(js::locate($this->createLink($this->moduleName, 'browse', "productID=$productID"), 'parent')); } + /* 设置菜单。*/ + $this->product->setMenu($this->products, ''); + $header['title'] = $this->lang->product->create; $position[] = $header['title']; $this->assign('header', $header); @@ -117,6 +123,9 @@ class product extends control die(js::locate($this->createLink('product', 'browse', "product=$productID"), 'parent')); } + /* 设置菜单。*/ + $this->product->setMenu($this->products, $productID); + $product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); $header['title'] = $this->lang->product->edit . $this->lang->colon . $product->name; $position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name); diff --git a/trunk/module/product/lang/zh-cn.php b/trunk/module/product/lang/zh-cn.php index 551caa7923..e4b77d305d 100644 --- a/trunk/module/product/lang/zh-cn.php +++ b/trunk/module/product/lang/zh-cn.php @@ -46,3 +46,6 @@ $lang->product->code = '产品代号'; $lang->product->order = '排序'; $lang->product->status = '状态'; $lang->product->desc = '产品描述'; + +$lang->product->moduleStory = '按模块浏览'; +$lang->product->allStory = '全部需求'; diff --git a/trunk/module/product/model.php b/trunk/module/product/model.php index c3a6d0630c..b52a5d8feb 100644 --- a/trunk/module/product/model.php +++ b/trunk/module/product/model.php @@ -25,8 +25,19 @@ lang->product->menu, 'list', $selectHtml . $this->lang->arrow); + common::setMenuVars($this->lang->product->menu, 'story', $productID); + common::setMenuVars($this->lang->product->menu, 'edit', $productID); + common::setMenuVars($this->lang->product->menu, 'delete', $productID); + common::setMenuVars($this->lang->product->menu, 'module', $productID); + } + /* ͨIDȡƷϢ*/ - function findByID($productID) + public function findByID($productID) { return $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); } diff --git a/trunk/module/product/view/browse.html.php b/trunk/module/product/view/browse.html.php index 710ede0228..80e5b906a9 100644 --- a/trunk/module/product/view/browse.html.php +++ b/trunk/module/product/view/browse.html.php @@ -25,104 +25,55 @@ -
-
- - - - - -
- product->selectProduct;?> - -
-
-
- createLink('product', 'edit', "productID=$productID"), $lang->edit);?> - createLink('product', 'delete', "productID=$productID&confirm=no"), $lang->delete, 'hiddenwin');?> - createLink('tree', 'browse', "productID=$productID&view=product"), $lang->tree->manage);?> -
-
- + +
+
+
+ createLink('product', 'browse', "productID=$productID"), $lang->product->allStory);?> + product->moduleStory;?>
-
+
+ createLink('story', 'create', "productID=$productID&moduleID=$moduleID"), $lang->story->create); ?> +
+
+
+ +
' id='mainbox'> +
' id='treebox'> +
+
+ +
+ createLink('product', 'edit', "productID=$productID"), $lang->edit);?> + createLink('product', 'delete', "productID=$productID&confirm=no"), $lang->delete, 'hiddenwin');?> + createLink('tree', 'browse', "productID=$productID&view=product"), $lang->tree->manage);?> +
+
+
+ +
- - +
-
- createLink('product', 'browse', "productID=$productID"), $productName) . $lang->arrow; - foreach($parentModules as $module) - { - echo html::a($this->createLink('product', 'browse', "productID=$productID&moduleID=$module->id"), $module->name) . $lang->arrow; - } - echo $lang->story->browse; - ?> -
-
- createLink('story', 'create', "productID=$productID&moduleID=$moduleID"), $lang->story->create); - ?> -
-
- - global->vars = "productID=$productID&moduleID=$moduleID&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage"; - $app->global->orderBy = $orderBy; - function printOrderLink($fieldName) - { - global $app, $lang; - if(strpos($app->global->orderBy, $fieldName) !== false) - { - if(stripos($app->global->orderBy, 'desc') !== false) $orderBy = str_replace('desc', 'asc', $app->global->orderBy); - if(stripos($app->global->orderBy, 'asc') !== false) $orderBy = str_replace('asc', 'desc', $app->global->orderBy); - } - else - { - $orderBy = $fieldName . '|' . 'asc'; - } - $link = helper::createLink('product', 'browse', sprintf($app->global->vars, $orderBy)); - echo html::a($link, $lang->story->$fieldName); - } - ?> - - - - - - - - + + + + + + + + + + @@ -135,7 +86,7 @@ function selectProduct(productID) - + @@ -150,8 +101,11 @@ function selectProduct(productID)
story->id);?>story->pri);?>story->title);?>story->assignedTo);?>story->openedBy);?>story->estimate);?>story->status);?>story->lastEditedDate);?> action;?>
id)); else printf('%03d', $story->id);?> pri;?>title;?>title;?> assignedTo];?> openedBy];?> estimate;?>
-
+