From eeea421cf901c28ffb02f39ec4250f1deff637ce Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Mon, 20 Jul 2020 13:13:41 +0800 Subject: [PATCH] * Finish task #7487,7488. --- module/task/view/recordestimate.html.php | 2 +- module/todo/view/view.html.php | 55 +++++++++++++----------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/module/task/view/recordestimate.html.php b/module/task/view/recordestimate.html.php index dbd7c39879..398a6bacc4 100644 --- a/module/task/view/recordestimate.html.php +++ b/module/task/view/recordestimate.html.php @@ -59,7 +59,7 @@ team) or $task->assignedTo == $this->app->user->account):?> status == 'wait' or $task->status == 'pause' or $task->status == 'doing') + if(($task->status == 'wait' or $task->status == 'pause' or $task->status == 'doing') and ($this->app->user->admin or $this->app->user->account == $estimate->account)) { common::printIcon('task', 'editEstimate', "estimateID=$estimate->id", '', 'list', 'pencil', '', 'showinonlybody', true); common::printIcon('task', 'deleteEstimate', "estimateID=$estimate->id", '', 'list', 'close', 'hiddenwin', 'showinonlybody'); diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index a8de327a32..f9b57cf3a2 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -38,15 +38,10 @@ createLink('action', 'comment', "objectType=todo&objectID=$todo->id");?> +
status == 'wait') common::printLink('todo', 'start', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->start}' class='btn showinonlybody'"); - if($todo->status == 'done' || $todo->status == 'closed') common::printLink('todo', 'activate', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'"); - if($todo->status == 'done') common::printLink('todo', 'close', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->close}' class='btn showinonlybody'"); - common::printLink('todo', 'edit', "todoID=$todo->id", "", '', "title='{$lang->todo->edit}' class='btn showinonlybody'"); - common::printLink('todo', 'delete', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'"); - if($this->session->todoList) { $browseLink = $this->session->todoList; @@ -60,28 +55,36 @@ $browseLink = $this->createLink('user', 'todo', "account=$todo->account"); } - if($todo->status != 'done' && $todo->status != 'closed') + if($this->app->user->admin or ($this->app->user->account == $todo->account) or ($this->app->user->account == $todo->assignedTo)) { - echo "
"; - echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "", 'hiddenwin', "title='{$lang->todo->finish}' class='btn showinonlybody btn-success'"); - $createStoryPriv = common::hasPriv('story', 'create'); - $createTaskPriv = common::hasPriv('task', 'create'); - $createBugPriv = common::hasPriv('bug', 'create'); - if($createStoryPriv or $createTaskPriv or $createBugPriv) - { - $isonlybody = isonlybody(); - unset($_GET['onlybody']); - echo ""; - echo ""; - if($isonlybody) $_GET['onlybody'] = 'yes'; - } - echo "
"; - } + if($todo->status == 'wait') common::printLink('todo', 'start', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->start}' class='btn showinonlybody'"); + if($todo->status == 'done' || $todo->status == 'closed') common::printLink('todo', 'activate', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->activate}' class='btn showinonlybody'"); + if($todo->status == 'done') common::printLink('todo', 'close', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->close}' class='btn showinonlybody'"); + common::printLink('todo', 'edit', "todoID=$todo->id", "", '', "title='{$lang->todo->edit}' class='btn showinonlybody'"); + common::printLink('todo', 'delete', "todoID=$todo->id", "", 'hiddenwin', "title='{$lang->todo->delete}' class='btn showinonlybody'"); + if($todo->status != 'done' && $todo->status != 'closed') + { + echo "
"; + echo html::a($this->createLink('todo', 'finish', "id=$todo->id", 'html', true), "", 'hiddenwin', "title='{$lang->todo->finish}' class='btn showinonlybody btn-success'"); + $createStoryPriv = common::hasPriv('story', 'create'); + $createTaskPriv = common::hasPriv('task', 'create'); + $createBugPriv = common::hasPriv('bug', 'create'); + if($createStoryPriv or $createTaskPriv or $createBugPriv) + { + $isonlybody = isonlybody(); + unset($_GET['onlybody']); + echo ""; + echo ""; + if($isonlybody) $_GET['onlybody'] = 'yes'; + } + echo "
"; + } + } common::printRPN($browseLink); ?>