From bdd813d29094125bbdb0afbc5b26271cbb692263 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Fri, 1 Jan 2021 10:39:53 +0800 Subject: [PATCH] * Modify the statistic info of the task in my module. --- module/my/control.php | 2 +- module/my/lang/de.php | 2 -- module/my/lang/en.php | 2 -- module/my/lang/fr.php | 2 -- module/my/lang/vi.php | 2 -- module/my/lang/zh-cn.php | 2 -- module/my/lang/zh-tw.php | 2 -- module/my/model.php | 29 ----------------------------- 8 files changed, 1 insertion(+), 42 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 418827ea65..6a2f1ec85f 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -303,7 +303,7 @@ class my extends control $this->view->position[] = $this->lang->my->task; $this->view->tabID = 'task'; $this->view->tasks = $tasks; - $this->view->summary = $this->my->taskSummary($tasks); + $this->view->summary = $this->loadModel('project')->summary($tasks); $this->view->type = $type; $this->view->recTotal = $recTotal; $this->view->recPerPage = $recPerPage; diff --git a/module/my/lang/de.php b/module/my/lang/de.php index a2e1d69c74..06b79a4eda 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -63,5 +63,3 @@ $lang->my->form = new stdclass(); $lang->my->form->lblBasic = 'Basis Info'; $lang->my->form->lblContact = 'Kontakt Info'; $lang->my->form->lblAccount = 'Konto Info'; - -$lang->my->taskSummary = "Aufgaben auf dieser Seite: %s Total, %s Rest."; diff --git a/module/my/lang/en.php b/module/my/lang/en.php index 6d545c4f47..8e8da7f4c6 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -74,5 +74,3 @@ $lang->my->form = new stdclass(); $lang->my->form->lblBasic = 'Basic Info'; $lang->my->form->lblContact = 'Contact Info'; $lang->my->form->lblAccount = 'Account Info'; - -$lang->my->taskSummary = "Total tasks on this page:%s.     Left: %s(h)."; diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index 4704889050..97285f836e 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -63,5 +63,3 @@ $lang->my->form = new stdclass(); $lang->my->form->lblBasic = 'Infos Basiques'; $lang->my->form->lblContact = 'Infos Contact'; $lang->my->form->lblAccount = 'Infos Compte'; - -$lang->my->taskSummary = "Total des tâches de cette page :%s.     Reste: %s(h)."; diff --git a/module/my/lang/vi.php b/module/my/lang/vi.php index 6576c0f2b6..086dafa272 100644 --- a/module/my/lang/vi.php +++ b/module/my/lang/vi.php @@ -63,5 +63,3 @@ $lang->my->form = new stdclass(); $lang->my->form->lblBasic = 'Thông tin cơ bản'; $lang->my->form->lblContact = 'Thông tin liên hệ'; $lang->my->form->lblAccount = 'Thông tin tài khoản'; - -$lang->my->taskSummary = "Tổng nhiệm vụ:%s.     Còn: %s(giờ)."; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 8955ce0b44..803d0baf95 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -76,5 +76,3 @@ $lang->my->form = new stdclass(); $lang->my->form->lblBasic = '基本信息'; $lang->my->form->lblContact = '联系信息'; $lang->my->form->lblAccount = '帐号信息'; - -$lang->my->taskSummary = "本页共 %s 个任务,剩余 %.1f 工时。"; diff --git a/module/my/lang/zh-tw.php b/module/my/lang/zh-tw.php index 6d9b0735d0..0a788ca0b4 100644 --- a/module/my/lang/zh-tw.php +++ b/module/my/lang/zh-tw.php @@ -59,5 +59,3 @@ $lang->my->form = new stdclass(); $lang->my->form->lblBasic = '基本信息'; $lang->my->form->lblContact = '聯繫信息'; $lang->my->form->lblAccount = '帳號信息'; - -$lang->my->taskSummary = "本頁共 %s 個任務,剩餘 %s 工時。"; diff --git a/module/my/model.php b/module/my/model.php index 75407cb5b6..ae7dffbbcc 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -56,33 +56,4 @@ class myModel extends model } } } - - /** - * Show the task summary of the current page. - * - * @param array $tasks - * @access public - * @return string - */ - public function taskSummary($tasks) - { - $taskSum = 0; - $totalLeft = 0.0; - - foreach($tasks as $task) - { - if($task->status != 'cancel' and $task->status != 'closed') $totalLeft += $task->left; - - if(isset($task->children)) - { - foreach($task->children as $children) - { - $taskSum ++; - } - } - $taskSum ++; - } - - return sprintf($this->lang->my->taskSummary, $taskSum, round($totalLeft, 1)); - } }