1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

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
This commit is contained in:
Chad Little 2015-09-03 10:55:17 -07:00
parent 4428a25a7c
commit 1e1551d970

View file

@ -109,6 +109,8 @@ final class PhrictionEditController
$notes = null; $notes = null;
$title = $content->getTitle(); $title = $content->getTitle();
$overwrite = false; $overwrite = false;
$v_cc = PhabricatorSubscribersQuery::loadSubscribersForPHID(
$document->getPHID());
if ($request->isFormPost()) { if ($request->isFormPost()) {
@ -118,6 +120,7 @@ final class PhrictionEditController
$current_version = $request->getInt('contentVersion'); $current_version = $request->getInt('contentVersion');
$v_view = $request->getStr('viewPolicy'); $v_view = $request->getStr('viewPolicy');
$v_edit = $request->getStr('editPolicy'); $v_edit = $request->getStr('editPolicy');
$v_cc = $request->getArr('cc');
$xactions = array(); $xactions = array();
$xactions[] = id(new PhrictionTransaction()) $xactions[] = id(new PhrictionTransaction())
@ -132,6 +135,9 @@ final class PhrictionEditController
$xactions[] = id(new PhrictionTransaction()) $xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
->setNewValue($v_edit); ->setNewValue($v_edit);
$xactions[] = id(new PhrictionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
->setNewValue(array('=' => $v_cc));
$editor = id(new PhrictionTransactionEditor()) $editor = id(new PhrictionTransactionEditor())
->setActor($viewer) ->setActor($viewer)
@ -222,6 +228,13 @@ final class PhrictionEditController
->setName('content') ->setName('content')
->setID('document-textarea') ->setID('document-textarea')
->setUser($viewer)) ->setUser($viewer))
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Subscribers'))
->setName('cc')
->setValue($v_cc)
->setUser($viewer)
->setDatasource(new PhabricatorMetaMTAMailableDatasource()))
->appendChild( ->appendChild(
id(new AphrontFormPolicyControl()) id(new AphrontFormPolicyControl())
->setName('viewPolicy') ->setName('viewPolicy')