diff --git a/module/common/control.php b/module/common/control.php index 30e52e4cea..927c077774 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -308,11 +308,13 @@ class common extends control echo html::a($backLink, ' ', '', "class='icon-goback' title={$lang->goback}"); if(isset($preAndNext->pre) and $preAndNext->pre) { - echo html::a($this->inLink('view', "ID={$preAndNext->pre->id}"), ' ', '', "id='pre' class='icon-pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->title}'"); + $title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name; + echo html::a($this->inLink('view', "ID={$preAndNext->pre->id}"), ' ', '', "id='pre' class='icon-pre' title='{$preAndNext->pre->id}{$lang->colon}{$title}'"); } if(isset($preAndNext->next) and $preAndNext->next) { - echo html::a($this->inLink('view', "ID={$preAndNext->next->id}"), ' ', '', "id='next' class='icon-next' title='{$preAndNext->next->id}{$lang->colon}{$preAndNext->next->title}'"); + $title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name; + echo html::a($this->inLink('view', "ID={$preAndNext->next->id}"), ' ', '', "id='next' class='icon-next' title='{$preAndNext->next->id}{$lang->colon}{$title}'"); } } diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 780f2524d0..8b4a8ded46 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -131,39 +131,10 @@ var browseType = ''; status == 'wait' or $task->status == 'doing') - { - echo html::a($this->inLink('task', 'finish'), ' ', "taskID=$task->id", "class='icon-green-small-task-finish' title='{$lang->task->buttonDone}'", false); - } - else - { - echo " "; - } - } - - if(common::hasPriv('task', 'close')) - { - if($task->status == 'done' or $task->status == 'cancel') - { - echo html::a($this->inLink('task', 'close', "taskID=$task->id"), ' ', '', "class='icon-green-small-task-close' title='{$lang->task->buttonClose}'", false); - } - else - { - echo " "; - } - } - - if(!common::printLink('task', 'edit', "taskID=$task->id", ' ', '', "class='icon-green-small-edit' title='{$lang->task->buttonEdit}'")) - { - echo " "; - } - - if($browseType == 'needconfirm') - { - common::printLink('task', 'confirmStoryChange', "taskid=$task->id", $lang->confirm, 'hiddenwin'); - } + if($browseType == 'needconfirm') common::printLink('task', 'confirmStoryChange', "taskid=$task->id", $lang->confirm, 'hiddenwin'); + if($this->task->isClickable($task, 'finish')) common::printIcon('task', 'finish', "taskID=$task->id", $task); + if($this->task->isClickable($task, 'close')) common::printIcon('task', 'close', "taskID=$task->id", $task); + if($this->task->isClickable($task, 'edit')) common::printIcon('task', 'edit', "taskID=$task->id"); ?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 99fcbd1087..90ebb22b34 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -58,7 +58,7 @@ fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?> - + @@ -120,88 +56,7 @@ fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?> -
- deleted) - { - common::printLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $lang->task->assign); - if(common::hasPriv('task', 'start')) - { - if($task->status == 'wait') - { - echo html::a($this->inLink('start', "taskID=$task->id"), $lang->task->buttonStart); - } - else - { - echo $lang->task->buttonStart . ' '; - } - } - - if(common::hasPriv('task', 'finish')) - { - if($task->status == 'wait' or $task->status == 'doing') - { - echo html::a($this->inLink('finish', "taskID=$task->id"), $lang->task->buttonDone); - } - else - { - echo $lang->task->buttonDone . ' '; - } - } - - if(common::hasPriv('task', 'close')) - { - if($task->status == 'done' or $task->status == 'cancel') - { - echo html::a($this->inLink('close', "taskID=$task->id"), $lang->task->buttonClose); - } - else - { - echo $lang->task->buttonClose . ' '; - } - } - - if(common::hasPriv('task', 'activate')) - { - if($task->status == 'closed' or $task->status == 'done' or $task->status == 'cancel') - { - echo html::a($this->inLink('activate', "taskID=$task->id"), $lang->task->buttonActivate); - } - else - { - echo $lang->task->buttonActivate . ' '; - } - } - - if(common::hasPriv('task', 'cancel')) - { - if($task->status == 'wait' or $task->status == 'doing') - { - echo html::a($this->inLink('cancel', "taskID=$task->id"), $lang->task->buttonCancel); - } - else - { - echo $lang->task->buttonCancel . ' '; - } - } - if(common::hasPriv('task', 'assignTo') or common::hasPriv('task', 'start') - or common::hasPriv('task', 'finish') or common::hasPriv('task', 'close') - or common::hasPriv('task', 'activate') or common::hasPriv('task', 'cancel')) - { - echo " "; - } - - common::printLink('task', 'edit', "taskID=$task->id", ' ', '', "class='icon-green-big-edit' title='{$lang->task->edit}'"); - if(common::hasPriv('task', 'edit')) echo html::a('#comment', ' ', '', "class='icon-green-big-comment' onclick='setComment()' title='{$lang->comment}'"); - common::printLink('task', 'delete',"projectID=$task->project&taskID=$task->id", ' ', 'hiddenwin', "class='icon-green-big-delete' title='{$lang->delete}'"); - if(common::hasPriv('task', 'edit') or common::hasPriv('task', 'delete')) - { - echo " "; - } - } - echo html::a($browseLink, ' ', '', "class='icon-green-big-goback' title='{$lang->goback}'"); - ?> -
+