* adjust for show count.

This commit is contained in:
wangyidong
2018-04-26 17:17:47 +08:00
parent 2915d16f23
commit 960e0af5d2
14 changed files with 67 additions and 70 deletions
+9
View File
@@ -25,6 +25,7 @@ $lang->action->undelete = 'Restore';
$lang->action->hideOne = 'Hide';
$lang->action->hideAll = 'Hide All';
$lang->action->editComment = 'Edit';
$lang->action->create = 'Create Comment';
$lang->action->comment = 'Comment';
$lang->action->trashTips = 'Note: All Deletion in ZenTao are logical.';
@@ -53,6 +54,14 @@ $lang->action->dynamic->all = 'All';
$lang->action->dynamic->hidden = 'Hidden';
$lang->action->dynamic->search = 'Search';
$lang->action->periods['all'] = $lang->action->dynamic->all;
$lang->action->periods['today'] = $lang->action->dynamic->today;
$lang->action->periods['yesterday'] = $lang->action->dynamic->yesterday;
$lang->action->periods['thisweek'] = $lang->action->dynamic->thisWeek;
$lang->action->periods['lastweek'] = $lang->action->dynamic->lastWeek;
$lang->action->periods['thismonth'] = $lang->action->dynamic->thisMonth;
$lang->action->periods['lastmonth'] = $lang->action->dynamic->lastMonth;
$lang->action->objectTypes['product'] = $lang->productCommon;
$lang->action->objectTypes['story'] = 'Story';
$lang->action->objectTypes['productplan'] = 'Plan';
+8
View File
@@ -54,6 +54,14 @@ $lang->action->dynamic->all = '所有';
$lang->action->dynamic->hidden = '已隐藏';
$lang->action->dynamic->search = '搜索';
$lang->action->periods['all'] = $lang->action->dynamic->all;
$lang->action->periods['today'] = $lang->action->dynamic->today;
$lang->action->periods['yesterday'] = $lang->action->dynamic->yesterday;
$lang->action->periods['thisweek'] = $lang->action->dynamic->thisWeek;
$lang->action->periods['lastweek'] = $lang->action->dynamic->lastWeek;
$lang->action->periods['thismonth'] = $lang->action->dynamic->thisMonth;
$lang->action->periods['lastmonth'] = $lang->action->dynamic->lastMonth;
$lang->action->objectTypes['product'] = $lang->productCommon;
$lang->action->objectTypes['story'] = '需求';
$lang->action->objectTypes['productplan'] = '计划';
-19
View File
@@ -967,25 +967,6 @@ class actionModel extends model
$this->file->updateObjectID($this->post->uid, $action->objectID, $action->objectType);
}
/**
* Get action count.
*
* @param string $type
* @param string $id
* @access public
* @return int
*/
public function getCount($type = 'account', $id = '')
{
if($type == 'account' and empty($id)) $id = $this->app->user->account;
return $this->dao->select('count(*) AS count')->from(TABLE_ACTION)
->where('1=1')
->beginIF($type == 'account')->andWhere('actor')->eq($id)->fi()
->beginIF($type == 'product')->andWhere('product')->like("%,$id,%")->fi()
->beginIF($type == 'project')->andWhere('project')->eq($id)->fi()
->fetch('count');
}
/**
* Build date group by actions
*
-1
View File
@@ -235,7 +235,6 @@ class company extends control
$this->view->pager = $pager;
$this->view->param = $param;
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
$this->view->allCount = $this->action->getCount('all');
$this->view->direction = $direction;
$this->display();
}
+11 -8
View File
@@ -13,15 +13,18 @@
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php
echo html::a(inlink('dynamic', "browseType=all"), "<span class='text'>{$lang->action->dynamic->all}<span> <span class='label label-light label-badge'>{$allCount}</span>", '', "class='btn btn-link " . ($browseType == 'all' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "browseType=today"), "<span class='text'>{$lang->action->dynamic->today}<span>", '', "class='btn btn-link " . ($browseType == 'today' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "browseType=yesterday"), "<span class='text'>{$lang->action->dynamic->yesterday}<span>", '', "class='btn btn-link " . ($browseType == 'yesterday' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "browseType=thisweek"), "<span class='text'>{$lang->action->dynamic->thisWeek}<span>", '', "class='btn btn-link " . ($browseType == 'thisweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "browseType=lastweek"), "<span class='text'>{$lang->action->dynamic->lastWeek}<span>", '', "class='btn btn-link " . ($browseType == 'lastweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "browseType=thismonth"), "<span class='text'>{$lang->action->dynamic->thisMonth}<span>", '', "class='btn btn-link " . ($browseType == 'thismonth' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "browseType=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}<span>", '', "class='btn btn-link " . ($browseType == 'lastmonth' ? 'btn-active-text' : '') . "'");
<?php foreach($lang->action->periods as $period => $label):?>
<?php
$label = "<span class='text'>$label</span>";
$active = '';
if($period == $browseType)
{
$active = 'btn-active-text';
$label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
}
echo html::a(inlink('dynamic', "browseType=$period"), $label, '', "class='btn btn-link $active' id='{$period}'")
?>
<?php endforeach;?>
<div class="input-control space w-150px"><?php echo html::select('account', $users, $account, 'onchange=changeUser(this.value) class="form-control chosen"');?></div>
<div class="input-control space w-150px"><?php echo html::select('product', $products, $product, 'onchange=changeProduct(this.value) class="form-control chosen"');?></div>
<?php if($this->config->global->flow != 'onlyTest'):?>
-2
View File
@@ -104,7 +104,6 @@ class my extends control
/* Assign. */
$this->view->todos = $this->loadModel('todo')->getList($type, $account, $status, 0, $pager, $sort);
$this->view->todoCount = $this->todo->getCount();
$this->view->date = (int)$type == 0 ? date(DT_DATE1) : date(DT_DATE1, strtotime($type));
$this->view->type = $type;
$this->view->recTotal = $recTotal;
@@ -568,7 +567,6 @@ class my extends control
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
$this->view->allCount = $this->action->getCount();
$this->view->direction = $direction;
$this->display();
}
+10 -7
View File
@@ -13,15 +13,18 @@
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php foreach($lang->action->periods as $period => $label):?>
<?php
echo html::a(inlink('dynamic', "type=all"), "<span class='text'>{$lang->action->dynamic->all}</span> <span class='label label-light label-badge'>{$allCount}</span>", '', "class='btn btn-link " . ($type == 'all' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "type=today"), "<span class='text'>{$lang->action->dynamic->today}</span>", '', "class='btn btn-link " . ($type == 'today' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "type=yesterday"), "<span class='text'>{$lang->action->dynamic->yesterday}</span>", '', "class='btn btn-link " . ($type == 'yesterday' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "type=thisweek"), "<span class='text'>{$lang->action->dynamic->thisWeek}</span>", '', "class='btn btn-link " . ($type == 'thisweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "type=lastweek"), "<span class='text'>{$lang->action->dynamic->lastWeek}</span>", '', "class='btn btn-link " . ($type == 'lastweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "type=thismonth"), "<span class='text'>{$lang->action->dynamic->thisMonth}</span>", '', "class='btn btn-link " . ($type == 'thismonth' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "type=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}</span>", '', "class='btn btn-link " . ($type == 'lastmonth' ? 'btn-active-text' : '') . "'");
$label = "<span class='text'>$label</span>";
$active = '';
if($period == $type)
{
$active = 'btn-active-text';
$label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
}
echo html::a(inlink('dynamic', "type=$period"), $label, '', "class='btn btn-link $active' id='{$period}'")
?>
<?php endforeach;?>
</div>
</div>
<div id="mainContent" class="main-content">
+7 -2
View File
@@ -19,8 +19,13 @@
<?php
$vars = "date=$period";
if($period == 'before') $vars .= "&account={$app->user->account}&status=undone";
$label = $period == 'all' ? "<span class='text'>$label</span> <span class='label label-light label-badge'>{$todoCount}</span>" : "<span class='text'>$label</span>";
$active = $period == $type ? 'btn-active-text' : '';
$label = "<span class='text'>$label</span>";
$active = '';
if($period == $type)
{
$active = 'btn-active-text';
$label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
}
echo html::a(inlink('todo', $vars), $label, '', "class='btn btn-link $active' id='{$period}'")
?>
<?php endforeach;?>
-2
View File
@@ -204,7 +204,6 @@ class product extends control
$this->view->storyCases = $storyCases;
$this->view->param = $param;
$this->view->products = $this->products;
$this->view->allCount = $this->story->getCount($productID);
$this->display();
}
@@ -516,7 +515,6 @@ class product extends control
$this->view->param = $param;
$this->view->pager = $pager;
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
$this->view->allCount = $this->action->getCount('product', $productID);
$this->view->direction = $direction;
$this->display();
}
+1 -1
View File
@@ -47,7 +47,7 @@
echo '</ul></div>';
?>
<?php else:?>
<?php echo html::a($this->inlink('browse', "productID=$productID&branch=$branch&browseType=$menuBrowseType" . $queryParam), "<span class='text'>$menuItem->text</span>" . ($menuItem->name == 'allstory' ? ' <span class="label label-light label-badge">' . $allCount . '</span>' : ''), '', "id='{$menuItem->name}Tab' class='btn btn-link" . ($this->session->storyBrowseType == $menuItem->name ? ' btn-active-text' : '') . "'");?>
<?php echo html::a($this->inlink('browse', "productID=$productID&branch=$branch&browseType=$menuBrowseType" . $queryParam), "<span class='text'>$menuItem->text</span>" . ($menuItem->name == $this->session->storyBrowseType ? ' <span class="label label-light label-badge">' . $pager->recTotal . '</span>' : ''), '', "id='{$menuItem->name}Tab' class='btn btn-link" . ($this->session->storyBrowseType == $menuItem->name ? ' btn-active-text' : '') . "'");?>
<?php endif;?>
<?php endforeach;?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->product->searchStory;?></a>
+10 -7
View File
@@ -13,15 +13,18 @@
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php foreach($lang->action->periods as $period => $label):?>
<?php
echo html::a(inlink('dynamic', "productID=$productID&type=all"), "<span class='text'>{$lang->action->dynamic->all}</span> <span class='label label-light label-badge'>{$allCount}</span>", '', "class='btn btn-link " . ($type == 'all' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "productID=$productID&type=today"), "<span class='text'>{$lang->action->dynamic->today}</span>", '', "class='btn btn-link " . ($type == 'today' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "productID=$productID&type=yesterday"), "<span class='text'>{$lang->action->dynamic->yesterday}</span>", '', "class='btn btn-link " . ($type == 'yesterday' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "productID=$productID&type=thisweek"), "<span class='text'>{$lang->action->dynamic->thisWeek}</span>", '', "class='btn btn-link " . ($type == 'thisweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "productID=$productID&type=lastweek"), "<span class='text'>{$lang->action->dynamic->lastWeek}</span>", '', "class='btn btn-link " . ($type == 'lastweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "productID=$productID&type=thismonth"), "<span class='text'>{$lang->action->dynamic->thisMonth}</span>", '', "class='btn btn-link " . ($type == 'thismonth' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "productID=$productID&type=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}</span>", '', "class='btn btn-link " . ($type == 'lastmonth' ? 'btn-active-text' : '') . "'");
$label = "<span class='text'>$label</span>";
$active = '';
if($period == $type)
{
$active = 'btn-active-text';
$label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
}
echo html::a(inlink('dynamic', "productID=$productID&type=$period"), $label, '', "class='btn btn-link $active' id='{$period}'")
?>
<?php endforeach;?>
<div class="input-control space w-150px">
<?php echo html::select('account', $users, $account, "onchange='changeUser(this.value, $productID)' class='form-control chosen'");?>
</div>
-1
View File
@@ -1960,7 +1960,6 @@ class project extends control
$this->view->pager = $pager;
$this->view->param = $param;
$this->view->dateGroups = $this->action->buildDateGroup($actions, $direction);
$this->view->allCount = $this->action->getCount('project', $projectID);
$this->view->direction = $direction;
$this->display();
}
+11 -8
View File
@@ -13,15 +13,18 @@
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php
echo html::a(inlink('dynamic', "projectID=$projectID&type=all"), "<span class='text'>{$lang->action->dynamic->all}</span> <span class='label label-light label-badge'>{$allCount}</span>", '', "class='btn btn-link " . ($type == 'all' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "projectID=$projectID&type=today"), "<span class='text'>{$lang->action->dynamic->today}</span>", '', "class='btn btn-link " . ($type == 'today' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "projectID=$projectID&type=yesterday"), "<span class='text'>{$lang->action->dynamic->yesterday}</span>", '', "class='btn btn-link " . ($type == 'yesterday' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "projectID=$projectID&type=thisweek"), "<span class='text'>{$lang->action->dynamic->thisWeek}</span>", '', "class='btn btn-link " . ($type == 'thisweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "projectID=$projectID&type=lastweek"), "<span class='text'>{$lang->action->dynamic->lastWeek}</span>", '', "class='btn btn-link " . ($type == 'lastweek' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "projectID=$projectID&type=thismonth"), "<span class='text'>{$lang->action->dynamic->thisMonth}</span>", '', "class='btn btn-link " . ($type == 'thismonth' ? 'btn-active-text' : '') . "'");
echo html::a(inlink('dynamic', "projectID=$projectID&type=lastmonth"), "<span class='text'>{$lang->action->dynamic->lastMonth}</span>", '', "class='btn btn-link " . ($type == 'lastmonth' ? 'btn-active-text' : '') . "'");
<?php foreach($lang->action->periods as $period => $label):?>
<?php
$label = "<span class='text'>$label</span>";
$active = '';
if($period == $type)
{
$active = 'btn-active-text';
$label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
}
echo html::a(inlink('dynamic', "projectID=$projectID&type=$period"), $label, '', "class='btn btn-link $active' id='{$period}'")
?>
<?php endforeach;?>
<div class="input-control space w-150px">
<?php echo html::select('account', $users, $account, "onchange='changeUser(this.value, $projectID)' class='form-control chosen'");?>
</div>
-12
View File
@@ -2614,16 +2614,4 @@ class storyModel extends model
return array($toList, $ccList);
}
/**
* Get story count.
*
* @param int $productID
* @access public
* @return int
*/
public function getCount($productID)
{
return $this->dao->select('count(*) as count')->from(TABLE_STORY)->where('deleted')->eq(0)->andWhere('product')->eq($productID)->fetch('count');
}
}