From 056f99d27d8f02f9533448b6ac64cf036ca448b0 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 17 Jan 2013 06:44:33 +0000 Subject: [PATCH] * adjust the icons of project views. * add onlybody params for helper::createLink. --- framework/helper.class.php | 4 ++-- module/build/view/view.html.php | 6 +++--- module/common/control.php | 9 +++------ module/project/css/bug.css | 2 -- module/project/css/common.css | 2 ++ module/project/lang/en.php | 1 - module/project/lang/zh-cn.php | 1 - module/project/view/build.html.php | 6 +++--- module/project/view/doc.html.php | 9 ++++++--- module/project/view/story.html.php | 8 ++++---- module/project/view/testtask.html.php | 8 ++++---- module/testtask/view/view.html.php | 12 +++++++----- www/theme/default/style.css | 18 ++++++++++++++++-- 13 files changed, 50 insertions(+), 36 deletions(-) delete mode 100644 module/project/css/bug.css diff --git a/framework/helper.class.php b/framework/helper.class.php index 9237314fce..62602f2311 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -61,7 +61,7 @@ class helper * @access public * @return string the link string. */ - static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '') + static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlybody = false) { global $app, $config; $link = $config->requestType == 'PATH_INFO' ? $config->webRoot : $_SERVER['PHP_SELF']; @@ -108,7 +108,7 @@ class helper } /* if page has onlybody param then add this param in all link. the param hide header and footer. */ - if(isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes') + if($onlybody or (isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')) { $onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes"; $link .= $onlybody; diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 4a69a5daa0..32736b6a54 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -25,10 +25,10 @@ $browseLink = $this->session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project"); if(!$build->deleted) { - common::printLink('build', 'edit', "buildID=$build->id", $lang->edit); - common::printLink('build', 'delete', "buildID=$build->id", $lang->delete, 'hiddenwin'); + common::printIcon('build', 'edit', "buildID=$build->id"); + common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); } - echo html::a($browseLink, $lang->goback); + echo common::printRPN($browseLink); ?> diff --git a/module/common/control.php b/module/common/control.php index 6012199c7b..c330e625ee 100644 --- a/module/common/control.php +++ b/module/common/control.php @@ -203,10 +203,7 @@ class common extends control public static function printLink($module, $method, $vars = '', $label, $target = '', $misc = '', $newline = true, $onlyBody = false) { if(!common::hasPriv($module, $method)) return false; - global $config; - $concat = $config->requestType == 'GET' ? '&' : '?'; - $onlyBody = $onlyBody ? $concat . "onlybody=yes" : ''; - echo html::a(helper::createLink($module, $method, $vars) . $onlyBody, $label, $target, $misc, $newline); + echo html::a(helper::createLink($module, $method, $vars, '', $onlyBody), $label, $target, $misc, $newline); return true; } @@ -254,7 +251,7 @@ class common extends control * @access public * @return void */ - public static function printIcon($module, $method, $vars = '', $object = '', $type = 'button', $icon = '', $target = '', $extraClass = '') + public static function printIcon($module, $method, $vars = '', $object = '', $type = 'button', $icon = '', $target = '', $extraClass = '', $onlyBody = false) { global $app, $lang; @@ -276,7 +273,7 @@ class common extends control if(strtolower($module) == 'bug' and strtolower($method) == 'tostory') ($module = 'story') and ($method = 'create'); if(strtolower($module) == 'bug' and strtolower($method) == 'createcase') ($module = 'testcase') and ($method = 'create'); if(!common::hasPriv($module, $method)) return false; - $link = helper::createLink($module, $method, $vars); + $link = helper::createLink($module, $method, $vars, '', $onlyBody); /* Set the icon title, try search the $method defination in $module's lang or $common's lang. */ $title = $method; diff --git a/module/project/css/bug.css b/module/project/css/bug.css deleted file mode 100644 index fa1e337bb7..0000000000 --- a/module/project/css/bug.css +++ /dev/null @@ -1,2 +0,0 @@ -caption {margin-bottom:10px} -caption a{padding:5px} diff --git a/module/project/css/common.css b/module/project/css/common.css index 980dc627c0..7e12176b18 100644 --- a/module/project/css/common.css +++ b/module/project/css/common.css @@ -1,2 +1,4 @@ #productsBox span{display:block; float:left; width:250px; overflow:hidden; word-break:keep-all; white-space:nowrap} #whitelistBox span{display:block; float:left; width:150px; overflow:hidden; word-break:keep-all; white-space:nowrap} +caption {margin-bottom:10px} +caption a{padding:5px} diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 8c794e1d80..8221f28d79 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -49,7 +49,6 @@ $lang->project->totalConsumed = 'Done'; $lang->project->totalLeft = 'Left'; $lang->project->progess = 'Progess'; $lang->project->viewBug = 'View bug'; -$lang->project->createTesttask= 'Create testtask'; $lang->project->noProduct = 'No product'; $lang->project->select = '--select project--'; $lang->project->createStory = "Create story"; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 482773c62b..aa217f81d3 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -49,7 +49,6 @@ $lang->project->totalConsumed = '总消耗'; $lang->project->totalLeft = '总剩余'; $lang->project->progess = '进度'; $lang->project->viewBug = '查看bug'; -$lang->project->createTesttask= '提交测试'; $lang->project->noProduct = '无产品项目'; $lang->project->select = '--请选择项目--'; $lang->project->createStory = "新增需求"; diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 5d79e19f4d..a5a50c20a2 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -15,7 +15,7 @@
@@ -43,8 +43,8 @@ id&build=$build->id", $lang->testtask->create); common::printLink('project', 'bug', "project=$project->id&orderBy=status&build=$build->id", $lang->project->viewBug); - common::printLink('build', 'edit', "buildID=$build->id", ' ', '', "class='icon-green-small-edit' title='{$lang->edit}'", false); - common::printLink('build', 'delete', "buildID=$build->id", ' ', 'hiddenwin', "class='icon-green-small-delete' title='{$lang->delete}'", false); + common::printIcon('build', 'edit', "buildID=$build->id"); + common::printIcon('build', 'delete', "buildID=$build->id", '', 'list', '', 'hiddenwin'); ?> diff --git a/module/project/view/doc.html.php b/module/project/view/doc.html.php index b753eb56a0..1608b03f4f 100644 --- a/module/project/view/doc.html.php +++ b/module/project/view/doc.html.php @@ -14,7 +14,10 @@
project->build;?>
-
id", $lang->build->create);?>
+
id");?>
- + @@ -40,8 +43,8 @@ diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 520401e2d7..ee2474dfd4 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -39,7 +39,7 @@ - + @@ -67,12 +67,12 @@ $storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0); ?> -
id&from=project", $lang->doc->create);?> +
project->doc;?>
+
id&from=project");?>
+
idAB;?> id}"; - if(!common::printLink('doc', 'edit', $vars, $lang->edit)) echo $lang->edit; - if(!common::printLink('doc', 'delete', $vars, $lang->delete, 'hiddenwin')) echo $lang->delete; + common::printIcon('doc', 'edit', $vars); + common::printIcon('doc', 'delete', $vars, '', 'list', '','hiddenwin'); ?>
statusAB);?> story->stageAB);?> story->taskCount;?> actions;?> actions;?>
+ id}&story={$story->id}"; -// $lang->task->batchCreate = $lang->project->batchWBS; - common::printLink('task', 'batchCreate', $param . "&iframe=1", $lang->project->batchWBS, '', "class='batchWBS'", true, true); + $lang->task->batchCreate = $lang->project->batchWBS; + common::printIcon('task', 'batchCreate', $param . "&iframe=1", '', 'list', '', '', 'batchWBS', true); $lang->task->create = $lang->project->wbs; common::printIcon('task', 'create', $param, '', 'list'); diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php index b12f06752b..8fa2148fb3 100644 --- a/module/project/view/testtask.html.php +++ b/module/project/view/testtask.html.php @@ -15,7 +15,7 @@ @@ -26,7 +26,7 @@ - + @@ -41,8 +41,8 @@
testtask->browse;?>
-
project->createTesttask);?>
+
testtask->begin;?> testtask->end;?> statusAB;?>actions;?>actions;?>
testtask->statusList[$task->status];?> id", $lang->testtask->cases); - common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCaseAB); + common::printIcon('testtask', 'cases', "taskID=$task->id", '', 'list'); + common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'list'); common::printIcon('testtask', 'edit', "taskID=$task->id", '', 'list'); common::printIcon('testtask', 'delete', "taskID=$task->id", '', 'list', '', 'hiddenwin'); ?> diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 691efea73c..d654dcd5e6 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -56,12 +56,14 @@ $browseLink = $this->session->testtaskList ? $this->session->testtaskList : $this->createLink('testtask', 'browse', "productID=$task->product"); if(!$task->deleted) { - common::printLink('testtask', 'cases', "taskID=$task->id", $lang->testtask->cases); - common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCaseAB); - common::printLink('testtask', 'edit', "taskID=$task->id",$lang->edit); - common::printLink('testtask', 'delete', "taskID=$task->id", $lang->delete, 'hiddenwin'); + common::printIcon('testtask', 'cases', "taskID=$task->id"); + common::printIcon('testtask', 'linkCase', "taskID=$task->id"); + + common::printDivider(); + common::printIcon('testtask', 'edit', "taskID=$task->id"); + common::printIcon('testtask', 'delete', "taskID=$task->id", '', 'button', '', 'hiddenwin'); } - echo html::a($browseLink, $lang->goback); + common::printRPN($browseLink); ?> diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 65843adbbf..6f8fd0883f 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -448,7 +448,7 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table #featurebar .f-right .icon-green-common-report {padding:2px 10px; background:url(images/main/zt-icons.png) -40px -82px no-repeat;} #featurebar .f-right .icon-green-common-export, .icon-green-common-export {padding:2px 8px; background:url(images/main/zt-icons.png) -21px -82px;} -#featurebar .f-right .icon-green-todo-create, .icon-green-productplan-create, .icon-green-release-create, .icon-green-doc-create {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -202px;} +#featurebar .f-right .icon-green-todo-create, .icon-green-productplan-create, .icon-green-release-create, .icon-green-doc-create, .icon-green-build-create {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -202px;} /* Story icons. */ .icon-green-story-toStory {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -202px;} @@ -473,6 +473,15 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table #featurebar .f-right .icon-green-story-create {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) 0px -202px;} #featurebar .f-right .icon-green-story-batchCreate {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) -20px -202px;} +/* Project icons. */ +.icon-green-project-start {padding:2px 8px; background:url(images/main/zt-icons.png) -61px -242px;} +.icon-green-project-activate {padding:2px 8px; background:url(images/main/zt-icons.png) -120px -241px;} + +.icon-green-project-delay {} +.icon-green-project-suspend {} + +.icon-green-project-close {padding:2px 8px; background:url(images/main/zt-icons.png) -100px -241px;} + /* Task icons. */ .icon-green-task-confirmStoryChange {padding:2px 8px; background:url(images/main/zt-icons.png) -60px -201px;} @@ -494,7 +503,7 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .icon-gray-task-close {padding:2px 8px; background:url(images/main/zt-icons.png) -100px -261px;} #featurebar .f-right .icon-green-task-create, .icon-green-task-create {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) 0px -242px;} -#featurebar .f-right .icon-green-task-batchCreate {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) -20px -242px;} +#featurebar .f-right .icon-green-task-batchCreate, .icon-green-task-batchCreate {padding:2px 7px 2px 10px; background:url(images/main/zt-icons.png) -20px -242px;} /* Bug icons. */ .severity1 {width:17px; margin:0px auto; display:block; background:url(images/main/zt-icons.png) 0px -383px; text-indent:-9999px;} @@ -535,6 +544,11 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .link-button a{color:black; font-weight:normal; font-size:14px;} .link-button a:hover {color:RGB(234, 0, 0);} +/* Testtask icons. */ +.icon-green-testtask-create {padding:2px 8px; background:url(images/main/zt-icons.png) 0px -202px;} +.icon-green-testtask-cases {padding:1px 7px 1px 10px; background:url(images/main/zt-icons.png) -80px -322px;} +.icon-green-testtask-linkCase {padding:2px 3px 2px 10px; background:url(images/main/zt-icons.png) -160px -201px;} + /* Effort icons. */ .icon-green-effort-createForObject {padding:2px 8px; background:url(images/main/zt-icons.png) -80px -2px;}