diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index fafdbb27af..b3c2b97943 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -33,7 +33,7 @@ js::set('customed', $customed); echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs¶m=0"), $lang->bug->postponedBugs) . ""; echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->bug->needConfirm) . ""; - echo "{$lang->bug->byQuery} "; + echo " {$lang->bug->byQuery} "; ?>
diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 84342ce312..6e73f7756e 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -9,7 +9,7 @@ * @version $Id: en.php 5116 2013-07-12 06:37:48Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->arrow = '  '; +$lang->arrow = ' '; $lang->colon = '::'; $lang->comma = ','; $lang->dot = '.'; @@ -136,7 +136,7 @@ $lang->index->menu->project = 'Projects|project|browse'; $lang->my = new stdclass(); $lang->my->menu = new stdclass(); -$lang->my->menu->account = ' %s' . $lang->arrow; +$lang->my->menu->account = ' %s' . $lang->arrow . ''; $lang->my->menu->index = 'Index|my|index'; $lang->my->menu->todo = array('link' => 'Todo|my|todo|', 'subModule' => 'todo'); $lang->my->menu->task = array('link' => 'Task|my|task|', 'subModule' => 'task'); @@ -192,7 +192,7 @@ $lang->project->menu->doc = array('link' => 'Doc|project|doc|porjectID=%s' $lang->project->menu->product = array('link' => 'Product|project|manageproducts|projectID=%s', 'alias' => 'edit,start,suspend,delay,close'); $lang->project->menu->view = 'Manage|project|view|projectID=%s'; $lang->project->menu->create = array('link' => ' New|project|create', 'float' => 'right'); -$lang->project->menu->all = array('link' => ' Projects|project|index|locate=no&status=all&projectID=%s', 'float' => 'right'); +$lang->project->menu->all = array('link' => ' Projects|project|index|locate=no&status=all&projectID=%s', 'float' => 'right'); $lang->task = new stdclass(); $lang->build = new stdclass(); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 52c9bf4100..1f9bc77aec 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -9,7 +9,7 @@ * @version $Id: zh-cn.php 5116 2013-07-12 06:37:48Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->arrow = '  '; +$lang->arrow = ' '; $lang->colon = '::'; $lang->comma = ','; $lang->dot = '。'; @@ -136,7 +136,7 @@ $lang->index->menu->project = '浏览项目|project|browse'; $lang->my = new stdclass(); $lang->my->menu = new stdclass(); -$lang->my->menu->account = ' %s' . $lang->arrow; +$lang->my->menu->account = ' %s' . $lang->arrow . ''; $lang->my->menu->index = '首页|my|index'; $lang->my->menu->todo = array('link' => '待办|my|todo|', 'subModule' => 'todo'); $lang->my->menu->task = array('link' => '任务|my|task|', 'subModule' => 'task'); @@ -165,8 +165,8 @@ $lang->product->menu->doc = array('link' => '文档|product|doc|productID=%s $lang->product->menu->view = array('link' => '维护|product|view|productID=%s', 'alias' => 'edit'); $lang->product->menu->module = '模块|tree|browse|productID=%s&view=story'; $lang->product->menu->project = '项目|product|project|status=all&productID=%s'; -$lang->product->menu->create = array('link' => ' 添加产品|product|create', 'float' => 'right'); -$lang->product->menu->all = array('link' => ' 所有产品|product|index|locate=no&productID=%s', 'float' => 'right'); +$lang->product->menu->create = array('link' => ' 添加产品|product|create', 'float' => 'right'); +$lang->product->menu->all = array('link' => ' 所有产品|product|index|locate=no&productID=%s', 'float' => 'right'); $lang->story = new stdclass(); $lang->productplan = new stdclass(); @@ -191,8 +191,8 @@ $lang->project->menu->team = array('link' => '团队|project|team|projectID $lang->project->menu->doc = array('link' => '文档|project|doc|porjectID=%s', 'subModule' => 'doc'); $lang->project->menu->product = '产品|project|manageproducts|projectID=%s'; $lang->project->menu->view = array('link' => '维护|project|view|projectID=%s', 'alias' => 'edit,start,suspend,putoff,close'); -$lang->project->menu->create = array('link' => ' 添加项目|project|create', 'float' => 'right'); -$lang->project->menu->all = array('link' => ' 所有项目|project|index|locate=no&status=all&projectID=%s', 'float' => 'right'); +$lang->project->menu->create = array('link' => ' 添加项目|project|create', 'float' => 'right'); +$lang->project->menu->all = array('link' => ' 所有项目|project|index|locate=no&status=all&projectID=%s', 'float' => 'right'); $lang->task = new stdclass(); $lang->build = new stdclass(); @@ -228,7 +228,7 @@ $lang->doc->menu->browse = array('link' => '文档|doc|browse|libID=%s', 'alias $lang->doc->menu->edit = '编辑|doc|editLib|libID=%s'; $lang->doc->menu->module = '分类|tree|browse|libID=%s&viewType=doc'; $lang->doc->menu->delete = array('link' => '删除|doc|deleteLib|libID=%s', 'target' => 'hiddenwin'); -$lang->doc->menu->create = array('link' => ' 添加文档库|doc|createLib', 'float' => 'right'); +$lang->doc->menu->create = array('link' => ' 添加文档库|doc|createLib', 'float' => 'right'); /* 统计视图菜单设置。*/ $lang->report = new stdclass(); @@ -255,9 +255,9 @@ $lang->company->menu->dept = array('link' => '部门|dept|browse', 'subM $lang->company->menu->browseGroup = array('link' => '权限|group|browse', 'subModule' => 'group'); $lang->company->menu->view = array('link' => '公司|company|view', 'alias' => 'edit'); $lang->company->menu->dynamic = '动态|company|dynamic|'; -$lang->company->menu->addGroup = array('link' => ' 添加分组|group|create', 'float' => 'right'); -$lang->company->menu->batchAddUser = array('link' => ' 批量添加|user|batchCreate|dept=%s', 'subModule' => 'user', 'float' => 'right'); -$lang->company->menu->addUser = array('link' => ' 添加用户|user|create|dept=%s', 'subModule' => 'user', 'float' => 'right'); +$lang->company->menu->addGroup = array('link' => ' 添加分组|group|create', 'float' => 'right'); +$lang->company->menu->batchAddUser = array('link' => ' 批量添加|user|batchCreate|dept=%s', 'subModule' => 'user', 'float' => 'right'); +$lang->company->menu->addUser = array('link' => ' 添加用户|user|create|dept=%s', 'subModule' => 'user', 'float' => 'right'); $lang->dept = new stdclass(); $lang->group = new stdclass(); diff --git a/module/common/lang/zh-tw.php b/module/common/lang/zh-tw.php index e08eda509d..29a9d22ea8 100644 --- a/module/common/lang/zh-tw.php +++ b/module/common/lang/zh-tw.php @@ -9,7 +9,7 @@ * @version $Id: zh-tw.php 5116 2013-07-12 06:37:48Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->arrow = '  '; +$lang->arrow = ' '; $lang->colon = '::'; $lang->comma = ','; $lang->dot = '。'; @@ -136,7 +136,7 @@ $lang->index->menu->project = '瀏覽項目|project|browse'; $lang->my = new stdclass(); $lang->my->menu = new stdclass(); -$lang->my->menu->account = ' %s' . $lang->arrow; +$lang->my->menu->account = ' %s' . $lang->arrow . ''; $lang->my->menu->index = '首頁|my|index'; $lang->my->menu->todo = array('link' => '待辦|my|todo|', 'subModule' => 'todo'); $lang->my->menu->task = array('link' => '任務|my|task|', 'subModule' => 'task'); @@ -166,7 +166,7 @@ $lang->product->menu->view = array('link' => '維護|product|view|productID=% $lang->product->menu->module = '模組|tree|browse|productID=%s&view=story'; $lang->product->menu->project = '項目|product|project|status=all&productID=%s'; $lang->product->menu->create = array('link' => ' 添加產品|product|create', 'float' => 'right'); -$lang->product->menu->all = array('link' => ' 所有產品|product|index|locate=no&productID=%s', 'float' => 'right'); +$lang->product->menu->all = array('link' => ' 所有產品|product|index|locate=no&productID=%s', 'float' => 'right'); $lang->story = new stdclass(); $lang->productplan = new stdclass(); @@ -192,7 +192,7 @@ $lang->project->menu->doc = array('link' => '文檔|project|doc|porjectID= $lang->project->menu->product = '產品|project|manageproducts|projectID=%s'; $lang->project->menu->view = array('link' => '維護|project|view|projectID=%s', 'alias' => 'edit,start,suspend,putoff,close'); $lang->project->menu->create = array('link' => ' 添加項目|project|create', 'float' => 'right'); -$lang->project->menu->all = array('link' => ' 所有項目|project|index|locate=no&status=all&projectID=%s', 'float' => 'right'); +$lang->project->menu->all = array('link' => ' 所有項目|project|index|locate=no&status=all&projectID=%s', 'float' => 'right'); $lang->task = new stdclass(); $lang->build = new stdclass(); diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php index 9161347c42..440af32f2a 100755 --- a/module/common/view/header.html.php +++ b/module/common/view/header.html.php @@ -7,7 +7,7 @@ include 'chosen.html.php'; ?> - +
diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index d5e3c9ca6d..6eb93cc39a 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -28,7 +28,7 @@ var browseType = ''; echo "" . html::select('account', $users, $account, 'onchange=changeUser(this.value)') . ''; echo "" . html::select('product', $products, $product, 'onchange=changeProduct(this.value)') . ''; echo "" . html::select('project', $projects, $project, 'onchange=changeProject(this.value)') . ''; - echo "" . html::a('#', '' . $lang->action->dynamic->search) . ""; + echo "" . html::a('#', ' ' . $lang->action->dynamic->search) . ""; ?>
'>
diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 964b8268d3..d4c1178d34 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -21,7 +21,7 @@ var browseType = '';
diff --git a/module/my/css/index.css b/module/my/css/index.css index 58a37d5364..5d39a38314 100644 --- a/module/my/css/index.css +++ b/module/my/css/index.css @@ -8,11 +8,4 @@ #row1 .table-1, #row1 caption{border:none} #row2 .table-1, #row2 caption{border:none} -caption .f-left {padding-left:0px} - -.icon-dynamic {padding-left:16px; background:url(../theme/default/images/main/zt-icons.png); background-position:-65px -444px;} -.icon-more {padding-left:16px; background:url(../theme/default/images/main/zt-icons.png); background-position:-202px -443px;} -.icon-todo {padding-left:16px; background:url(../theme/default/images/main/zt-icons.png); background-position:-2px -443px;} -.icon-bug {padding-left:16px; background:url(../theme/default/images/main/zt-icons.png); background-position:-42px -442px;} -.icon-task {padding-left:16px; background:url(../theme/default/images/main/zt-icons.png); background-position:-22px -442px;} -.icon-story {padding-left:16px; background:url(../theme/default/images/main/zt-icons.png); background-position:-82px -443px;} +caption .f-left {padding-left:0px} \ No newline at end of file diff --git a/module/my/view/blockbugs.html.php b/module/my/view/blockbugs.html.php index dda0f7d5eb..74df408c7a 100644 --- a/module/my/view/blockbugs.html.php +++ b/module/my/view/blockbugs.html.php @@ -1,8 +1,8 @@
$bugTitle) diff --git a/module/my/view/blockdynamic.html.php b/module/my/view/blockdynamic.html.php index 52460926bc..95eccdf039 100644 --- a/module/my/view/blockdynamic.html.php +++ b/module/my/view/blockdynamic.html.php @@ -1,8 +1,8 @@
-
  my->bug;?>
-
createLink('my', 'bug'), $lang->more . "");?>
+
  my->bug;?>
+
createLink('my', 'bug'), $lang->more . " ");?>
-
my->home->latest;?>
-
more . "");?>
+
  my->home->latest;?>
