From 1e1551d970cbfe2b90536ecd5dd1cbc907ab8b50 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 3 Sep 2015 10:55:17 -0700 Subject: [PATCH] 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 --- .../controller/PhrictionEditController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index 546524123e..65c4fcf062 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -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')