From 48ddd1957b6c62c97911b24b0ee90e8c00d17f28 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Sat, 12 Jun 2021 21:32:31 +0800 Subject: [PATCH] * Adjust code. --- module/my/control.php | 16 ++++++++++------ module/my/lang/de.php | 1 + module/my/lang/en.php | 1 + module/my/lang/fr.php | 1 + module/my/lang/vi.php | 1 + module/my/lang/zh-cn.php | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 216ce04559..605319f504 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -701,14 +701,18 @@ class my extends control $uri = $this->app->getURI(true); $this->session->set('meetingList', $uri, 'my'); - /* Load pager. */ - $this->app->loadClass('pager', $static = true); - if($this->app->getViewType() == 'mhtml') $recPerPage = 10; - $pager = pager::init($recTotal, $recPerPage, $pageID); + $meetings = $this->meeting->getListByUser($browseType, $orderBy); - $this->view->title = $this->lang->meeting->common . $this->lang->colon . $this->lang->meeting->browse; - $this->view->meetings = $this->meeting->getListByUser($browseType, $orderBy, $pager); + /* Pager. */ + $this->app->loadClass('pager', $static = true); + $recTotal = count($meetings); + $pager = new pager($recTotal, $recPerPage, $pageID); + $meetings = array_chunk($meetings, $pager->recPerPage); + + + $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->meeting; $this->view->browseType = $browseType; + $this->view->meetings = empty($meetings) ? $meetings : $meetings[$pageID - 1]; $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->view->depts = $this->loadModel('dept')->getOptionMenu(); diff --git a/module/my/lang/de.php b/module/my/lang/de.php index b02897afcd..b1de16b22e 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -18,6 +18,7 @@ $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; $lang->my->issue = 'My Issues'; $lang->my->risk = 'My Risks'; +$lang->my->meeting = 'My Meetings'; $lang->my->profile = 'My Profile'; $lang->my->dynamic = 'My Dynamics'; $lang->my->team = 'My Team'; diff --git a/module/my/lang/en.php b/module/my/lang/en.php index d050c58b80..6246cfba68 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -18,6 +18,7 @@ $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; $lang->my->issue = 'My Issues'; $lang->my->risk = 'My Risks'; +$lang->my->meeting = 'My Meetings'; $lang->my->profile = 'My Profile'; $lang->my->dynamic = 'My Dynamics'; $lang->my->team = 'My Team'; diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index b02897afcd..b1de16b22e 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -18,6 +18,7 @@ $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; $lang->my->issue = 'My Issues'; $lang->my->risk = 'My Risks'; +$lang->my->meeting = 'My Meetings'; $lang->my->profile = 'My Profile'; $lang->my->dynamic = 'My Dynamics'; $lang->my->team = 'My Team'; diff --git a/module/my/lang/vi.php b/module/my/lang/vi.php index b02897afcd..b1de16b22e 100644 --- a/module/my/lang/vi.php +++ b/module/my/lang/vi.php @@ -18,6 +18,7 @@ $lang->my->project = "My Projects"; $lang->my->execution = "My {$lang->executionCommon}s"; $lang->my->issue = 'My Issues'; $lang->my->risk = 'My Risks'; +$lang->my->meeting = 'My Meetings'; $lang->my->profile = 'My Profile'; $lang->my->dynamic = 'My Dynamics'; $lang->my->team = 'My Team'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index e5697ee35e..866db527f2 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -18,6 +18,7 @@ $lang->my->project = "我的项目"; $lang->my->execution = "我的{$lang->executionCommon}"; $lang->my->issue = '我的问题'; $lang->my->risk = '我的风险'; +$lang->my->meeting = '我的会议'; $lang->my->profile = '我的档案'; $lang->my->dynamic = '我的动态'; $lang->my->team = '团队';