Skip to content
Snippets Groups Projects
Commit 70f138b9 authored by JediKev's avatar JediKev
Browse files

issue: Task Response With Collaborators

This addresses a fatal error when adding a new response to a Task with
Collaborators. When we implemented the MailingList for Users/Collaborators
we forgot about the little Task Collaborators (poor little guys). This adds
a new function called `getRecipients()` to `class Thread` that utilizes
MailingList instead of UserList. This also adds two new functions to `class
Util` that retrieves the User’s `user_id`.
parent 47318a1a
No related branches found
No related tags found
No related merge requests found
...@@ -1189,7 +1189,7 @@ class Task extends TaskModel implements RestrictedAccess, Threadable { ...@@ -1189,7 +1189,7 @@ class Task extends TaskModel implements RestrictedAccess, Threadable {
global $cfg; global $cfg;
if (!$entry instanceof ThreadEntry if (!$entry instanceof ThreadEntry
|| !($recipients=$this->getThread()->getParticipants()) || !($recipients=$this->getThread()->getRecipients())
|| !($dept=$this->getDept()) || !($dept=$this->getDept())
|| !($tpl=$dept->getTemplate()) || !($tpl=$dept->getTemplate())
|| !($msg=$tpl->getTaskActivityNoticeMsgTemplate()) || !($msg=$tpl->getTaskActivityNoticeMsgTemplate())
......
...@@ -263,6 +263,17 @@ implements Searchable { ...@@ -263,6 +263,17 @@ implements Searchable {
return $this->_participants; return $this->_participants;
} }
// MailingList of recipients (collaborators)
function getRecipients() {
$list = new MailingList();
if ($collabs = $this->getActiveCollaborators()) {
foreach ($collabs as $c)
$list->addCc($c);
}
return $list;
}
function getReferral($id, $type) { function getReferral($id, $type) {
return $this->referrals->findFirst(array( return $this->referrals->findFirst(array(
......
...@@ -5,6 +5,7 @@ require_once INCLUDE_DIR . 'class.variable.php'; ...@@ -5,6 +5,7 @@ require_once INCLUDE_DIR . 'class.variable.php';
// Used by the email system // Used by the email system
interface EmailContact { interface EmailContact {
function getId(); function getId();
function getUserId();
function getName(); function getName();
function getEmail(); function getEmail();
} }
...@@ -28,6 +29,10 @@ implements EmailContact { ...@@ -28,6 +29,10 @@ implements EmailContact {
return $this->contact->getId(); return $this->contact->getId();
} }
function getUserId() {
return $this->contact->getUserId();
}
function getEmail() { function getEmail() {
return $this->contact->getEmail(); return $this->contact->getEmail();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment