diff --git a/config/filter.php b/config/filter.php index a5db047a7f..9f30f178a0 100644 --- a/config/filter.php +++ b/config/filter.php @@ -22,8 +22,9 @@ $filter->default->paramValue = 'reg::paramValue'; $filter->default->get['onlybody'] = 'equal::yes'; $filter->default->get['HTTP_X_REQUESTED_WITH'] = 'equal::XMLHttpRequest'; -$filter->default->cookie['lang'] = 'reg::lang'; -$filter->default->cookie['theme'] = 'reg::word'; +$filter->default->cookie['lang'] = 'reg::lang'; +$filter->default->cookie['theme'] = 'reg::word'; +$filter->default->cookie['fingerprint'] = 'reg::word'; $filter->bug = new stdclass(); $filter->doc = new stdclass(); diff --git a/db/update10.4.sql b/db/update10.4.sql new file mode 100644 index 0000000000..b9538a5041 --- /dev/null +++ b/db/update10.4.sql @@ -0,0 +1 @@ +update zt_task set `parent` = -1 where `id` in (select `parent` from zt_task where `parent` > 0 group by `parent`) \ No newline at end of file diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 33fe1c223b..cea53d858c 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -608,6 +608,23 @@ class baseHelper return $ip; } + + /** + * Restart session. + * + * @param string $sessionID + * @static + * @access public + * @return void + */ + public static function restartSession($sessionID = '') + { + if(empty($sessionID)) $sessionID = sha1(mt_rand()); + + session_write_close(); + session_id($sessionID); + session_start(); + } } //------------------------------- 常用函数。Some tool functions.-------------------------------// diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 1161aadb9c..a749ba6089 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -311,6 +311,15 @@ class baseRouter */ public $cookie; + /** + * 原始SESSIONID + * SESSIONID + * + * @var int + * @access public + */ + public $sessionID; + /** * 网站代号。 * The code of current site. @@ -813,8 +822,11 @@ class baseRouter { $sessionName = $this->config->sessionVar; session_name($sessionName); - if(isset($_GET[$this->config->sessionVar])) session_id($_GET[$this->config->sessionVar]); session_start(); + + $this->sessionID = session_id(); + if(isset($_GET[$this->config->sessionVar]) and $this->sessionID != $_GET[$this->config->sessionVar]) helper::restartSession($_GET[$this->config->sessionVar]); + define('SESSION_STARTED', true); } } diff --git a/module/action/model.php b/module/action/model.php index 82e3b35b65..5a67dbab75 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -789,7 +789,7 @@ class actionModel extends model else { $action->objectLink = ''; - $action->objectLabel = $this->lang->action->objectTypes[$action->objectLabel]; + $action->objectLabel = zget($this->lang->action->objectTypes, $action->objectLabel); } $action->major = (isset($this->config->action->majorList[$action->objectType]) && in_array($action->action, $this->config->action->majorList[$action->objectType])) ? 1 : 0; diff --git a/module/block/control.php b/module/block/control.php index 21b0a1674b..7f21578ada 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -893,7 +893,7 @@ class block extends control $tasks = $this->dao->select("project, count(id) as totalTasks, count(status in ('wait','doing','pause') or null) as undoneTasks, count(finishedDate like '{$yesterday}%' or null) as yesterdayFinished, sum(if(status != 'cancel', estimate, 0)) as totalEstimate, sum(consumed) as totalConsumed, sum(if(status != 'cancel', `left`, 0)) as totalLeft")->from(TABLE_TASK) ->where('project')->in($projectIdList) ->andWhere('deleted')->eq(0) - ->andWhere('parent')->eq(0) + ->andWhere('parent')->lt(1) ->groupBy('project') ->fetchAll('project'); foreach($tasks as $projectID => $task) diff --git a/module/block/model.php b/module/block/model.php index f582b965f4..ea26ca8e64 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -162,12 +162,12 @@ class blockModel extends model $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); $data['projects'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) ->where("(status='wait' or status='doing')") - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects) + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->andWhere('deleted')->eq(0) ->fetch('count'); $data['products'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PRODUCT) ->where('status')->ne('closed') - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products) + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi() ->andWhere('deleted')->eq(0) ->fetch('count'); @@ -188,7 +188,7 @@ class blockModel extends model ->fetch('count'); $data['delayProject'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) ->where('status')->in('wait,doing') - ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects) + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->andWhere('end')->lt($today) ->andWhere('deleted')->eq(0) ->fetch('count'); diff --git a/module/bug/control.php b/module/bug/control.php index b3c5f14be9..0c80c13efe 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1490,7 +1490,7 @@ class bug extends control /* Get related objects title or names. */ $productsType = $this->dao->select('id, type')->from(TABLE_PRODUCT)->where('id')->in($relatedProductIdList)->fetchPairs(); - $relatedModules = array('0' => '/') + $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in($relatedModuleIdList)->fetchPairs(); + $relatedModules = $this->loadModel('tree')->getOptionMenu($productID, 'bug'); $relatedStories = $this->dao->select('id,title')->from(TABLE_STORY) ->where('id')->in($relatedStoryIdList)->fetchPairs(); $relatedTasks = $this->dao->select('id, name')->from(TABLE_TASK)->where('id')->in($relatedTaskIdList)->fetchPairs(); $relatedBugs = $this->dao->select('id, title')->from(TABLE_BUG)->where('id')->in($relatedBugIdList)->fetchPairs(); diff --git a/module/bug/model.php b/module/bug/model.php index cf0e07e8a5..c77772e9b7 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1657,10 +1657,10 @@ class bugModel extends model */ public function getDataOfBugsPerBuild() { - $datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('value DESC')->fetchAll('name'); + $datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('openedBuild DESC')->fetchAll('name'); if(!$datas) return array(); + ksort($datas); $builds = $this->loadModel('build')->getProductBuildPairs($this->session->product, $branch = 0, $params = ''); - /* Deal with the situation that a bug maybe associate more than one openedBuild. */ foreach($datas as $buildIDList => $data) { @@ -2471,6 +2471,10 @@ class bugModel extends model $class .= ' text-left'; $title = "title='{$bug->title}'"; } + if($id == 'type') + { + $title = "title='" . zget($this->lang->bug->typeList, $bug->type) . "'"; + } if($id == 'assignedTo') { $class .= ' has-btn text-left'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 387cb98e1b..7dda0d99ae 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -259,6 +259,7 @@ $lang->task = new stdclass(); $lang->build = new stdclass(); $lang->task->menu = $lang->project->menu; $lang->build->menu = $lang->project->menu; +$lang->build->menu->qa = array('link' => 'Build|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); /* QA视图菜单设置。*/ $lang->qa = new stdclass(); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 49f9cfc6e4..828b617400 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -259,6 +259,7 @@ $lang->task = new stdclass(); $lang->build = new stdclass(); $lang->task->menu = $lang->project->menu; $lang->build->menu = $lang->project->menu; +$lang->build->menu->qa = array('link' => '版本|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); /* QA视图菜单设置。*/ $lang->qa = new stdclass(); diff --git a/module/doc/control.php b/module/doc/control.php index 15d0287b8e..ed66dc1586 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -138,11 +138,12 @@ class doc extends control $actionURL = $this->createLink('doc', 'browse', "lib=$libID&browseType=bySearch&queryID=myQueryID&orderBy=$orderBy&from=$from"); $this->doc->buildSearchForm($libID, $this->libs, $queryID, $actionURL, $type); - $title = ''; - $module = $moduleID ? $this->loadModel('tree')->getByID($moduleID) : ''; + $title = ''; + $module = $moduleID ? $this->loadModel('tree')->getByID($moduleID) : ''; if($module) $title = $module->name; if($libID) $title = $this->libs[$libID]; if(in_array($browseType, array_keys($this->lang->doc->fastMenuList))) $title = $this->lang->doc->fastMenuList[$browseType]; + if($param != 0) $title = $this->doc->buildBreadTitle($libID, $param, $title); if($browseType == 'fastsearch') { if($this->post->searchDoc) $this->session->set('searchDoc', $this->post->searchDoc); @@ -160,7 +161,7 @@ class doc extends control $this->view->itemCounts = $this->doc->statLibCounts(array_keys($libs)); } - $this->view->title = $title; + $this->view->breadTitle = $title; $this->view->libID = $libID; $this->view->moduleID = $moduleID; $this->view->modules = $this->doc->getDocMenu($libID, $moduleID, $orderBy == 'title_asc' ? 'name_asc' : 'id_desc', $browseType); diff --git a/module/doc/css/common.css b/module/doc/css/common.css index b0dcd89fc1..f9b6058e2e 100644 --- a/module/doc/css/common.css +++ b/module/doc/css/common.css @@ -59,3 +59,4 @@ } .main-col > .panel > .panel-body {padding-top: 20px;} +.main-col .panel-title a.active{color: #0c64eb} diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 5302611ebb..66f77783bb 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -46,6 +46,7 @@ $lang->doc->users = 'Users'; $lang->doc->item = ' Items'; $lang->doc->num = 'Docs'; $lang->doc->searchResult = 'Search Result'; +$lang->doc->gt = '>'; $lang->doc->moduleDoc = 'By Module'; $lang->doc->searchDoc = 'Search'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index d88d74e775..708cf84278 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -46,6 +46,7 @@ $lang->doc->users = '用户'; $lang->doc->item = '项'; $lang->doc->num = '文档数量'; $lang->doc->searchResult = '搜索结果'; +$lang->doc->gt = '>'; $lang->doc->moduleDoc = '按模块浏览'; $lang->doc->searchDoc = '搜索'; diff --git a/module/doc/model.php b/module/doc/model.php index 94447175dc..cb7cebd10b 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -66,6 +66,7 @@ class docModel extends model $selectHtml .= '
  • ' . html::a(helper::createLink('doc', 'allLibs', "type=custom"), " {$this->lang->doc->customAB}") . '
  • '; $selectHtml .=''; + $currentLib = 0; if(strpos('product,project,custom', $type) !== false) { if($type == 'custom') $currentLib = $libID; @@ -1528,4 +1529,52 @@ class docModel extends model return $statisticInfo; } + + /** + * Print doc child module. + * + * @access public + */ + public function printChildModule($module, $libID, $methodName, $browseType, $moduleID) + { + if(isset($module->children)) + { + foreach($module->children as $childModule) + { + $active = ''; + if($methodName == 'browse' && $browseType == 'bymodule' && $moduleID == $childModule->id) $active = "class='active'"; + echo ''; + } + } + } + + /** + * Build doc bread title. + * + * @access public + * @return string + */ + public function buildBreadTitle($libID = 0, $param = 0, $title = '') + { + $path = $this->dao->select('path')->from(TABLE_MODULE)->where('id')->eq($param)->fetch('path'); + + $parantMoudles = $this->dao->select('id, name')->from(TABLE_MODULE) + ->where('id')->in($path) + ->andWhere('deleted')->eq(0) + ->fetchAll('id'); + + foreach($parantMoudles as $parentID => $moduleName) + { + $active = ''; + if($param == $parentID) $active = "class='active'"; + $title .= html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=byModule¶m={$parentID}"), " {$this->lang->doc->gt} " . $moduleName->name , '', "$active"); + } + + return $title; + } } diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index cc9899492e..a478cd9eac 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -36,7 +36,7 @@ var browseType = ''; - +