* Modify the statistic info of the task in my module.

This commit is contained in:
hufangzhou
2021-01-01 10:39:53 +08:00
parent 40517fa1ec
commit bdd813d290
8 changed files with 1 additions and 42 deletions
+1 -1
View File
@@ -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;
-2
View File
@@ -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: <strong>%s</strong> Total, <strong>%s</strong> Rest.";
-2
View File
@@ -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:<strong>%s</strong>. &nbsp;&nbsp;&nbsp; Left: <strong>%s</strong>(h).";
-2
View File
@@ -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 :<strong>%s</strong>. &nbsp;&nbsp;&nbsp; Reste: <strong>%s</strong>(h).";
-2
View File
@@ -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ụ:<strong>%s</strong>. &nbsp;&nbsp;&nbsp; Còn: <strong>%s</strong>(giờ).";
-2
View File
@@ -76,5 +76,3 @@ $lang->my->form = new stdclass();
$lang->my->form->lblBasic = '基本信息';
$lang->my->form->lblContact = '联系信息';
$lang->my->form->lblAccount = '帐号信息';
$lang->my->taskSummary = "本页共 <strong>%s</strong> 个任务,剩余 <strong>%.1f</strong> 工时。";
-2
View File
@@ -59,5 +59,3 @@ $lang->my->form = new stdclass();
$lang->my->form->lblBasic = '基本信息';
$lang->my->form->lblContact = '聯繫信息';
$lang->my->form->lblAccount = '帳號信息';
$lang->my->taskSummary = "本頁共 <strong>%s</strong> 個任務,剩餘 <strong>%s</strong> 工時。";
-29
View File
@@ -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));
}
}