From 9c73a943f5c4e440ffc0cfa7a18f4c198012d1b0 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 22 Dec 2020 16:07:13 +0800 Subject: [PATCH] * Finish task #8797. --- module/common/lang/de.php | 2 +- module/common/lang/en.php | 2 +- module/common/lang/fr.php | 2 +- module/common/lang/vi.php | 2 +- module/common/lang/zh-cn.php | 2 +- module/my/control.php | 9 +++++---- module/my/view/execution.html.php | 8 ++++---- module/user/model.php | 7 ++----- 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/module/common/lang/de.php b/module/common/lang/de.php index b28be44e6f..2001c669b7 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -281,7 +281,7 @@ $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution'; +$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution&type=undone'; $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; $lang->my->contributeMenu->story = 'Story|my|contribute|mode=story'; $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 4577c27e9e..1a7e11d9fd 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -281,7 +281,7 @@ $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution'; +$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution&type=undone'; $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; $lang->my->contributeMenu->story = 'Story|my|contribute|mode=story'; $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index d368715616..5ab71645be 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -281,7 +281,7 @@ $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution'; +$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution&type=undone'; $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; $lang->my->contributeMenu->story = 'Story|my|contribute|mode=story'; $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; diff --git a/module/common/lang/vi.php b/module/common/lang/vi.php index fde811a3c6..84b2c78f43 100644 --- a/module/common/lang/vi.php +++ b/module/common/lang/vi.php @@ -281,7 +281,7 @@ $lang->my->workMenu->issue = 'Issue|my|work|mode=issue'; $lang->my->workMenu->risk = 'Risk|my|work|mode=risk'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution'; +$lang->my->contributeMenu->execution = 'Execution|my|contribute|mode=execution&type=undone'; $lang->my->contributeMenu->task = 'Task|my|contribute|mode=task'; $lang->my->contributeMenu->story = 'Story|my|contribute|mode=story'; $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 5cc39b9828..41c021abe5 100755 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -281,7 +281,7 @@ $lang->my->workMenu->issue = '问题|my|work|mode=issue'; $lang->my->workMenu->risk = '风险|my|work|mode=risk'; $lang->my->contributeMenu = new stdclass(); -$lang->my->contributeMenu->execution = '执行|my|contribute|mode=execution'; +$lang->my->contributeMenu->execution = '执行|my|contribute|mode=execution&type=undone'; $lang->my->contributeMenu->task = '任务|my|contribute|mode=task'; $lang->my->contributeMenu->story = '需求|my|contribute|mode=story'; $lang->my->contributeMenu->bug = 'Bug|my|contribute|mode=bug'; diff --git a/module/my/control.php b/module/my/control.php index e34411834f..0609c8f362 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -442,7 +442,8 @@ class my extends control /** * My executions. - * @param string $status undone|done + * @param string $type undone|done + * @param string $orderBy * @param int $recTotal * @param int $recPerPage * @param int $pageID @@ -450,7 +451,7 @@ class my extends control * @access public * @return void */ - public function execution($status = 'undone', $recTotal = 0, $recPerPage = 15, $pageID = 1) + public function execution($type = 'undone', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { $this->app->loadLang('project'); @@ -461,8 +462,8 @@ class my extends control $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->execution; $this->view->position[] = $this->lang->my->execution; $this->view->tabID = 'project'; - $this->view->executions = $this->user->getProjects($this->app->user->account, 'execution', $status, $pager); - $this->view->status = $status; + $this->view->executions = $this->user->getProjects($this->app->user->account, 'execution', $type, $pager); + $this->view->type = $type; $this->view->pager = $pager; $this->view->mode = 'execution'; diff --git a/module/my/view/execution.html.php b/module/my/view/execution.html.php index d7f52c0ee6..0cc3151658 100644 --- a/module/my/view/execution.html.php +++ b/module/my/view/execution.html.php @@ -16,8 +16,8 @@
{$pager->recTotal}"; - echo html::a(inlink('execution', "type=undone"), "{$lang->my->executionMenu->undone}" . ($status == 'undone' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($status == 'undone' ? ' btn-active-text' : '') . "'"); - echo html::a(inlink('execution', "type=done"), "{$lang->my->executionMenu->done}" . ($status == 'done' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($status == 'done' ? ' btn-active-text' : '') . "'"); + echo html::a(inlink('contribute', "mode=execution&type=undone"), "{$lang->my->executionMenu->undone}" . ($type == 'undone' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'undone' ? ' btn-active-text' : '') . "'"); + echo html::a(inlink('contribute', "mode=execution&type=done"), "{$lang->my->executionMenu->done}" . ($type == 'done' ? $recTotalLabel : ''), '', "class='btn btn-link" . ($type == 'done' ? ' btn-active-text' : '') . "'"); ?>
@@ -63,8 +63,8 @@ delay)):?> project->delayed;?> - processStatus('project', $execution);?> - + processStatus('project', $execution);?> + role;?> diff --git a/module/user/model.php b/module/user/model.php index 1f88e55c8f..54c1d8308c 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -999,11 +999,8 @@ class userModel extends model $hour = (object)$emptyHour; foreach($projectTasks as $task) { - if($task->status == 'wait') - { - $hour->waitTasks += 1; - $hour->totalConsumed += $task->consumed; - } + if($task->status == 'wait') $hour->waitTasks += 1; + if($task->status != 'cancel') $hour->totalConsumed += $task->consumed; if($task->status != 'cancel' and $task->status != 'closed') $hour->totalLeft += $task->left; } $hours[$projectID] = $hour;