Skip to content
Snippets Groups Projects
Commit 611f7076 authored by aydreeihn's avatar aydreeihn
Browse files

Implement 'Select Active Collaborators':

- Enable/Disable Collaborators based on which Collaborators are in the 'Select Active Collaborators' box
parent f4979a78
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