+
more . " ");?>
- +
 my->home->products;?>  my->home->products;?>
@@ -16,7 +16,7 @@
- + diff --git a/module/my/view/blockprojects.html.php b/module/my/view/blockprojects.html.php index 6a6a6c4569..01da6f4ca8 100644 --- a/module/my/view/blockprojects.html.php +++ b/module/my/view/blockprojects.html.php @@ -1,7 +1,7 @@
 product->name;?>
  product->name;?>
story->statusList['active'];?> story->statusList['changed'];?> story->statusList['draft'];?>
- +
 my->home->projects;?> my->home->projects;?>
@@ -16,7 +16,7 @@
- + diff --git a/module/my/view/blockstories.html.php b/module/my/view/blockstories.html.php index db2728357e..cddad4ea38 100644 --- a/module/my/view/blockstories.html.php +++ b/module/my/view/blockstories.html.php @@ -2,7 +2,7 @@
  project->name;?>
  project->name;?>
project->end;?> statusAB;?> project->totalEstimate;?>
  my->story;?>
-
createLink('my', 'story'), $lang->more . "");?>
+
createLink('my', 'story'), $lang->more . " ");?>
-
 my->task;?>
-
createLink('my', 'task'), $lang->more . "");?>
+
  my->task;?>
+
createLink('my', 'task'), $lang->more . " ");?>
inlink('browse', "productID=$productID&browseType=activeStory"), $lang->product->activeStory);?> inlink('browse', "productID=$productID&browseType=changedStory"), $lang->product->changedStory);?> inlink('browse', "productID=$productID&browseType=closedStory"), $lang->product->closedStory);?> - product->searchStory;?> +  product->searchStory;?>
project->groups, isset($groupBy) ? $groupBy : '', "onchange='switchGroup($projectID, this.value)'"); echo ""; - if($this->methodName == 'task') echo "{$lang->project->byQuery} "; + if($this->methodName == 'task') echo " {$lang->project->byQuery} "; ?>
diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 743652877d..ff27ab0591 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -26,7 +26,7 @@ js::set('confirmDelete', $lang->testcase->confirmDelete); " . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->testcase->allCases) . ""; echo "" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->testcase->needConfirm) . ""; - echo "{$lang->testcase->bySearch} "; + echo " {$lang->testcase->bySearch} "; ?>
diff --git a/module/testtask/view/cases.html.php b/module/testtask/view/cases.html.php index 433f42a846..79dc10045c 100644 --- a/module/testtask/view/cases.html.php +++ b/module/testtask/view/cases.html.php @@ -25,7 +25,7 @@ var moduleID = ''; echo "" . $lang->testtask->byModule . " "; echo "" . html::a($this->inlink('cases', "taskID=$taskID&browseType=all¶m=0"), $lang->testtask->allCases) . ""; echo "" . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome¶m=0"), $lang->testtask->assignedToMe) . ""; - echo "{$lang->testcase->bySearch} "; + echo " {$lang->testcase->bySearch} "; ?>
diff --git a/www/js/my.min.js b/www/js/my.min.js index 7298533e4a..1729a7389f 120000 --- a/www/js/my.min.js +++ b/www/js/my.min.js @@ -1 +1,968 @@ -my.full.js \ No newline at end of file +/** + * Load css file of special browser. + * + * @access public + * @return void + */ +function loadFixedCSS() +{ + cssFile = ''; + if($.browser.msie ) + { + cssFile = $.browser.version == '6.0' ? config.themeRoot + '/browser/ie.6.css' : config.themeRoot + 'browser/ie.css'; + } + else if($.browser.mozilla) + { + cssFile = config.themeRoot + '/browser/firefox.css'; + } + else if($.browser.opera) + { + cssFile = config.themeRoot + '/browser/opera.css'; + } + else if($.browser.safari) + { + cssFile = config.themeRoot + '/browser/safari.css'; + } + else if($.browser.chrome) + { + cssFile = config.themeRoot + '/browser/chrome.css'; + } + + if(cssFile != '') + { + /* Thanks ekerner, please visit ekerner.com. The code is from: + * http://stackoverflow.com/questions/1184950/dynamically-loading-css-stylesheet-doesnt-work-on-ie. + */ + $("").appendTo($('head')).attr({type: 'text/css', rel: 'stylesheet'}).attr('href', cssFile); + } +} + +/** + * Create link. + * + * @param string $moduleName + * @param string $methodName + * @param string $vars + * @param string $viewType + * @access public + * @return string + */ +function createLink(moduleName, methodName, vars, viewType, isOnlyBody) +{ + if(!viewType) viewType = config.defaultView; + if(!isOnlyBody) isOnlyBody = false; + if(vars) + { + vars = vars.split('&'); + for(i = 0; i < vars.length; i ++) vars[i] = vars[i].split('='); + } + if(config.requestType == 'PATH_INFO') + { + link = config.webRoot + moduleName + config.requestFix + methodName; + if(vars) + { + if(config.pathType == "full") + { + for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][0] + config.requestFix + vars[i][1]; + } + else + { + for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][1]; + } + } + link += '.' + viewType; + } + else + { + link = config.router + '?' + config.moduleVar + '=' + moduleName + '&' + config.methodVar + '=' + methodName + '&' + config.viewVar + '=' + viewType; + if(vars) for(i = 0; i < vars.length; i ++) link += '&' + vars[i][0] + '=' + vars[i][1]; + } + + /* if page has onlybody param then add this param in all link. the param hide header and footer. */ + if(onlybody == 'yes' || isOnlyBody) + { + var onlybody = config.requestType == 'PATH_INFO' ? "?onlybody=yes" : '&onlybody=yes'; + link = link + onlybody; + } + return link; +} + +/** + * Go to the view page of one object. + * + * @access public + * @return void + */ +function shortcut() +{ + objectType = $('#searchType').attr('value'); + objectValue = $('#searchQuery').attr('value'); + if(objectType && objectValue) + { + location.href=createLink(objectType, 'view', "id=" + objectValue); + } +} + +/** + * Show drop menu. + * + * @param string $objectType product|project + * @param int $objectID + * @param string $module + * @param string $method + * @param string $extra + * @access public + * @return void + */ +var showMenu = 0; //Showing or hiding drop menu. +function showDropMenu(objectType, objectID, module, method, extra) +{ + if(showMenu == 1) { showMenu = 0; return $("#dropMenu").hide();}; + $('#wrap').click(function(){showMenu = 0; return $("#dropMenu").hide();}); + + $.get(createLink(objectType, 'ajaxGetDropMenu', "objectID=" + objectID + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#dropMenu').html(data);}); + var offset = $('#currentItem').offset(); + $("#dropMenu").css({ top:offset.top + $('#currentItem').height() + "px", left:offset.left }); + $("#dropMenu").show('fast', function(){$("#dropMenu #search").focus();}); + showMenu = 1; +} + +/** + * Search items. + * + * @param string $keywords + * @param string $objectType + * @param int $objectID + * @param string $module + * @param string $method + * @param string $extra + * @access public + * @return void + */ +function searchItems(keywords, objectType, objectID, module, method, extra) +{ + if(keywords == '') + { + showMenu = 0; + showDropMenu(objectType, objectID, module, method, extra); + setTimeout(function(){$("#dropMenu #search").focus();}, 300); + } + else + { + if(keywords != '-') $.get(createLink(objectType, 'ajaxGetMatchedItems', "keywords=" + keywords + "&module=" + module + "&method=" + method + "&extra=" + extra), function(data){ $('#searchResult').html(data);}); + } +} + +/** + * Show or hide more items. + * + * @access public + * @return void + */ +function switchMore() +{ + $('#moreMenu').css('width', $('#defaultMenu').width()); + $('#moreMenu').toggle(); + $('#search').focus(); +} + +/** + * Switch doc library. + * + * @param int $libID + * @param string $module + * @param string $method + * @param string $extra + * @access public + * @return void + */ +function switchDocLib(libID, module, method, extra) +{ + if(module == 'doc') + { + if(method != 'view' && method != 'edit') + { + link = createLink(module, method, "rootID=" + libID); + } + else + { + link = createLink('doc', 'browse'); + } + } + else if(module == 'tree') + { + link = createLink(module, method, "rootID=" + libID + '&type=' + extra); + } + location.href=link; +} + +/** + * Set the ping url. + * + * @access public + * @return void + */ +function setPing() +{ + $('#hiddenwin').attr('src', createLink('misc', 'ping')); +} + +/** + * Set required fields, add star class to them. + * + * @access public + * @return void + */ +function setRequiredFields() +{ + if(!config.requiredFields) return false; + requiredFields = config.requiredFields.split(','); + for(i = 0; i < requiredFields.length; i++) + { + $('#' + requiredFields[i]).after(' * '); + } +} + +/** + * Set the help links of forum's items. + * + * @access public + * @return void + */ +function setHelpLink() +{ + if(!$.cookie('help')) $.cookie('help', 'off', {expires:config.cookieLife, path:config.webRoot}); + className = $.cookie('help') == 'off' ? 'hidden' : ''; + + $('form input[id], form select[id], form textarea[id]').each(function() + { + if($(this).attr('type') == 'hidden' || $(this).attr('type') == 'file') return; + currentFieldName = $(this).attr('name') ? $(this).attr('name') : $(this).attr('id'); + if(currentFieldName == 'submit' || currentFieldName == 'reset') return; + if(currentFieldName.indexOf('[') > 0) currentFieldName = currentFieldName.substr(0, currentFieldName.indexOf('[')); + currentFieldName = currentFieldName.toLowerCase(); + helpLink = createLink('help', 'field', 'module=' + config.currentModule + '&method=' + config.currentMethod + '&field=' + currentFieldName); + $(this).after(' ? '); + }); + + if($('a.helplink').size()) $("a.helplink").colorbox({width:600, height:240, iframe:true, transition:'none', scrolling:false}); +} + +/** + * Set paceholder. + * + * @access public + * @return void + */ +function setPlaceholder() +{ + if(typeof(holders) != "undefined") + { + for(var key in holders) + { + if($('#' + key).prop('tagName') == 'INPUT') + { + $("#" + key).attr('placeholder', holders[key]); + } + else + { + $("#" + key).parent().append(holders[key]); + } + } + } +} + +/** + * Toggle the help links. + * + * @access public + * @return void + */ +function toggleHelpLink() +{ + $('.helplink').toggle(); + if($.cookie('help') == 'off') return $.cookie('help', 'on', {expires:config.cookieLife, path:config.webRoot}); + if($.cookie('help') == 'on') return $.cookie('help', 'off', {expires:config.cookieLife, path:config.webRoot}); +} + +/** + * Hide tree box + * + * @param string $treeType + * @access public + * @return void + */ +function hideTreeBox(treeType) +{ + $.cookie(treeType, 'hide', {expires:config.cookieLife, path:config.webRoot}); + $('.side').hide(); + $('.divider').hide(); + $('.treeSlider span').css("border-right", "0 none"); + $('.treeSlider span').css("border-left", "4px solid #000000"); + +} + +/** + * Show tree box + * + * @param string $treeType + * @access public + * @return void + */ +function showTreeBox(treeType) +{ + $.cookie(treeType, 'show', {expires:config.cookieLife, path:config.webRoot}); + $('.side').show(); + $('.divider').show(); + $('.treeSlider span').css("border-right", "4px solid #000000"); + $('.treeSlider span').css("border-left", "0 none"); +} + +/** + * Toggle tree menu. + + * @access public + * @return void + */ +function toggleTreeBox() +{ + var treeType = $('.treeSlider').attr('id'); + if(typeof treeType == 'undefined') return; + if($.cookie(treeType) == 'hide') hideTreeBox(treeType); + + $('.treeSlider').toggle + ( + function() + { + if($.cookie(treeType) == 'hide') return showTreeBox(treeType); + hideTreeBox(treeType); + }, + function() + { + if($.cookie(treeType) == 'show') return hideTreeBox(treeType); + showTreeBox(treeType); + } + ); +} + +/** + * Set language. + * + * @access public + * @return void + */ +function selectLang(lang) +{ + $.cookie('lang', lang, {expires:config.cookieLife, path:config.webRoot}); + location.href = removeAnchor(location.href); +} + +/** + * Set theme. + * + * @access public + * @return void + */ +function selectTheme(theme) +{ + $.cookie('theme', theme, {expires:config.cookieLife, path:config.webRoot}); + location.href = removeAnchor(location.href); +} + +/** + * Remove anchor from the url. + * + * @param string $url + * @access public + * @return string + */ +function removeAnchor(url) +{ + pos = url.indexOf('#'); + if(pos > 0) return url.substring(0, pos); + return url; +} + +/** + * Get the window size and save to cookie. + * + * @access public + * @return void + */ +function saveWindowSize() +{ + width = $(window).width(); + height = $(window).height(); + $.cookie('windowWidth', width) + $.cookie('windowHeight', height) +} + +/** + * Set Outer box's width and height. + * + * @access public + * @return void + */ +function setOuterBox() +{ + var winWidth = window.screen.width; + var winHeight = $(window).height(); + var headerH = $('#header').height(); + var navbarH = $('#modulemenu').parent().parent().height(); + var footerH = $('#footer').height() + 15; + + var outerH = winHeight - headerH - footerH - navbarH - 37; + if ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) outerH = winHeight - headerH - footerH - 98; + if ($.browser.msie && ($.browser.version == "6.0")) $('.outer').css('height', outerH); + $('.outer').css('min-height', outerH); + + if($.browser.msie && ($.browser.version == "6.0") && !$.support.style) + { + winWidth -= 49; + $('#wrap').width(winWidth); + } +} + +/** + * Set the about link. + * + * @access public + * @return void + */ +function setAbout() +{ + if($('a.about').size()) $("a.about").colorbox({width:900, height:330, iframe:true, transition:'none', scrolling:false}); +} + +/** + * Set QR Code. + * + * @access public + * @return void + */ +function setQRCode() +{ + if($('a.qrCode').size()) $("a.qrCode").colorbox({width:400, height:400, iframe:true, transition:'none', scrolling:false}); +} + +/** + * Set the css of the iframe. + * + * @param string $color + * @access public + * @return void + */ +function setDebugWin(color) +{ + if($.browser.msie && $('.debugwin').size() == 1) + { + var debugWin = $(".debugwin")[0].contentWindow.document; + $("body", debugWin).append(""); + } +} + +/** + * Disable the submit button when submit form. + * + * @access public + * @return void + */ +function setForm() +{ + var formClicked = false; + $('form').submit(function() + { + submitObj = $(this).find(':submit'); + if($(submitObj).size() == 1) + { + submitLabel = $(submitObj).attr('value'); + $(submitObj).attr('disabled', 'disabled'); + $(submitObj).attr('value', config.submitting); + $(submitObj).addClass('button-d'); + formClicked = true; + } + }); + + $("body").click(function() + { + if(formClicked) + { + $(submitObj).removeAttr('disabled'); + $(submitObj).attr('value', submitLabel); + $(submitObj).removeClass('button-d'); + } + formClicked = false; + }); +} + +/** + * Set form action and submit. + * + * @param url $actionLink + * @param string $hiddenwin 'hiddenwin' + * @access public + * @return void + */ +function setFormAction(actionLink, hiddenwin) +{ + if(hiddenwin) $('form').attr('target', hiddenwin); + $('form').attr('action', actionLink).submit(); +} + +/** + * Set the max with of image. + * + * @access public + * @return void + */ +function setImageSize(image, maxWidth) +{ + /* If not set maxWidth, set it auto. */ + if(!maxWidth) + { + bodyWidth = $('body').width(); + maxWidth = bodyWidth - 450; // The side bar's width is 336, and add some margins. + } + $('.content img').each(function() + { + if($(this).width() > maxWidth) $(this).attr('width', maxWidth); + }); + $(image).wrap('') +} + +/** + * Set the repo link. + * + * @access public + * @return void + */ +function setRepoLink() +{ + if($('.repolink').size()) $('.repolink').colorbox({width:960, height:600, iframe:true, transition:'elastic', speed:350, scrolling:true}); +} + +/* Set the colorbox of export. */ +function setExport() +{ + if($('.export').size()) $(".export").colorbox({width:600, height:200, iframe:true, transition:'none', scrolling:true}); +} + +/** + * Set mailto list from a contact list.. + * + * @param string $mailto + * @param int $contactListID + * @access public + * @return void + */ +function setMailto(mailto, contactListID) +{ + link = createLink('user', 'ajaxGetContactUsers', 'listID=' + contactListID); + $.get(link, function(users) + { + $('#' + mailto).replaceWith(users); + $('#' + mailto + '_chzn').remove(); + $('#' + mailto).chosen({no_results_text: noResultsMatch}); + }); +} + +/** + * Set comment. + * + * @access public + * @return void + */ +function setComment() +{ + $('#commentBox').toggle(); + $('.ke-container').css('width', '100%'); + setTimeout(function() { $('#commentBox textarea').focus(); }, 50); +} + +/** + * Auto checked the checkbox of a row. + * + * @access public + * @return void + */ +function autoCheck() +{ + $('.tablesorter tr :checkbox').click(function() + { + if($(this).attr('checked')) + { + $(this).attr('checked', false); + } + else + { + $(this).attr('checked', true); + } + return; + }); + + $('.tablesorter tr').click(function() + { + if(document.activeElement.type != 'select-one' && document.activeElement.type != 'text') + { + if($(this).find(':checkbox').attr('checked')) + { + $(this).find(':checkbox').attr('checked', false); + } + else + { + $(this).find(':checkbox').attr('checked', true); + } + } + }); +} + +/** + * Toogle the search form. + * + * @access public + * @return void + */ +function toggleSearch() +{ + $("#bysearchTab").toggle + ( + function() + { + if(browseType == 'bymodule') + { + $('#treebox').addClass('hidden'); + $('.divider').addClass('hidden'); + $('#bymoduleTab').removeClass('active'); + } + else + { + $('#' + browseType + 'Tab').removeClass('active'); + } + $('#bysearchTab').addClass('active'); + ajaxGetSearchForm(); + $('#querybox').removeClass('hidden'); + }, + function() + { + if(browseType == 'bymodule') + { + $('#treebox').removeClass('hidden'); + $('.divider').removeClass('hidden'); + $('#bymoduleTab').addClass('active'); + } + else + { + $('#' + browseType +'Tab').addClass('active'); + } + $('#bysearchTab').removeClass('active'); + $('#querybox').addClass('hidden'); + } + ); +} + +/** + * Ajax get search form + * + * @access public + * @return void + */ +function ajaxGetSearchForm() +{ + if($('#querybox').html() == '') + { + $.get(createLink('search', 'buildForm'), function(data){ + $('#querybox').html(data); + }); + } +} + +/** + * Hide the link of clearData. + * + * @access public + * @return void + */ +function hideClearDataLink() +{ + if(typeof showDemoUsers == 'undefined' || !showDemoUsers) $('#submenuclearData').addClass('hidden'); +} + +/** + * add one option of a select to another select. + * + * @param string $SelectID + * @param string $TargetID + * @access public + * @return void + */ +function addItem(SelectID,TargetID) +{ + ItemList = document.getElementById(SelectID); + Target = document.getElementById(TargetID); + for(var x = 0; x < ItemList.length; x++) + { + var opt = ItemList.options[x]; + if (opt.selected) + { + flag = true; + for (var y=0;y=0;x--) + { + var opt = ItemList.options[x]; + if (opt.selected) + { + ItemList.options[x] = null; + } + } +} + +/** + * move one selected option up from a select. + * + * @param string $SelectID + * @access public + * @return void + */ +function upItem(SelectID) +{ + ItemList = document.getElementById(SelectID); + for(var x=1;x=0;x--) + { + var opt = ItemList.options[x]; + opt.selected = true; + } +} + +/** + * Set modal for list page. + * + * Open operation pages in modal for list pages, after the modal window close, reload the list content and repace the replaceID. + * + * @param string colorboxClass the class for colorbox binding. + * @param string replaceID the html object to be replaced. + * @access public + * @return void + */ +function setModal4List(colorboxClass, replaceID, callback) +{ + $('.' + colorboxClass).colorbox( + { + width: 900, + height: 500, + iframe: true, + transition: 'none', + + onCleanup:function() + { + var selfClose = $.cookie('selfClose'); + if(selfClose != 1) return; + saveWindowSize(); + + var link = self.location.href; + $('#' + replaceID).wrap("
"); + $('#tmpDiv').load(link + ' #' + replaceID, function() + { + $('#tmpDiv').replaceWith($('#tmpDiv').html()); + setModal4List(colorboxClass, replaceID, callback); + + $('.colored').colorize(); + $('tfoot td').css('background', 'white').unbind('click').unbind('hover'); + $(".date").datePicker({createButton:true, startDate:startDate}) + .dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_RIGHT) + if(typeof(callback) == 'function') callback(); + $.cookie('selfClose', 0); + }); + } + }); +} + +/** + * Delete item use ajax. + * + * @param string url + * @param string replaceID + * @param string notice + * @access public + * @return void + */ +function ajaxDelete(url, replaceID, notice) +{ + if(confirm(notice)) + { + $.ajax( + { + type: 'GET', + url: url, + dataType: 'json', + success: function(data) + { + if(data.result == 'success') + { + $('#' + replaceID).wrap("
"); + $('#tmpDiv').load(document.location.href + ' #' + replaceID, function() + { + $('#tmpDiv').replaceWith($('#tmpDiv').html()); + if(typeof sortTable == 'function') + { + sortTable(); + } + else + { + $('.colored').colorize(); + $('tfoot td').css('background', 'white').unbind('click').unbind('hover'); + } + }); + } + } + }); + } +} + +/* Ping the server every some minutes to keep the session. */ +needPing = true; + +/* When body's ready, execute these. */ +$(document).ready(function() +{ + loadFixedCSS(); + setForm(); + saveWindowSize(); + setDebugWin('white'); + setOuterBox(); + + setRequiredFields(); + setPlaceholder(); + + setAbout(); + setQRCode(); + setExport(); + setRepoLink(); + + autoCheck(); + toggleSearch(); + toggleTreeBox(); + + hideClearDataLink(); + + $(window).resize(function(){saveWindowSize()}); // When window resized, call it again. + if(needPing) setTimeout('setPing()', 1000 * 60); // After 5 minutes, begin ping. + + $('.export').bind('click', function() + { + var checkeds = ''; + $(':checkbox').each(function(){ + if($(this).attr('checked')) + { + var checkedVal = parseInt($(this).val()); + if(checkedVal != 0) checkeds = checkeds + checkedVal + ','; + } + }) + if(checkeds != '') checkeds = checkeds.substring(0, checkeds.length - 1); + $.cookie('checkedItem', checkeds, {expires:config.cookieLife, path:config.webRoot}); + }); +}); + +/* CTRL+g, auto focus on the search box. */ +$(document).bind('keydown', 'Ctrl+g', function(evt) +{ + $('#searchQuery').attr('value', ''); + $('#searchQuery').focus(); + evt.stopPropagation( ); + evt.preventDefault( ); + return false; +}); + +/* left, go to pre object. */ +$(document).bind('keydown', 'left', function(evt) +{ + preLink = ($('#pre').attr("href")); + if(typeof(preLink) != 'undefined') location.href = preLink; +}); + +/* right, go to next object. */ +$(document).bind('keydown', 'right', function(evt) +{ + nextLink = ($('#next').attr("href")); + if(typeof(nextLink) != 'undefined') location.href = nextLink; +}); diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 0b6c0c7cc1..6bcde62064 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -9,17 +9,21 @@ * @link http://www.zentao.net */ /*-----------------------BASE SETTING----------------------------*/ -body {margin:0; text-align:left; color:#141414;} +body {margin:0; text-align:left; color:#141414;background: #e5e5e5;} fieldset {border:1px solid #efefef; padding:8px 10px 8px 15px; margin-bottom:8px; color:#333;} legend {font-weight:bold;} del{background:#fcc;} ins{background:#cfc; text-decoration:none} a {text-decoration:none;} +/*-----------------------CLEARFIX-----------------------------------*/ +.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden} +.clearfix{*+height:1%;} + /*-----------------------LAYOUT SETTING ----------------------------*/ -#wrap{ padding:0 15px; background:#e5e5e5;} -.outer {text-align:left; background:#fff; padding:15px;} -#wrap .outer {border:1px solid #ddd;} +#wrap{ padding:0 19px; background:#e5e5e5;} +.outer {text-align:left; background:#fff; padding: 20px;} +#wrap .outer {border:1px solid #cfcfcf;-webkit-box-shadow: 0 0px 6px rgba(0, 0, 0, 0.10);box-shadow: 0 0px 6px rgba(0, 0, 0, 0.10);} .cont, .cont-lt1, .cont-lt2, .cont-lt3, .cont-lt4, .cont-lt5, .cont-rt1, .cont-rt2, .cont-rt3, .cont-rt4, .cont-rt5 {width:100%; margin:0; border:none; text-align:left} .cont tr, .cont td {border:none; padding:0} .cont-lt1 tr, .cont-lt2 tr, .cont-lt3 tr, .cont-lt4 tr, .cont-lt5 tr {border:none; padding:0} @@ -269,6 +273,13 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .star {color:red; font-size:18px; font-weight:bold;} .warning {background:yellow; color:red; font-weight:bold} +/*-----------------------NAV----------------------------*/ +/* The nav bar. */ +.navbar ul {margin:0; padding:0;} +.navbar li {margin:0; padding:0; float:left; text-align:center; list-style-type:none;} +.navbar li>a {text-decoration:none;-webkit-transition: all .2s;-o-transition: all .2s;-moz-transition: all .2s;transition: all .2s;} +.navbar li>a:hover {color:#ff3600;} + /*-----------------------SPECIAL PART SETTING--------------------*/ /* Header. */ #header{padding:2px 20px 0 20px; background:#003366; border-bottom:1px solid #e4e4e4;} @@ -281,16 +292,10 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table #topbar a:hover {color: #fff;} #companyname{color:#ffcc00; font-size:14px} -/* The nav bar. */ -#navbar ul {margin:0; padding:0;} -#navbar li {margin:0; padding:0; float:left; text-align:center; list-style-type:none;} -#navbar a {text-decoration:none;} -#navbar a:hover {color:#ff3600;} - /* Main menu. */ #mainmenu ul { height:30px; line-height:30px} #mainmenu li {margin-right: 3px;font-size:14px;} -#mainmenu li>a {display: inline-block;white-space:nowrap;padding:1px 15px; color:#E5E5E5; font-weight:normal; background:#114f8e;-webkit-box-shadow: 0 -3px 3px rgba(0, 0, 0, 0.10);box-shadow: 0 -3px 3px rgba(0, 0, 0, 0.10);-webkit-transition: all .2s;-o-transition: all .2s;-moz-transition: all .2s;transition: all .2s;} +#mainmenu li>a {display: inline-block;white-space:nowrap;padding:1px 15px; color:#E5E5E5; font-weight:normal; background:#114f8e;-webkit-box-shadow: 0 -3px 3px rgba(0, 0, 0, 0.10);box-shadow: 0 -3px 3px rgba(0, 0, 0, 0.10);} #mainmenu li>a:hover{background-color: #2e6dad;color: #fff;-webkit-box-shadow: 0 -3px 5px rgba(0, 0, 0, 0.2);box-shadow: 0 -3px 5px rgba(0, 0, 0, 0.2);} #mainmenu li.active>a{background-color:#e5e5e5;color:#21841d; font-weight:bold;} @@ -303,14 +308,14 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table #mainmenu li>a#objectSwitcher{background: #e5e5e5;color: gray;padding: 0 3px;-webkit-box-shadow: none;box-shadow:none;} /* Module menu. */ -#modulemenu {margin-bottom:0px; font-size:14px; border:2px solid #e5e5e5;} -#modulemenu ul {background-color:#E5e5e5; height:28px; line-height:28px; padding:5px 10px;} -#modulemenu li {padding:0 5px; color:#0033cc;} -#modulemenu a { font-weight:normal; font-size:14px; color:#003366} -#modulemenu .active a {color:#33a52e; font-weight:bold; padding:4px 4px 2px 4px;} -#modulemenu .right {float:right; font-weight:bold;} -#modulemenu .right a { font-weight:bold} -#modulemenu #mybg {padding-left:16px; padding-bottom:2px; background:url(images/main/zt-icons.png); background-position:-142px -443px;} +#modulemenu {padding: 0 20px;height: 50px;font-size:14px;} +#modulemenu li {color:#0033cc;padding:8px 4px 8px 0;line-height: 30px;} +#modulemenu li a{display: inline-block; padding: 2px 8px; font-weight:normal; font-size:14px; color:#003366} +#modulemenu li>a:hover{background: #d1d1d1;color: #000;} +#modulemenu li.active>a,#modulemenu li.active>a:hover {color:#21841d; font-weight:bold; } +#modulemenu li.right {float:right; font-weight:bold;} +#modulemenu li.right>a {font-weight:bold} +#modulemenu #myname {color: #888888;} /* Drop menu. */ #currentItem a, #dropMenu a {cursor:pointer} @@ -334,15 +339,15 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table #projectID {background:#e5e5e5; border:1px solid #e5e5e5} /* Feature bar. */ -#featurebar {height:28px; line-height:28px; cursor:pointer; padding:20px 8px 10px 8px; margin: -15px -15px 10px -15px;} +#featurebar {height:30px; line-height:30px;background-color: #edf3fe; padding:10px; border-bottom: 1px solid #e7edf7;margin: -20px -20px 20px -20px;} #featurebar span {font-size:14px;} -#featurebar a {text-decoration:none; border-right:1px solid #ddd; padding:4px 4px 4px 4px; color:#003366; font-size:14px} -#featurebar a:hover {color:#ff3600;} +#featurebar a {text-decoration:none; display: inline-block;padding: 2px 7px; font-size:14px;-webkit-transition: all .2s;-o-transition: all .2s;-moz-transition: all .2s;transition: all .2s;} +#featurebar a:hover {color:#000;background-color: #e5e5e5;} #featurebar .f-right a {border-right:none; padding:5px 5px 5px 0px;} #featurebar #bysearchTab a {border:none;} #featurebar select {font-size:12px; height:22px; margin-top:3px;} -#featurebar .active a {color:#009900; font-weight:bold;} +#featurebar .active a {color:#333; font-weight:bold;} #featurebar .active select {border:2px solid #009900;} #featurebar .active input {border:2px solid #009900;} @@ -414,7 +419,6 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .plan {background:#ffcc00;} .plan a{color:green} .helplink {font-size:9px} -#bysearchTab a{color:red} #fileform .text-3 {margin-bottom:5px} .content p, .history p {margin:0} @@ -456,8 +460,8 @@ table.tablesorter thead tr .headerSortDown {background-image: url(./images/table .button-create{} /*-----------------------ICONS --------------------*/ -.icon-search {padding-left:16px; background:url(images/main/zt-icons.png) -123px -83px; border:0px;} -.icon-arrow {padding-left:10px; background:url(images/main/zt-icons.png) -102px -443px;} +.icon{color: #888;} + /* Common icons. */ #featurebar .f-right .icon-goback {padding:0px 9px}
-
 my->todo;?>
-
createLink('my', 'todo'), $lang->more . "");?>
+
  my->todo;?>
+
createLink('my', 'todo'), $lang->more . " ");?>