From 0e7c5510276a0a5b26e01fe36e6c157da2754257 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 15 Mar 2016 09:57:03 +0800 Subject: [PATCH] * fix zget function and fix error. --- module/admin/control.php | 2 +- module/common/model.php | 25 ++++++------------------- module/cron/view/index.html.php | 2 +- module/mail/view/browse.html.php | 2 +- module/story/model.php | 4 ++-- module/testcase/view/createbug.html.php | 4 ++-- module/testtask/view/results.html.php | 2 +- module/user/control.php | 2 +- 8 files changed, 15 insertions(+), 28 deletions(-) diff --git a/module/admin/control.php b/module/admin/control.php index c5baabaf55..0372035d0a 100644 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -18,7 +18,7 @@ class admin extends control */ public function index() { - $community = zget($this->config->global, 'community'); + $community = zget($this->config->global, 'community', ''); if(!$community or $community == 'na') { $this->view->bind = false; diff --git a/module/common/model.php b/module/common/model.php index 2cb27344a6..d392793607 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -125,21 +125,8 @@ class commonModel extends model $this->config->personal = isset($config[$account]) ? $config[$account] : array(); /* Overide the items defined in config/config.php and config/my.php. */ - if(isset($this->config->system->common)) - { - foreach($this->config->system->common as $record) - { - if($record->section) - { - if(!isset($this->config->{$record->section})) $this->config->{$record->section} = new stdclass(); - $this->config->{$record->section}->{$record->key} = $record->value; - } - else - { - if(!$record->section) $this->config->{$record->key} = $record->value; - } - } - } + if(isset($this->config->system->common)) helper::mergeConfig($this->config->system->common, 'common'); + if(isset($this->config->personal->common)) helper::mergeConfig($this->config->personal->common, 'common'); } /** @@ -333,10 +320,10 @@ class commonModel extends model $product = $this->lang->menu->product . '|locate=no'; $menu = array('todo' => $todo, 'task' => $task, 'bug' => $bug, 'project' => $project, 'product' => $product); - if(strpos('dev,td,pm', $role) !== false) $menu = array('todo' => $todo, 'task' => $task, 'bug' => $bug, 'product' => $product, 'project' => $project); - if(strpos('pd,po', $role) !== false) $menu = array('todo' => $todo, 'story' => $story, 'bug' => $bug, 'product' => $product, 'project' => $project); - if(strpos('qa,qd', $role) !== false) $menu = array('todo' => $todo, 'bug' => $bug, 'project' => $project, 'product' => $product); - if(strpos('top', $role) !== false) $menu = array('project' => $project, 'product' => $product, 'todo' => $todo); + if($role and strpos('dev,td,pm', $role) !== false) $menu = array('todo' => $todo, 'task' => $task, 'bug' => $bug, 'product' => $product, 'project' => $project); + if($role and strpos('pd,po', $role) !== false) $menu = array('todo' => $todo, 'story' => $story, 'bug' => $bug, 'product' => $product, 'project' => $project); + if($role and strpos('qa,qd', $role) !== false) $menu = array('todo' => $todo, 'bug' => $bug, 'project' => $project, 'product' => $product); + if($role and strpos('top', $role) !== false) $menu = array('project' => $project, 'product' => $product, 'todo' => $todo); if($role == 'top') { diff --git a/module/cron/view/index.html.php b/module/cron/view/index.html.php index e1ee61671b..161ea5858e 100644 --- a/module/cron/view/index.html.php +++ b/module/cron/view/index.html.php @@ -53,7 +53,7 @@ command;?> remark;?> lastTime, 2);?> - cron->statusList, $cron->status);?> + cron->statusList, $cron->status, '');?> command)) echo html::a(inlink('toggle', "id=$cron->id&status=" . ($cron->status == 'stop' ? 'normal' : 'stop')), $cron->status == 'stop' ? $lang->cron->toggleList['start'] : $lang->cron->toggleList['stop'], 'hiddenwin'); diff --git a/module/mail/view/browse.html.php b/module/mail/view/browse.html.php index 60ebf5ca3c..62fc846f44 100644 --- a/module/mail/view/browse.html.php +++ b/module/mail/view/browse.html.php @@ -43,7 +43,7 @@ addedBy, $queue->addedBy)?> addedDate?> sendTime?> - mail->statusList, $queue->status)?> + mail->statusList, $queue->status, '')?> failReason?> id"), $lang->delete, 'hiddenwin');?> diff --git a/module/story/model.php b/module/story/model.php index 17c57ee8e2..b188117afe 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1403,7 +1403,7 @@ class storyModel extends model { $story->planTitle = ''; $storyPlans = explode(',', trim($story->plan, ',')); - foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID) . ' '; + foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID, '') . ' '; $stories[] = $story; } return $stories; @@ -2013,7 +2013,7 @@ class storyModel extends model { $story->planTitle = ''; $storyPlans = explode(',', trim($story->plan, ',')); - foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID) . ' '; + foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID, '') . ' '; if(empty($story->branch) and isset($stages[$story->id][$branch])) $story->stage = $stages[$story->id][$branch]->stage; } diff --git a/module/testcase/view/createbug.html.php b/module/testcase/view/createbug.html.php index b60a27e9f1..45027ed89b 100644 --- a/module/testcase/view/createbug.html.php +++ b/module/testcase/view/createbug.html.php @@ -32,8 +32,8 @@ - text-center'>testcase->resultList, zget($stepResult, 'result'));?> - + text-center'>testcase->resultList, zget($stepResult, 'result'), '');?> + diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index 084c2f2e1c..a789517aa4 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -41,7 +41,7 @@   #id?> date;?> lastRunner] . ' ' . $lang->testtask->runCase;?> - build);?> + build, '');?> testcase->resultList[$result->caseResult]?> diff --git a/module/user/control.php b/module/user/control.php index e1fe0a3f6e..392e68e4fc 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -756,7 +756,7 @@ class user extends control $this->view->noGDLib = sprintf($this->lang->misc->noGDLib, common::getSysURL() . $this->config->webRoot); $this->view->title = $this->lang->user->login; $this->view->referer = $this->referer; - $this->view->s = zget($this->config->global, 'sn'); + $this->view->s = zget($this->config->global, 'sn', ''); $this->view->keepLogin = $this->cookie->keepLogin ? $this->cookie->keepLogin : 'off'; $this->display(); }