From 2d00396157a044240ffe3ad407b578a1be76c784 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Thu, 14 Jun 2012 01:28:00 +0000 Subject: [PATCH] * Code for task#693. --- module/bug/view/view.html.php | 37 +++++++++++++++++----------- module/product/view/browse.html.php | 2 +- module/story/view/view.html.php | 32 +++++++++++++++--------- module/task/view/view.html.php | 32 +++++++++++++----------- module/testcase/view/browse.html.php | 10 +++++--- module/testcase/view/view.html.php | 27 +++++++++++--------- www/theme/default/style.css | 9 +++++++ 7 files changed, 94 insertions(+), 55 deletions(-) diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 0aac32b154..b280eba648 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -21,14 +21,12 @@ $convertParams = "productID=$productID&moduleID=0&from=bug&bugID=$bug->id"; if(!$bug->deleted) { + common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign); if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' '; if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' '; - common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign); - common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit); - if(common::hasPriv('bug', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' '; if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' '; if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' '; - common::printLink('bug', 'create', $copyParams, $lang->bug->buttonCopy); + if($bug->status == 'active' and common::hasPriv('story', 'create')) { common::printLink('story', 'create', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $lang->bug->toStory) . ' '; @@ -38,16 +36,23 @@ echo $lang->bug->toStory . ' '; } common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase); - common::printLink('bug', 'delete', $params, $lang->delete, 'hiddenwin'); + + + common::printLink('bug', 'edit', $params, ' ', '', "class='icon-edit'"); + if(common::hasPriv('bug', 'edit')) echo html::a('#comment', ' ', '', "class='icon-comment' onclick='setComment()'"); + + common::printLink('bug', 'create', $copyParams, ' ', '', "class='icon-copy'"); + + common::printLink('bug', 'delete', $params, ' ', 'hiddenwin', "class='icon-delete'"); } - echo html::a($browseLink, $lang->goback); + echo html::a($browseLink, ' ', '', "class='icon-goback'"); if($preAndNext->pre) { - echo "" . html::a($this->inLink('view', "storyID={$preAndNext->pre->id}"), '<') . "  "; + echo "" . html::a($this->inLink('view', "storyID={$preAndNext->pre->id}"), ' ', '', "class='icon-pre'") . ""; } if($preAndNext->next) { - echo "next->id}{$lang->colon}{$preAndNext->next->title}>" . html::a($this->inLink('view', "storyID={$preAndNext->next->id}"), '>') . ""; + echo "next->id}{$lang->colon}{$preAndNext->next->title}>" . html::a($this->inLink('view', "storyID={$preAndNext->next->id}"), ' ', '', "class='icon-next'") . ""; } ?> @@ -66,14 +71,12 @@ deleted) { + common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign); if(!($bug->status == 'active' and $bug->confirmed == 0 and common::printLink('bug', 'confirmBug', $params, $lang->bug->buttonConfirm))) echo $lang->bug->buttonConfirm . ' '; if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' '; - common::printLink('bug', 'assignTo', $params, $lang->bug->buttonAssign); - common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit); - if(common::hasPriv('bug', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' '; if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' '; if(!(($bug->status == 'closed' or $bug->status == 'resolved') and $bug->resolution != 'tostory' and common::printLink('bug', 'activate', $params, $lang->bug->buttonActivate))) echo $lang->bug->buttonActivate . ' '; - common::printLink('bug', 'create', $copyParams, $lang->bug->buttonCopy); + if($bug->status == 'active' and common::hasPriv('bug', 'resolve')) { common::printLink('story', 'create', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $lang->bug->toStory) . ' '; @@ -83,9 +86,15 @@ echo $lang->bug->toStory . ' '; } common::printLink('testcase', 'create', $convertParams, $lang->bug->buttonCreateTestcase); - common::printLink('bug', 'delete', $params, $lang->delete, 'hiddenwin'); + + + common::printLink('bug', 'edit', $params, ' ', '', "class='icon-edit'"); + if(common::hasPriv('bug', 'edit')) echo html::a('#comment', ' ', '', "class='comment' onclick='setComment()'"). ' '; + + common::printLink('bug', 'create', $copyParams, ' ', '', "class='icon-copy'"); + common::printLink('bug', 'delete', $params, ' ', 'hiddenwin', "class='icon-delete'"); } - echo html::a($browseLink, $lang->goback); + echo html::a($browseLink, ' ', '', "class='icon-goback'"); ?> @@ -60,15 +64,19 @@ { if(!($story->status != 'closed' and common::printLink('story', 'change', "storyID=$story->id", $lang->story->change))) echo $lang->story->change . ' '; if(!(($story->status == 'draft' or $story->status == 'changed') and common::printLink('story', 'review', "storyID=$story->id", $lang->story->review))) echo $lang->story->review . ' '; - if(common::hasPriv('story', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' '; + if(!($story->status != 'closed' and common::printLink('story', 'close', "storyID=$story->id", $lang->story->close))) echo $lang->story->close . ' '; if(!($story->status == 'closed' and $story->closedReason == 'postponed' and common::printLink('story', 'activate', "storyID=$story->id", $lang->story->activate))) echo $lang->story->activate . ' '; + if(!common::printLink('testcase', 'create', "productID=$story->product&moduleID=0&from=¶m=0&storyID=$story->id", $lang->story->createCase)) echo $lang->story->createCase . ' '; - if(!common::printLink('story', 'edit', "storyID=$story->id", $lang->edit)) echo $lang->edit . ' '; - common::printLink('story', 'delete', "storyID=$story->id", $lang->delete, 'hiddenwin'); + + if(!common::printLink('story', 'edit', "storyID=$story->id", ' ', '', "class='icon-edit'")) echo ""; + if(common::hasPriv('story', 'edit')) echo html::a('#comment', ' ', '', "class='icon-comment' onclick='setComment()'"); + + common::printLink('story', 'delete', "storyID=$story->id", ' ', 'hiddenwin', "class='icon-delete'"); } - echo html::a($browseLink, $lang->goback); - ?> + echo html::a($browseLink, ' ', '', "class='icon-goback'"); + ?> @@ -59,17 +61,19 @@ deleted) { + if(!common::printLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $lang->task->assign)) echo $lang->task->assign . ' '; if(!(($task->status == 'wait') and common::printLink('task', 'start', "taskID=$task->id", $lang->task->buttonStart))) echo $lang->task->buttonStart . ' '; if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'finish', "taskID=$task->id", $lang->task->buttonDone))) echo $lang->task->buttonDone . ' '; if(!(($task->status == 'done' or $task->status == 'cancel') and common::printLink('task', 'close', "taskID=$task->id", $lang->task->buttonClose))) echo $lang->task->buttonClose . ' '; - if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'cancel', "taskID=$task->id", $lang->task->buttonCancel))) echo $lang->task->buttonCancel . ' '; if(!(($task->status == 'closed' or $task->status == 'done' or $task->status == 'cancel') and common::printLink('task', 'activate', "taskID=$task->id", $lang->task->buttonActivate))) echo $lang->task->buttonActivate . ' '; - if(!common::printLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $lang->task->assign)) echo $lang->task->assign . ' '; - if(!common::printLink('task', 'edit', "taskID=$task->id", $lang->task->buttonEdit)) echo $lang->task->buttonEdit . ' '; - if(common::hasPriv('task', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' '; - if(!common::printLink('task', 'delete',"projectID=$task->project&taskID=$task->id", $lang->task->buttonDelete, 'hiddenwin')) echo $lang->task->buttonDelete . ' '; + if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'cancel', "taskID=$task->id", $lang->task->buttonCancel))) echo $lang->task->buttonCancel . ' '; + + if(!common::printLink('task', 'edit', "taskID=$task->id", ' ', '', "class='icon-edit'")) echo ""; + if(common::hasPriv('task', 'edit')) echo html::a('#comment', ' ', '', "class='icon-comment' onclick='setComment()'"); + + if(!common::printLink('task', 'delete',"projectID=$task->project&taskID=$task->id", ' ', 'hiddenwin')) echo ""; } - echo html::a($browseLink, $lang->goback); + echo html::a($browseLink, ' ', '', "class='icon-goback'"); ?> @@ -70,11 +74,12 @@ deleted) { - if(common::hasPriv('testcase', 'edit')) echo html::a('#comment', $lang->comment, '', 'onclick=setComment()'). ' '; - common::printLink('testcase', 'edit', "caseID=$case->id", $lang->testcase->buttonEdit); - common::printLink('testcase', 'delete', "caseID=$case->id", $lang->delete, 'hiddenwin'); + common::printLink('testcase', 'edit', "caseID=$case->id", ' ', '', "class='icon-edit'"); + if(common::hasPriv('testcase', 'edit')) echo html::a('#comment', ' ', '', "class='icon-comment' onclick='setComment()'"); + + common::printLink('testcase', 'delete', "caseID=$case->id", ' ', 'hiddenwin', "class='icon-delete'"); } - echo html::a($browseLink, $lang->goback); + echo html::a($browseLink, ' ', '', "class='icon-goback'"); ?>