From 94045515a0a4bc565f80eafac5a73038885fabc4 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 1 Apr 2021 10:26:52 +0800 Subject: [PATCH] * fix bug #11064. --- module/todo/lang/zh-cn.php | 1 + module/todo/view/view.html.php | 54 +++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index d26736be2e..29a5f6b1c2 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -68,6 +68,7 @@ $lang->todo->finishedDate = '完成时间'; $lang->todo->closedBy = '由谁关闭'; $lang->todo->closedDate = '关闭时间'; $lang->todo->deadline = '过期时间'; +$lang->todo->deleted = '已删除'; $lang->todo->every = '间隔'; $lang->todo->specify = '指定'; diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index a9c7c7547f..4ade094eed 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -19,6 +19,9 @@
id?> name;?> + deleted):?> + todo->deleted;?> +
@@ -56,34 +59,37 @@ $browseLink = $this->createLink('user', 'todo', "userID=$user->id"); } - if($this->app->user->admin or ($this->app->user->account == $todo->account) or ($this->app->user->account == $todo->assignedTo)) + if(!$todo->deleted) { - 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') + 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) + 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') { - $isonlybody = isonlybody(); - unset($_GET['onlybody']); - echo ""; - echo ""; - if($isonlybody) $_GET['onlybody'] = 'yes'; + 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 "
"; } - echo "
"; } } common::printRPN($browseLink);