* adjust the UI.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -46,3 +46,6 @@ $lang->product->code = '产品代号';
|
||||
$lang->product->order = '排序';
|
||||
$lang->product->status = '状态';
|
||||
$lang->product->desc = '产品描述';
|
||||
|
||||
$lang->product->moduleStory = '按模块浏览';
|
||||
$lang->product->allStory = '全部需求';
|
||||
|
||||
@@ -25,8 +25,19 @@
|
||||
<?php
|
||||
class productModel extends model
|
||||
{
|
||||
/* <20><><EFBFBD>ò˵<C3B2><CBB5><EFBFBD>*/
|
||||
public function setMenu($products, $productID)
|
||||
{
|
||||
$selectHtml = html::select('productID', $products, $productID, 'onchange="switchProduct(this.value);"');
|
||||
common::setMenuVars($this->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);
|
||||
}
|
||||
|
||||
/* ͨ<><CDA8>ID<49><44>ȡ<EFBFBD><C8A1>Ʒ<EFBFBD><C6B7>Ϣ<EFBFBD><CFA2>*/
|
||||
function findByID($productID)
|
||||
public function findByID($productID)
|
||||
{
|
||||
return $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch();
|
||||
}
|
||||
|
||||
@@ -25,104 +25,55 @@
|
||||
<?php include '../../common/header.html.php';?>
|
||||
<?php include '../../common/treeview.html.php';?>
|
||||
<script language='Javascript'>
|
||||
function selectProduct(productID)
|
||||
/* 切换浏览方式。*/
|
||||
function browseByModule()
|
||||
{
|
||||
link = createLink('product', 'browse', 'productID=' + productID);
|
||||
location.href=link;
|
||||
$('#mainbox').addClass('yui-t7');
|
||||
$('#treebox').removeClass('hidden');
|
||||
$('#featuremodule').addClass('active');
|
||||
$('#featureall').removeClass('active');
|
||||
}
|
||||
</script>
|
||||
<div class="yui-d0 yui-t3">
|
||||
<div class="yui-b">
|
||||
<table class='table-1'>
|
||||
<caption>
|
||||
<?php echo $lang->product->selectProduct;?>
|
||||
<?php echo html::select('productID', $products, $productID, 'onchange="selectProduct(this.value);" style="width:200px"');?>
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<div id='main'><?php echo $moduleTree;?></div>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('product', 'edit')) echo html::a($this->createLink('product', 'edit', "productID=$productID"), $lang->edit);?>
|
||||
<?php if(common::hasPriv('product', 'delete')) echo html::a($this->createLink('product', 'delete', "productID=$productID&confirm=no"), $lang->delete, 'hiddenwin');?>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=product"), $lang->tree->manage);?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--
|
||||
<table align='center' class='table-1'>
|
||||
<caption><?php echo $lang->release->browse;?></caption>
|
||||
<tr>
|
||||
<th><?php echo $lang->release->id;?></th>
|
||||
<th><?php echo $lang->release->name;?></th>
|
||||
<th><?php echo $lang->release->desc;?></th>
|
||||
<th><?php echo $lang->release->status;?></th>
|
||||
</tr>
|
||||
<?php //foreach($releases as $release):?>
|
||||
<tr>
|
||||
<td><?php //echo $release->id;?></td>
|
||||
<td><?php //echo $release->name;?></td>
|
||||
<td><?php //echo $release->desc;?></td>
|
||||
<td><?php //echo $release->status;?></td>
|
||||
</tr>
|
||||
<?php //endforeach;?>
|
||||
</table>
|
||||
<?php
|
||||
$vars['productID'] = $productID;
|
||||
$addLink = $this->createLink('release', 'create', $vars);
|
||||
echo "<a href='$addLink'>{$lang->release->create}</a>";
|
||||
?>
|
||||
-->
|
||||
|
||||
<div class='yui-d0'>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<span id='featureall'><?php echo html::a($this->createLink('product', 'browse', "productID=$productID"), $lang->product->allStory);?></span>
|
||||
<span id='featuremodule' onclick='browseByModule()'><?php echo $lang->product->moduleStory;?></span>
|
||||
</div>
|
||||
<div class="yui-main">
|
||||
<div class='f-right'>
|
||||
<?php if(common::hasPriv('story', 'create')) echo html::a($this->createLink('story', 'create', "productID=$productID&moduleID=$moduleID"), $lang->story->create); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='yui-d0 <?php if($browseType == 'module') echo 'yui-t7';?>' id='mainbox'>
|
||||
<div class='yui-b <?php if($browseType != 'module') echo 'hidden';?>' id='treebox'>
|
||||
<div class='box-title'><?php echo $productName;?></div>
|
||||
<div class='box-content'>
|
||||
<?php echo $moduleTree;?>
|
||||
<div class='a-right'>
|
||||
<?php if(common::hasPriv('product', 'edit')) echo html::a($this->createLink('product', 'edit', "productID=$productID"), $lang->edit);?>
|
||||
<?php if(common::hasPriv('product', 'delete')) echo html::a($this->createLink('product', 'delete', "productID=$productID&confirm=no"), $lang->delete, 'hiddenwin');?>
|
||||
<?php if(common::hasPriv('tree', 'browse')) echo html::a($this->createLink('tree', 'browse', "productID=$productID&view=product"), $lang->tree->manage);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="yui-main">
|
||||
<div class="yui-b">
|
||||
<table align='center' class='table-1'>
|
||||
<caption>
|
||||
<div class='half-left'>
|
||||
<?php
|
||||
echo html::a($this->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;
|
||||
?>
|
||||
</div>
|
||||
<div class='half-right'>
|
||||
<?php
|
||||
if(common::hasPriv('story', 'create')) echo html::a($this->createLink('story', 'create', "productID=$productID&moduleID=$moduleID"), $lang->story->create);
|
||||
?>
|
||||
</div>
|
||||
</caption>
|
||||
<table class='table-1 fixed'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
$app->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);
|
||||
}
|
||||
?>
|
||||
<th><?php printOrderLink('id');?></th>
|
||||
<th><?php printOrderLink('pri');?></th>
|
||||
<th><?php printOrderLink('title');?></th>
|
||||
<th><?php printOrderLink('assignedTo');?></th>
|
||||
<th><?php printOrderLink('openedBy');?></th>
|
||||
<th><?php printOrderLink('estimate');?></th>
|
||||
<th><?php printOrderLink('status');?></th>
|
||||
<th><?php printOrderLink('lastEditedDate');?></th>
|
||||
<tr class='colhead'>
|
||||
<?php $vars = "productID=$productID&moduleID=$moduleID&orderBy=%s&recTotal=$recTotal&recPerPage=$recPerPage";?>
|
||||
<th><?php common::printOrderLink('id', $orderBy, $vars, $lang->story->id);?></th>
|
||||
<th><?php common::printOrderLink('pri', $orderBy, $vars, $lang->story->pri);?></th>
|
||||
<th class='w-p40'><?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
<th><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->story->assignedTo);?></th>
|
||||
<th><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->story->openedBy);?></th>
|
||||
<th><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimate);?></th>
|
||||
<th><?php common::printOrderLink('status', $orderBy, $vars, $lang->story->status);?></th>
|
||||
<th><?php common::printOrderLink('lastEditedDate', $orderBy, $vars, $lang->story->lastEditedDate);?></th>
|
||||
<th><?php echo $lang->action;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -135,7 +86,7 @@ function selectProduct(productID)
|
||||
<tr class='a-center'>
|
||||
<td><?php if($canView) echo html::a($viewLink, sprintf('%03d', $story->id)); else printf('%03d', $story->id);?></td>
|
||||
<td><?php echo $story->pri;?></td>
|
||||
<td class='a-left'><nobr><?php echo $story->title;?></nobr></td>
|
||||
<td class='a-left nobr'><nobr><?php echo $story->title;?></nobr></td>
|
||||
<td><?php echo $users[$story->assignedTo];?></td>
|
||||
<td><?php echo $users[$story->openedBy];?></td>
|
||||
<td><?php echo $story->estimate;?></td>
|
||||
@@ -150,8 +101,11 @@ function selectProduct(productID)
|
||||
</tbody>
|
||||
</table>
|
||||
<?php echo $pager;?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script language='javascript'>
|
||||
$('#module<?php echo $moduleID;?>').addClass('active')
|
||||
$('#feature<?php echo $browseType;?>').addClass('active')
|
||||
</script>
|
||||
<?php include '../../common/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user