Merge branch 'master' of github.com:easysoft/zentaopms
This commit is contained in:
@@ -170,13 +170,14 @@ class productplan extends control
|
||||
*
|
||||
* @param int $product
|
||||
* @param string $orderBy
|
||||
* @param string $browseType
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($productID = 0, $branch = 0, $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
public function browse($productID = 0, $branch = 0, $browseType = 'unexpired', $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 )
|
||||
{
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
@@ -191,8 +192,9 @@ class productplan extends control
|
||||
$this->view->title = $products[$productID] . $this->lang->colon . $this->lang->productplan->browse;
|
||||
$this->view->position[] = $this->lang->productplan->browse;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->plans = $this->productplan->getList($productID, $branch, $pager, $sort);
|
||||
$this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort);
|
||||
$this->view->pager = $pager;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -56,3 +56,7 @@ $lang->productplan->errorNoTitle = 'ID %s title should not be empty.';
|
||||
$lang->productplan->errorNoBegin = 'ID %s begin time should not be empty.';
|
||||
$lang->productplan->errorNoEnd = 'ID %s end time should not be empty.';
|
||||
$lang->productplan->beginGeEnd = 'ID %s begin time value should not be greater than t.';
|
||||
|
||||
$lang->productplan->featureBar['browse']['unexpired'] = 'Unexpired';
|
||||
$lang->productplan->featureBar['browse']['all'] = 'All';
|
||||
$lang->productplan->featureBar['browse']['overdue'] = 'Overdue';
|
||||
|
||||
@@ -56,3 +56,7 @@ $lang->productplan->errorNoTitle = 'ID %s 标题不能为空';
|
||||
$lang->productplan->errorNoBegin = 'ID %s 开始时间不能为空';
|
||||
$lang->productplan->errorNoEnd = 'ID %s 结束时间不能为空';
|
||||
$lang->productplan->beginGeEnd = 'ID %s 开始时间不能大于结束时间';
|
||||
|
||||
$lang->productplan->featureBar['browse']['unexpired'] = '未过期';
|
||||
$lang->productplan->featureBar['browse']['all'] = '全部';
|
||||
$lang->productplan->featureBar['browse']['overdue'] = '已过期';
|
||||
|
||||
@@ -60,16 +60,21 @@ class productplanModel extends model
|
||||
* Get list
|
||||
*
|
||||
* @param int $product
|
||||
* @param int $branch
|
||||
* @param string $browseType
|
||||
* @param object $pager
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getList($product = 0, $branch = 0, $pager = null, $orderBy = 'begin_desc')
|
||||
public function getList($product = 0, $branch = 0, $browseType = 'all', $pager = null, $orderBy = 'begin_desc')
|
||||
{
|
||||
$date = date('Y-m-d');
|
||||
return $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('product')->eq($product)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!empty($branch))->andWhere('branch')->eq($branch)->fi()
|
||||
->beginIF($browseType == 'unexpired')->andWhere('end')->gt($date)->fi()
|
||||
->beginIF($browseType == 'overdue')->andWhere('end')->le($date)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
@@ -12,12 +12,28 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->productplan->confirmDelete)?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<i class='icon-flag'></i>
|
||||
<?php echo $lang->productplan->browse;?>
|
||||
<?php if($product->type !== 'normal') echo '<span class="label label-info">' . $branches[$branch] . '</span>';?>
|
||||
</div>
|
||||
<?php js::set('browseType', $browseType);?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<li>
|
||||
<?php if($product->type !== 'normal'):?>
|
||||
<div class='label-angle<?php if($branch) echo ' with-close';?>'>
|
||||
<?php
|
||||
echo $branches[$branch];
|
||||
if($branch)
|
||||
{
|
||||
$removeLink = inlink('browse', "productID=$productID&branch=0&browseType=$browseType&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}");
|
||||
echo html::a($removeLink, "<i class='icon icon-remove'></i>", '', "class='text-muted'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</li>
|
||||
<?php foreach(customModel::getFeatureMenu($this->moduleName, $this->methodName) as $menuItem):?>
|
||||
<?php if(isset($menuItem->hidden)) continue;?>
|
||||
<li id='<?php echo $menuItem->name?>Tab'><?php echo html::a($this->inlink('browse', "productID=$productID&branch=$branch&browseType={$menuItem->name}"), $menuItem->text);?></li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
<div class='actions'>
|
||||
<?php common::printIcon('productplan', 'create', "productID=$product->id&branch=$branch", '', 'button', 'plus');?>
|
||||
</div>
|
||||
@@ -82,6 +98,7 @@
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
$('#' + browseType + 'Tab').addClass('active');
|
||||
$(function(){fixedTfootAction('#productplanForm')});
|
||||
$(function(){fixedTheadOfList('#productplan')});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user