From e5f79e31f17bb4bcdfdcf47ef221bf16752d66db Mon Sep 17 00:00:00 2001 From: wyd621 Date: Thu, 24 Oct 2013 07:53:40 +0000 Subject: [PATCH] * fix bug. --- module/bug/view/browse.html.php | 6 +++--- module/common/model.php | 7 +++++-- module/project/view/bug.html.php | 6 +++--- module/testcase/model.php | 1 + module/tree/model.php | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 1cbfbd6389..e437f60270 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -145,14 +145,14 @@ if($customed) createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?> bug->confirmStoryChange = $lang->confirm; common::printIcon('bug', 'confirmStoryChange', "bugID=$bug->id", '', 'list', '', 'hiddenwin')?> - openedBy];?> + openedBy, $bug->openedBy);?> cookie->windowWidth >= $this->config->wideSize):?> openedDate, 5, 11)?> - assignedTo == $this->app->user->account) echo 'class="red"';?>>assignedTo];?> - resolvedBy];?> + assignedTo == $this->app->user->account) echo 'class="red"';?>>assignedTo, $bug->assignedTo);?> + resolvedBy, $bug->resolvedBy)?> bug->resolutionList[$bug->resolution];?> cookie->windowWidth >= $this->config->wideSize):?> diff --git a/module/common/model.php b/module/common/model.php index e7dd0d9e4c..740c298d27 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -493,8 +493,11 @@ class commonModel extends model echo html::a(helper::createLink('my', 'index'), $lang->zentaoPMS) . $lang->arrow; if($moduleName != 'index') { - list($menuLabel, $module, $method) = explode('|', $lang->menu->$mainMenu); - echo html::a(helper::createLink($module, $method), $menuLabel); + if(isset($lang->menu->$mainMenu)) + { + list($menuLabel, $module, $method) = explode('|', $lang->menu->$mainMenu); + echo html::a(helper::createLink($module, $method), $menuLabel); + } } else { diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index e1af1bab9d..7113ddbe82 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -43,9 +43,9 @@ bug->severityList[$bug->severity]?>'>bug->severityList[$bug->severity]?> bug->priList[$bug->pri]?>'>bug->priList[$bug->pri]?> createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?> - openedBy];?> - assignedTo];?> - resolvedBy];?> + openedBy, $bug->openedBy);?> + assignedTo, $bug->assignedTo);?> + resolvedBy, $bug->resolvedBy);?> bug->resolutionList[$bug->resolution];?> post->steps as $stepID => $stepDesc) { if(empty($stepDesc)) continue; + $step = new stdclass(); $step->case = $caseID; $step->version = $version; $step->desc = htmlspecialchars($stepDesc); diff --git a/module/tree/model.php b/module/tree/model.php index ac02e4d447..b7a5330a71 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -814,12 +814,12 @@ class treeModel extends model public function getStoryModule($moduleID) { $module = $this->dao->select('id,type,parent')->from(TABLE_MODULE)->where('id')->eq($moduleID)->fetch(); - while($module->id and $module->type != 'story') + if($module->id and $module->type != 'story') { $module = $this->dao->select('id,type,parent')->from(TABLE_MODULE)->where('id')->eq($module->parent)->fetch(); } - return $module->id; + return empty($module) ? 0 : $module->id; } /** @@ -973,6 +973,7 @@ class treeModel extends model if(!isset($modules[$parentModuleID]) and $parentModuleID != 0) continue; if($parentModuleID == 0) { + $parentModule = new stdclass(); $parentModule->grade = 0; $parentModule->path = ','; }