Skip to content
Snippets Groups Projects
Unverified Commit 7788df79 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4420 from aydreeihn/issue/disable-collabs

Implement 'Select Active Collaborators':
parents ce7f88fa 611f7076
No related branches found
No related tags found
No related merge requests found
...@@ -2916,6 +2916,22 @@ implements RestrictedAccess, Threadable, Searchable { ...@@ -2916,6 +2916,22 @@ implements RestrictedAccess, Threadable, Searchable {
if (isset($vars['ccs']) && count($vars['ccs'])) if (isset($vars['ccs']) && count($vars['ccs']))
$this->addCollaborators($vars['ccs'], array(), $errors); $this->addCollaborators($vars['ccs'], array(), $errors);
if ($collabs = $this->getCollaborators()) {
foreach ($collabs as $collaborator) {
$cid = $collaborator->getUserId();
// Enable collaborators if they were reselected
if (!$collaborator->isActive() && ($vars['ccs'] && in_array($cid, $vars['ccs'])))
$collaborator->setFlag(Collaborator::FLAG_ACTIVE, true);
// Disable collaborators if they were unchecked
elseif ($collaborator->isActive() && (!$vars['ccs'] || !in_array($cid, $vars['ccs'])))
$collaborator->setFlag(Collaborator::FLAG_ACTIVE, false);
$collaborator->save();
}
}
// clear db cache
$this->getThread()->_collaborators = null;
// Get active recipients of the response // Get active recipients of the response
$recipients = $this->getRecipients($vars['reply-to'], $vars['ccs']); $recipients = $this->getRecipients($vars['reply-to'], $vars['ccs']);
if ($recipients instanceof MailingList) if ($recipients instanceof MailingList)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment