From aae95743f949cdc45d49855f08120e65eeed7f6e Mon Sep 17 00:00:00 2001 From: wyd621 Date: Thu, 18 Jul 2013 16:48:06 +0800 Subject: [PATCH] * finish task #1571. --- module/bug/control.php | 2 +- module/bug/view/create.html.php | 2 +- module/mail/model.php | 6 ++++++ module/project/control.php | 2 +- module/story/control.php | 2 +- module/task/control.php | 2 +- module/testcase/view/create.html.php | 2 +- module/testtask/control.php | 2 +- 8 files changed, 13 insertions(+), 7 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index cae1c6348f..0c3f398b4c 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -940,7 +940,7 @@ class bug extends control /* Send it. */ $this->loadModel('mail')->send($toList, $productName . ':' . 'BUG #'. $bug->id . $this->lang->colon . $bug->title, $mailContent, $ccList); - if($this->mail->isError()) echo js::error($this->mail->getError()); + if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); } /** diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 932ee6e1bc..8e3dce804a 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -21,7 +21,7 @@ js::set('userList', array_keys($users)); js::set('page', 'create'); ?> -
+ diff --git a/module/mail/model.php b/module/mail/model.php index 67fd56d058..294c146a49 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -243,6 +243,7 @@ class mailModel extends model { if(!$this->config->mail->turnon) return; + ob_start(); /* Process toList and ccList, remove current user from them. If toList is empty, use the first cc as to. */ if($includeMe == false) { @@ -283,6 +284,11 @@ class mailModel extends model { $this->errors[] = trim(strip_tags($e->getMessage())); } + + $message = ob_get_contents(); + ob_clean(); + + return $message; } /** diff --git a/module/project/control.php b/module/project/control.php index 31b155a51a..52e752623c 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1194,7 +1194,7 @@ class project extends control /* Send emails. */ $this->loadModel('mail')->send($toList, $projectName . ':' . 'TASK#' . $task->id . $this->lang->colon . $task->name, $mailContent, $ccList); - if($this->mail->isError()) echo js::error($this->mail->getError()); + if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); } /** diff --git a/module/story/control.php b/module/story/control.php index 0fb52ca9bc..773be8a51f 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -867,7 +867,7 @@ class story extends control /* Send it. */ $this->loadModel('mail')->send($toList, $productName . ':' . 'STORY #' . $story->id . $this->lang->colon . $story->title, $mailContent, $ccList); - if($this->mail->isError()) echo js::error($this->mail->getError()); + if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); } /** * The report page. diff --git a/module/task/control.php b/module/task/control.php index 849246e65c..1558802977 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -800,7 +800,7 @@ class task extends control /* Send emails. */ $this->loadModel('mail')->send($toList, $projectName . ':' . 'TASK#' . $task->id . $this->lang->colon . $task->name, $mailContent, $ccList); - if($this->mail->isError()) echo js::error($this->mail->getError()); + if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); } /** diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index c3a81e0c1d..46a4eb6f59 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -13,7 +13,7 @@ - +
bug->create;?>
diff --git a/module/testtask/control.php b/module/testtask/control.php index 37c899c57a..e111a3c902 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -693,6 +693,6 @@ class testtask extends control $mailTitle = sprintf($this->lang->testtask->mail->edit->title, $this->app->user->realname, $testtaskID, $this->post->name); } $this->loadModel('mail')->send($this->post->owner, $mailTitle, $mailContent); - if($this->mail->isError()) echo js::error($this->mail->getError()); + if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); } }
testcase->create;?>