From 960e0af5d207273a915851264f2db018e6febe01 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 26 Apr 2018 17:17:47 +0800 Subject: [PATCH 1/6] * adjust for show count. --- module/action/lang/en.php | 9 +++++++++ module/action/lang/zh-cn.php | 8 ++++++++ module/action/model.php | 19 ------------------- module/company/control.php | 1 - module/company/view/dynamic.html.php | 19 +++++++++++-------- module/my/control.php | 2 -- module/my/view/dynamic.html.php | 17 ++++++++++------- module/my/view/todo.html.php | 9 +++++++-- module/product/control.php | 2 -- module/product/view/browse.html.php | 2 +- module/product/view/dynamic.html.php | 17 ++++++++++------- module/project/control.php | 1 - module/project/view/dynamic.html.php | 19 +++++++++++-------- module/story/model.php | 12 ------------ 14 files changed, 67 insertions(+), 70 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 3b96649611..332d02b3cd 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -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'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index cec1875adc..5fd841c37c 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -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'] = '计划'; diff --git a/module/action/model.php b/module/action/model.php index c933e90787..04cbb03805 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -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 * diff --git a/module/company/control.php b/module/company/control.php index 43df49b69c..5ee6686219 100644 --- a/module/company/control.php +++ b/module/company/control.php @@ -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(); } diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index bd57fcc688..ddb9dcd48d 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -13,15 +13,18 @@