Commit 1e1551d9 authored by Chad Little's avatar Chad Little
Browse files

Add CCs to Phriction Edit page

Summary: Fixes T4099. Allows prepopulating CCs when building Phriction pages.

Test Plan: Add notchad, remove notchad.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T4099

Differential Revision: https://secure.phabricator.com/D14042
parent 4428a25a
......@@ -109,6 +109,8 @@ final class PhrictionEditController
$notes = null;
$title = $content->getTitle();
$overwrite = false;
$v_cc = PhabricatorSubscribersQuery::loadSubscribersForPHID(
$document->getPHID());
if ($request->isFormPost()) {
......@@ -118,6 +120,7 @@ final class PhrictionEditController
$current_version = $request->getInt('contentVersion');
$v_view = $request->getStr('viewPolicy');
$v_edit = $request->getStr('editPolicy');
$v_cc = $request->getArr('cc');
$xactions = array();
$xactions[] = id(new PhrictionTransaction())
......@@ -132,6 +135,9 @@ final class PhrictionEditController
$xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
->setNewValue($v_edit);
$xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
->setNewValue(array('=' => $v_cc));
$editor = id(new PhrictionTransactionEditor())
->setActor($viewer)
......@@ -222,6 +228,13 @@ final class PhrictionEditController
->setName('content')
->setID('document-textarea')
->setUser($viewer))
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Subscribers'))
->setName('cc')
->setValue($v_cc)
->setUser($viewer)
->setDatasource(new PhabricatorMetaMTAMailableDatasource()))
->appendChild(
id(new AphrontFormPolicyControl())
->setName('viewPolicy')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment