* Modify the statistic info of the task in my module.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.";
|
||||
|
||||
@@ -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>. Left: <strong>%s</strong>(h).";
|
||||
|
||||
@@ -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>. Reste: <strong>%s</strong>(h).";
|
||||
|
||||
@@ -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>. Còn: <strong>%s</strong>(giờ).";
|
||||
|
||||
@@ -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> 工时。";
|
||||
|
||||
@@ -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> 工時。";
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user