Permalink
Browse files

Merge pull request #206 from greywolfs/taskMail

merged as written

Also, nice catch on the uninitialized $projname variable in CTask->notify()
  • Loading branch information...
2 parents 3d2bd66 + c23df20 commit 392c4ba4baa19d76c0675ec51924b5bfb4b5f886 @caseysoftware caseysoftware committed Apr 2, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −4 classes/w2p/Output/EmailManager.class.php
  2. +4 −1 modules/tasks/tasks.class.php
View
5 classes/w2p/Output/EmailManager.class.php
@@ -171,11 +171,8 @@ public function getFileNotifyContacts(CFile $file)
return $this->getFileNotify($file);
}
- public function getTaskNotify(CTask $task, $user)
+ public function getTaskNotify(CTask $task, $user, $projname)
{
- $project = new CProject();
- $projname = $project->load($task->task_project)->project_name;
-
$body = $this->_AppUI->_('Project', UI_OUTPUT_RAW) . ":\t" . $projname . "\n";
$body .= $this->_AppUI->_('Task', UI_OUTPUT_RAW) . ":\t\t" . $task->task_name . "\n";
//TODO: Priority not working for some reason, will wait till later
View
5 modules/tasks/tasks.class.php
@@ -1211,6 +1211,9 @@ public function notify($comment = '')
$mail = new w2p_Utilities_Mail();
+ $project = new CProject();
+ $projname = $project->load($this->task_project)->project_name;
+
$mail->Subject($projname . '::' . $this->task_name . ' ' . $this->_AppUI->_($this->_action, UI_OUTPUT_RAW), $locale_char_set);
// c = creator
@@ -1248,7 +1251,7 @@ public function notify($comment = '')
if ($mail->ValidEmail($row['assignee_email'])) {
$emailManager = new w2p_Output_EmailManager($this->_AppUI);
- $body = $emailManager->getTaskNotify($this, $row);
+ $body = $emailManager->getTaskNotify($this, $row, $projname);
$mail->Body($body, (isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : ''));

0 comments on commit 392c4ba

Please sign in to comment.