From 3facbcea816b5c73ec35cef336db1baafe6cba03 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Sat, 20 Feb 2010 11:38:48 +0000 Subject: [PATCH] * fix the error when sendmail a bug. --- trunk/module/action/model.php | 1 + trunk/module/bug/control.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/trunk/module/action/model.php b/trunk/module/action/model.php index b51e020efc..2939561b5c 100644 --- a/trunk/module/action/model.php +++ b/trunk/module/action/model.php @@ -153,6 +153,7 @@ class actionModel extends model /* 打印修改记录。*/ public function printChanges($objectType, $histories) { + if(empty($histories)) return; $maxLength = 0; foreach($histories as $history) { diff --git a/trunk/module/bug/control.php b/trunk/module/bug/control.php index 720842063b..89502839db 100644 --- a/trunk/module/bug/control.php +++ b/trunk/module/bug/control.php @@ -403,14 +403,14 @@ class bug extends control } /* 获得action信息。*/ - $action = $this->action->getById($actionID); - $histories = $this->action->getHistory($actionID); + $action = $this->action->getById($actionID); + $history = $this->action->getHistory($actionID); + $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); if(strtolower($action->action) == 'opened') $action->comment = $bug->steps; /* 赋值,获得邮件内容。*/ $this->assign('bug', $bug); $this->assign('action', $action); - $this->assign('histories', $histories); $mailContent = $this->parse($this->moduleName, 'sendmail'); /* 发信。*/