@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert all tokenizers to take token/scalar inputs

Summary: Ref T7689. Ref T4100. This advances the goals of removing `loadViewerHandles()` (only 67 callsites remain!) and letting tokenizers some day take token functions like `viewer()` and `members(differential)`.

Test Plan:
- Sent a new message; used "To".
- I simplified the cancel URI construction slightly because it's moot in all normal cases.
- Edited a thread; used "Add Participants".
- Searched rooms; used "Participants".
- Searched countdowns; used "Authors".
- Created a diff; used "Repository".
- Edited a revision; edited "Projects"; edited "Reveiwers"; edited "Subscribers".
- Searched for revisions; edited "responsible users"; "authors"; "reviwers"; "subscribers"; "repositories".
- Added revision comments; edited "Add Reveiwers"; "Add Subscribers".
- Commented on a commit; edited "Add Auditors"; "Add subscribers".
- Edited a commit; edited "Projects".
- Edited a repository; edited "Projects".
- Searched feed, used "include Users"; "include Proejcts".
- Searched files, used "authors".
- Edited initiative; edited "Projects".
- Searched backers; used "Backers".
- Searched initiatives; used "Owners".
- Edited build plans; edited "Run Command".
- Searched Herald; used "Authors".
- Added signature exemption in Legalpad.
- Searhced legalpad; used "creators"; used "contributors".
- Searched signatures; used "documents"; used "signers".
- Created meme.
- Searched macros; used "Authors".
- Used "Projects" in Maniphest reports.
- Used Maniphest comment actions.
- Edited Maniphest tasks; edited "Assigned To"; edited "CC"; edited "projects".
- Used "parent" in Maniphest task creation workflow.
- Searched for projects; used "assigned to"; "in any projec"; "in all projects"; "not in projects"; "in users' projects"; "authors"; "subscribers".
- Edited Maniphest bug filing domains, used "Default Author".
- Searched for OAuth applications, used "Creators".
- Edited Owners pacakge; edited "Primary Owner"; edited "Owners".
- Searched for Owners packages; used "Owner".
- OMG this UI is OLD
- Edited a paste; edited "Projects".
- Searched for paste; used "Authors".
- Searched user activity log; used "Actors"; used "Users".
- Edited a mock; edited "Projects"; edited "CC".
- Searched for mocks; used "Authors".
- Edited Phortune account; edited "Members".
- Edited Phortune merchant account; edited "Members".
- Searched Phrequent; used "Users".
- Edited Ponder question; sued "projects".
- Searched Ponder; used "Authors"; used "Answered By".
- Added project members.
- Searched for projects; used "Members".
- Edited a Releeph product; edited "Pushers".
- Searched pull requests; searched "Requestors".
- Edited an arcanist project; used "Uses Symbols From".
- Searhced push logs; used "Repositories"; used "Pushers".
- Searched repositories; used "In nay project".
- Used global search; used Authors/owners/Subscribers/In Any Project.
- Edited a slowvote; used "Projects".
- Searched slovotes; used "Authors".
- Created a custom "Users" field; edited and searched for it.
- Made a whole lot of typos in this list. ^^^^^^

Did not test:

- Lint is nontrivial to test locally, I'll test it in production.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4100, T7689

Differential Revision: https://secure.phabricator.com/D12224

+261 -560
+21 -21
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '20d3b672', 10 + 'core.pkg.css' => 'ad650d52', 11 11 'core.pkg.js' => '0c88e7f6', 12 12 'darkconsole.pkg.js' => '8ab24e01', 13 13 'differential.pkg.css' => '3500921f', ··· 20 20 'rsrc/css/aphront/dark-console.css' => '6378ef3d', 21 21 'rsrc/css/aphront/dialog-view.css' => 'd2e76b88', 22 22 'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', 23 - 'rsrc/css/aphront/list-filter-view.css' => '2ae43867', 23 + 'rsrc/css/aphront/list-filter-view.css' => '18b7e144', 24 24 'rsrc/css/aphront/multi-column.css' => 'fd18389d', 25 25 'rsrc/css/aphront/notification.css' => '9c279160', 26 26 'rsrc/css/aphront/pager-view.css' => '2e3539af', ··· 34 34 'rsrc/css/aphront/typeahead.css' => '0e403212', 35 35 'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af', 36 36 'rsrc/css/application/auth/auth.css' => '1e655982', 37 - 'rsrc/css/application/base/main-menu-view.css' => 'cfa2ec0f', 37 + 'rsrc/css/application/base/main-menu-view.css' => '361a51f9', 38 38 'rsrc/css/application/base/notification-menu.css' => '6aa0a74b', 39 39 'rsrc/css/application/base/phabricator-application-launch-view.css' => '16ca323f', 40 40 'rsrc/css/application/base/standard-page-view.css' => 'd2a6518d', ··· 45 45 'rsrc/css/application/config/setup-issue.css' => '22270af2', 46 46 'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', 47 47 'rsrc/css/application/conpherence/durable-column.css' => 'caa12d4a', 48 - 'rsrc/css/application/conpherence/menu.css' => 'beef0920', 48 + 'rsrc/css/application/conpherence/menu.css' => '7c900089', 49 49 'rsrc/css/application/conpherence/message-pane.css' => '44154798', 50 50 'rsrc/css/application/conpherence/notification.css' => '04a6e10a', 51 51 'rsrc/css/application/conpherence/update.css' => '1099a660', ··· 355 355 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 356 356 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'bb928342', 357 357 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'a0216452', 358 - 'rsrc/js/application/conpherence/behavior-menu.js' => 'de5579b4', 358 + 'rsrc/js/application/conpherence/behavior-menu.js' => 'cda6de80', 359 359 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 360 360 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 361 361 'rsrc/js/application/conpherence/behavior-widget-pane.js' => '1ec93bcf', ··· 501 501 'aphront-bars' => '231ac33c', 502 502 'aphront-dark-console-css' => '6378ef3d', 503 503 'aphront-dialog-view-css' => 'd2e76b88', 504 - 'aphront-list-filter-view-css' => '2ae43867', 504 + 'aphront-list-filter-view-css' => '18b7e144', 505 505 'aphront-multi-column-view-css' => 'fd18389d', 506 506 'aphront-pager-view-css' => '2e3539af', 507 507 'aphront-panel-view-css' => '8427b78d', ··· 515 515 'config-options-css' => '7fedf08b', 516 516 'config-welcome-css' => '6abd79be', 517 517 'conpherence-durable-column-view' => 'caa12d4a', 518 - 'conpherence-menu-css' => 'beef0920', 518 + 'conpherence-menu-css' => '7c900089', 519 519 'conpherence-message-pane-css' => '44154798', 520 520 'conpherence-notification-css' => '04a6e10a', 521 521 'conpherence-thread-manager' => 'bb928342', ··· 557 557 'javelin-behavior-boards-dropdown' => '0ec56e1d', 558 558 'javelin-behavior-choose-control' => '6153c708', 559 559 'javelin-behavior-config-reorder-fields' => '14a827de', 560 - 'javelin-behavior-conpherence-menu' => 'de5579b4', 560 + 'javelin-behavior-conpherence-menu' => 'cda6de80', 561 561 'javelin-behavior-conpherence-pontificate' => '21ba5861', 562 562 'javelin-behavior-conpherence-widget-pane' => '1ec93bcf', 563 563 'javelin-behavior-countdown-timer' => 'e4cc26b3', ··· 729 729 'phabricator-hovercard-view-css' => '893f4783', 730 730 'phabricator-keyboard-shortcut' => '1ae869f2', 731 731 'phabricator-keyboard-shortcut-manager' => 'c1700f6f', 732 - 'phabricator-main-menu-view' => 'cfa2ec0f', 732 + 'phabricator-main-menu-view' => '361a51f9', 733 733 'phabricator-nav-view-css' => '7aeaf435', 734 734 'phabricator-notification' => '0c6946e7', 735 735 'phabricator-notification-css' => '9c279160', ··· 1755 1755 'javelin-stratcom', 1756 1756 'phabricator-phtize', 1757 1757 ), 1758 + 'cda6de80' => array( 1759 + 'javelin-behavior', 1760 + 'javelin-dom', 1761 + 'javelin-util', 1762 + 'javelin-stratcom', 1763 + 'javelin-workflow', 1764 + 'javelin-behavior-device', 1765 + 'javelin-history', 1766 + 'javelin-vector', 1767 + 'phabricator-shaped-request', 1768 + 'conpherence-thread-manager', 1769 + ), 1758 1770 'd19198c8' => array( 1759 1771 'javelin-install', 1760 1772 'javelin-dom', ··· 1806 1818 'javelin-typeahead', 1807 1819 'javelin-typeahead-ondemand-source', 1808 1820 'javelin-dom', 1809 - ), 1810 - 'de5579b4' => array( 1811 - 'javelin-behavior', 1812 - 'javelin-dom', 1813 - 'javelin-util', 1814 - 'javelin-stratcom', 1815 - 'javelin-workflow', 1816 - 'javelin-behavior-device', 1817 - 'javelin-history', 1818 - 'javelin-vector', 1819 - 'phabricator-shaped-request', 1820 - 'conpherence-thread-manager', 1821 1821 ), 1822 1822 'e10f8e18' => array( 1823 1823 'javelin-behavior',
+9 -25
src/applications/conpherence/controller/ConpherenceNewController.php
··· 53 53 } 54 54 } 55 55 56 - 57 - $participant_handles = array(); 58 - if ($participants) { 59 - $participant_handles = id(new PhabricatorHandleQuery()) 60 - ->setViewer($user) 61 - ->withPHIDs($participants) 62 - ->execute(); 63 - } 64 - 65 56 $submit_uri = $this->getApplicationURI('new/'); 66 57 $cancel_uri = $this->getApplicationURI(); 67 58 68 - // TODO - we can get a better cancel_uri once we get better at crazy 69 - // ajax jonx T2086 70 - if ($participant_prefill) { 71 - $handle = $participant_handles[$participant_prefill]; 72 - $cancel_uri = $handle->getURI(); 73 - } 74 - 75 59 $dialog = id(new AphrontDialogView()) 76 60 ->setWidth(AphrontDialogView::WIDTH_FORM) 77 61 ->setErrors($errors) ··· 80 64 ->addCancelButton($cancel_uri) 81 65 ->addSubmitButton(pht('Send Message')); 82 66 83 - $form = id(new PHUIFormLayoutView()) 67 + $form = id(new AphrontFormView()) 84 68 ->setUser($user) 85 69 ->setFullWidth(true) 86 - ->appendChild( 70 + ->appendControl( 87 71 id(new AphrontFormTokenizerControl()) 88 - ->setName('participants') 89 - ->setValue($participant_handles) 90 - ->setUser($user) 91 - ->setDatasource(new PhabricatorPeopleDatasource()) 92 - ->setLabel(pht('To')) 93 - ->setError($e_participants)) 72 + ->setName('participants') 73 + ->setValue($participants) 74 + ->setUser($user) 75 + ->setDatasource(new PhabricatorPeopleDatasource()) 76 + ->setLabel(pht('To')) 77 + ->setError($e_participants)) 94 78 ->appendChild( 95 79 id(new PhabricatorRemarkupControl()) 96 80 ->setUser($user) ··· 99 83 ->setLabel(pht('Message')) 100 84 ->setError($e_message)); 101 85 102 - $dialog->appendChild($form); 86 + $dialog->appendForm($form); 103 87 104 88 return id(new AphrontDialogResponse())->setDialog($dialog); 105 89 }
+6 -6
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 225 225 $user = $request->getUser(); 226 226 $add_person = $request->getStr('add_person'); 227 227 228 - $form = id(new PHUIFormLayoutView()) 228 + $form = id(new AphrontFormView()) 229 229 ->setUser($user) 230 230 ->setFullWidth(true) 231 - ->appendChild( 231 + ->appendControl( 232 232 id(new AphrontFormTokenizerControl()) 233 - ->setName('add_person') 234 - ->setUser($user) 235 - ->setDatasource(new PhabricatorPeopleDatasource())); 233 + ->setName('add_person') 234 + ->setUser($user) 235 + ->setDatasource(new PhabricatorPeopleDatasource())); 236 236 237 237 require_celerity_resource('conpherence-update-css'); 238 238 $view = id(new AphrontDialogView()) ··· 241 241 ->addHiddenInput( 242 242 'latest_transaction_id', 243 243 $request->getInt('latest_transaction_id')) 244 - ->appendChild($form); 244 + ->appendForm($form); 245 245 246 246 if ($request->getExists('minimal_display')) { 247 247 $view->addHiddenInput('minimal_display', true);
+7 -10
src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
··· 52 52 AphrontFormView $form, 53 53 PhabricatorSavedQuery $saved) { 54 54 55 - $phids = $saved->getParameter('participantPHIDs', array()); 56 - $participant_handles = id(new PhabricatorHandleQuery()) 57 - ->setViewer($this->requireViewer()) 58 - ->withPHIDs($phids) 59 - ->execute(); 55 + $participant_phids = $saved->getParameter('participantPHIDs', array()); 56 + 60 57 $form 61 - ->appendChild( 58 + ->appendControl( 62 59 id(new AphrontFormTokenizerControl()) 63 - ->setDatasource(new PhabricatorPeopleDatasource()) 64 - ->setName('participants') 65 - ->setLabel(pht('Participants')) 66 - ->setValue($participant_handles)); 60 + ->setDatasource(new PhabricatorPeopleDatasource()) 61 + ->setName('participants') 62 + ->setLabel(pht('Participants')) 63 + ->setValue($participant_phids)); 67 64 } 68 65 69 66 protected function getURI($path) {
+3 -7
src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
··· 40 40 public function buildSearchForm( 41 41 AphrontFormView $form, 42 42 PhabricatorSavedQuery $saved_query) { 43 - $phids = $saved_query->getParameter('authorPHIDs', array()); 44 - $author_handles = id(new PhabricatorHandleQuery()) 45 - ->setViewer($this->requireViewer()) 46 - ->withPHIDs($phids) 47 - ->execute(); 48 43 44 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 49 45 $upcoming = $saved_query->getParameter('upcoming'); 50 46 51 47 $form 52 - ->appendChild( 48 + ->appendControl( 53 49 id(new AphrontFormTokenizerControl()) 54 50 ->setDatasource(new PhabricatorPeopleDatasource()) 55 51 ->setName('authors') 56 52 ->setLabel(pht('Authors')) 57 - ->setValue($author_handles)) 53 + ->setValue($author_phids)) 58 54 ->appendChild( 59 55 id(new AphrontFormCheckboxControl()) 60 56 ->addCheckbox(
+19 -17
src/applications/differential/controller/DifferentialDiffCreateController.php
··· 28 28 // This object is just for policy stuff 29 29 $diff_object = DifferentialDiff::initializeNewDiff($viewer); 30 30 $repository_phid = null; 31 - $repository_value = array(); 32 31 $errors = array(); 33 32 $e_diff = null; 34 33 $e_file = null; ··· 62 61 array( 63 62 'diff' => $diff, 64 63 'repositoryPHID' => $repository_phid, 65 - 'viewPolicy' => $request->getStr('viewPolicy'),)); 64 + 'viewPolicy' => $request->getStr('viewPolicy'), 65 + )); 66 66 $call->setUser($viewer); 67 67 $result = $call->execute(); 68 68 ··· 93 93 94 94 $cancel_uri = $this->getApplicationURI(); 95 95 96 - if ($repository_phid) { 97 - $repository_value = $this->loadViewerHandles(array($repository_phid)); 98 - } 99 - 100 96 $policies = id(new PhabricatorPolicyQuery()) 101 97 ->setViewer($viewer) 102 98 ->setObject($diff_object) ··· 148 144 ->setValue($revision_handle->renderLink())); 149 145 } 150 146 147 + if ($repository_phid) { 148 + $repository_value = array($repository_phid); 149 + } else { 150 + $repository_value = array(); 151 + } 152 + 151 153 $form 152 154 ->appendChild( 153 155 id(new AphrontFormTextAreaControl()) ··· 161 163 ->setLabel(pht('Raw Diff From File')) 162 164 ->setName('diff-file') 163 165 ->setError($e_file)) 164 - ->appendChild( 166 + ->appendControl( 165 167 id(new AphrontFormTokenizerControl()) 166 - ->setName(id(new DifferentialRepositoryField())->getFieldKey()) 167 - ->setLabel(pht('Repository')) 168 - ->setDatasource(new DiffusionRepositoryDatasource()) 169 - ->setValue($repository_value) 170 - ->setLimit(1)) 168 + ->setName(id(new DifferentialRepositoryField())->getFieldKey()) 169 + ->setLabel(pht('Repository')) 170 + ->setDatasource(new DiffusionRepositoryDatasource()) 171 + ->setValue($repository_value) 172 + ->setLimit(1)) 171 173 ->appendChild( 172 174 id(new AphrontFormPolicyControl()) 173 - ->setUser($viewer) 174 - ->setName('viewPolicy') 175 - ->setPolicyObject($diff_object) 176 - ->setPolicies($policies) 177 - ->setCapability(PhabricatorPolicyCapability::CAN_VIEW)) 175 + ->setUser($viewer) 176 + ->setName('viewPolicy') 177 + ->setPolicyObject($diff_object) 178 + ->setPolicies($policies) 179 + ->setCapability(PhabricatorPolicyCapability::CAN_VIEW)) 178 180 ->appendChild( 179 181 id(new AphrontFormSubmitControl()) 180 182 ->addCancelButton($cancel_uri)
+2 -5
src/applications/differential/customfield/DifferentialProjectsField.php
··· 49 49 $this->setValue($request->getArr($this->getFieldKey())); 50 50 } 51 51 52 - public function getRequiredHandlePHIDsForEdit() { 53 - return $this->getValue(); 54 - } 55 - 56 52 public function renderEditControl(array $handles) { 57 53 return id(new AphrontFormTokenizerControl()) 54 + ->setUser($this->getViewer()) 58 55 ->setName($this->getFieldKey()) 59 56 ->setDatasource(new PhabricatorProjectDatasource()) 60 - ->setValue($handles) 57 + ->setValue($this->getValue()) 61 58 ->setLabel($this->getFieldName()); 62 59 } 63 60
+4 -11
src/applications/differential/customfield/DifferentialRepositoryField.php
··· 32 32 $this->setValue(nonempty($first, null)); 33 33 } 34 34 35 - public function getRequiredHandlePHIDsForEdit() { 36 - $phids = array(); 37 - if ($this->getValue()) { 38 - $phids[] = $this->getValue(); 39 - } 40 - return $phids; 41 - } 42 - 43 35 public function renderEditControl(array $handles) { 44 36 if ($this->getValue()) { 45 - $control_value = array_select_keys($handles, array($this->getValue())); 37 + $value = array($this->getValue()); 46 38 } else { 47 - $control_value = array(); 39 + $value = array(); 48 40 } 49 41 50 42 return id(new AphrontFormTokenizerControl()) 43 + ->setUser($this->getViewer()) 51 44 ->setName($this->getFieldKey()) 52 45 ->setDatasource(new DiffusionRepositoryDatasource()) 53 - ->setValue($control_value) 46 + ->setValue($value) 54 47 ->setError($this->getFieldError()) 55 48 ->setLabel($this->getFieldName()) 56 49 ->setLimit(1);
+3 -5
src/applications/differential/customfield/DifferentialReviewersField.php
··· 62 62 $this->setValue($new_status); 63 63 } 64 64 65 - public function getRequiredHandlePHIDsForEdit() { 65 + public function renderEditControl(array $handles) { 66 66 $phids = array(); 67 67 if ($this->getValue()) { 68 68 $phids = mpull($this->getValue(), 'getReviewerPHID'); 69 69 } 70 - return $phids; 71 - } 72 70 73 - public function renderEditControl(array $handles) { 74 71 return id(new AphrontFormTokenizerControl()) 72 + ->setUser($this->getViewer()) 75 73 ->setName($this->getFieldKey()) 76 74 ->setDatasource(new PhabricatorProjectOrUserDatasource()) 77 - ->setValue($handles) 75 + ->setValue($phids) 78 76 ->setError($this->getFieldError()) 79 77 ->setLabel($this->getFieldName()); 80 78 }
+2 -5
src/applications/differential/customfield/DifferentialSubscribersField.php
··· 37 37 $this->setValue($request->getArr($this->getFieldKey())); 38 38 } 39 39 40 - public function getRequiredHandlePHIDsForEdit() { 41 - return $this->getValue(); 42 - } 43 - 44 40 public function renderEditControl(array $handles) { 45 41 return id(new AphrontFormTokenizerControl()) 42 + ->setUser($this->getViewer()) 46 43 ->setName($this->getFieldKey()) 47 44 ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) 48 - ->setValue($handles) 45 + ->setValue($this->getValue()) 49 46 ->setError($this->getFieldError()) 50 47 ->setLabel($this->getFieldName()); 51 48 }
+10 -24
src/applications/differential/query/DifferentialRevisionSearchEngine.php
··· 124 124 $repository_phids = $saved->getParameter('repositoryPHIDs', array()); 125 125 $only_draft = $saved->getParameter('draft', false); 126 126 127 - $all_phids = array_mergev( 128 - array( 129 - $responsible_phids, 130 - $author_phids, 131 - $reviewer_phids, 132 - $subscriber_phids, 133 - $repository_phids, 134 - )); 135 - 136 - $handles = id(new PhabricatorHandleQuery()) 137 - ->setViewer($this->requireViewer()) 138 - ->withPHIDs($all_phids) 139 - ->execute(); 140 - 141 127 $form 142 - ->appendChild( 128 + ->appendControl( 143 129 id(new AphrontFormTokenizerControl()) 144 130 ->setLabel(pht('Responsible Users')) 145 131 ->setName('responsibles') 146 132 ->setDatasource(new PhabricatorPeopleDatasource()) 147 - ->setValue(array_select_keys($handles, $responsible_phids))) 148 - ->appendChild( 133 + ->setValue($responsible_phids)) 134 + ->appendControl( 149 135 id(new AphrontFormTokenizerControl()) 150 136 ->setLabel(pht('Authors')) 151 137 ->setName('authors') 152 138 ->setDatasource(new PhabricatorPeopleDatasource()) 153 - ->setValue(array_select_keys($handles, $author_phids))) 154 - ->appendChild( 139 + ->setValue($author_phids)) 140 + ->appendControl( 155 141 id(new AphrontFormTokenizerControl()) 156 142 ->setLabel(pht('Reviewers')) 157 143 ->setName('reviewers') 158 144 ->setDatasource(new PhabricatorProjectOrUserDatasource()) 159 - ->setValue(array_select_keys($handles, $reviewer_phids))) 160 - ->appendChild( 145 + ->setValue($reviewer_phids)) 146 + ->appendControl( 161 147 id(new AphrontFormTokenizerControl()) 162 148 ->setLabel(pht('Subscribers')) 163 149 ->setName('subscribers') 164 150 ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) 165 - ->setValue(array_select_keys($handles, $subscriber_phids))) 166 - ->appendChild( 151 + ->setValue($subscriber_phids)) 152 + ->appendControl( 167 153 id(new AphrontFormTokenizerControl()) 168 154 ->setLabel(pht('Repositories')) 169 155 ->setName('repositories') 170 156 ->setDatasource(new DiffusionRepositoryDatasource()) 171 - ->setValue(array_select_keys($handles, $repository_phids))) 157 + ->setValue($repository_phids)) 172 158 ->appendChild( 173 159 id(new AphrontFormSelectControl()) 174 160 ->setLabel(pht('Status'))
+2 -2
src/applications/differential/view/DifferentialAddCommentView.php
··· 80 80 ->setValue($action) 81 81 ->setID('comment-action') 82 82 ->setOptions($this->actions)) 83 - ->appendChild( 83 + ->appendControl( 84 84 id(new AphrontFormTokenizerControl()) 85 85 ->setLabel($enable_reviewers ? $add_reviewers_labels[$action] : 86 86 $add_reviewers_labels['add_reviewers']) ··· 89 89 ->setControlStyle($enable_reviewers ? null : 'display: none') 90 90 ->setID('add-reviewers-tokenizer') 91 91 ->setDisableBehavior(true)) 92 - ->appendChild( 92 + ->appendControl( 93 93 id(new AphrontFormTokenizerControl()) 94 94 ->setLabel(pht('Add Subscribers')) 95 95 ->setName('ccs')
+2 -2
src/applications/diffusion/controller/DiffusionCommitController.php
··· 687 687 ->setName('action') 688 688 ->setID('audit-action') 689 689 ->setOptions($actions)) 690 - ->appendChild( 690 + ->appendControl( 691 691 id(new AphrontFormTokenizerControl()) 692 692 ->setLabel(pht('Add Auditors')) 693 693 ->setName('auditors') ··· 695 695 ->setControlStyle('display: none') 696 696 ->setID('add-auditors-tokenizer') 697 697 ->setDisableBehavior(true)) 698 - ->appendChild( 698 + ->appendControl( 699 699 id(new AphrontFormTokenizerControl()) 700 700 ->setLabel(pht('Add CCs')) 701 701 ->setName('ccs')
+5 -7
src/applications/diffusion/controller/DiffusionCommitEditController.php
··· 15 15 return new Aphront404Response(); 16 16 } 17 17 18 - $commit_phid = $commit->getPHID(); 19 - $edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; 18 + $commit_phid = $commit->getPHID(); 19 + $edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; 20 20 $current_proj_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( 21 21 $commit_phid, 22 22 $edge_type); 23 - $handles = $this->loadViewerHandles($current_proj_phids); 24 - $proj_t_values = $handles; 25 23 26 24 if ($request->isFormPost()) { 27 25 $xactions = array(); ··· 36 34 ->setContentSourceFromRequest($request); 37 35 $xactions = $editor->applyTransactions($commit, $xactions); 38 36 return id(new AphrontRedirectResponse()) 39 - ->setURI('/r'.$callsign.$commit->getCommitIdentifier()); 37 + ->setURI('/r'.$callsign.$commit->getCommitIdentifier()); 40 38 } 41 39 42 40 $tokenizer_id = celerity_generate_unique_node_id(); 43 41 $form = id(new AphrontFormView()) 44 42 ->setUser($user) 45 43 ->setAction($request->getRequestURI()->getPath()) 46 - ->appendChild( 44 + ->appendControl( 47 45 id(new AphrontFormTokenizerControl()) 48 46 ->setLabel(pht('Projects')) 49 47 ->setName('projects') 50 - ->setValue($proj_t_values) 48 + ->setValue($current_proj_phids) 51 49 ->setID($tokenizer_id) 52 50 ->setCaption( 53 51 javelin_tag(
+2 -3
src/applications/diffusion/controller/DiffusionLintController.php
··· 24 24 } else { 25 25 $owners = array(head($request->getArr('owner'))); 26 26 } 27 - $owner_handles = $this->loadViewerHandles($owners); 28 27 } 29 28 30 29 $codes = $this->loadLintCodes($owners); ··· 108 107 $form = id(new AphrontFormView()) 109 108 ->setUser($user) 110 109 ->setMethod('GET') 111 - ->appendChild( 110 + ->appendControl( 112 111 id(new AphrontFormTokenizerControl()) 113 112 ->setDatasource(new PhabricatorPeopleDatasource()) 114 113 ->setLimit(1) 115 114 ->setName('owner') 116 115 ->setLabel(pht('Owner')) 117 - ->setValue($owner_handles)) 116 + ->setValue($owners)) 118 117 ->appendChild( 119 118 id(new AphrontFormSubmitControl()) 120 119 ->setValue('Filter'));
+2 -3
src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
··· 92 92 $crumbs->addTextCrumb(pht('Edit Basics')); 93 93 94 94 $title = pht('Edit %s', $repository->getName()); 95 - $project_handles = $this->loadViewerHandles($repository->getProjectPHIDs()); 96 95 97 96 $form = id(new AphrontFormView()) 98 97 ->setUser($user) ··· 123 122 ->setName('description') 124 123 ->setLabel(pht('Description')) 125 124 ->setValue($v_desc)) 126 - ->appendChild( 125 + ->appendControl( 127 126 id(new AphrontFormTokenizerControl()) 128 127 ->setDatasource(new PhabricatorProjectDatasource()) 129 128 ->setName('projectPHIDs') 130 129 ->setLabel(pht('Projects')) 131 - ->setValue($project_handles)) 130 + ->setValue($repository->getProjectPHIDs())) 132 131 ->appendChild( 133 132 id(new AphrontFormSubmitControl()) 134 133 ->setValue(pht('Save'))
+4 -13
src/applications/feed/query/PhabricatorFeedSearchEngine.php
··· 68 68 69 69 $user_phids = $saved_query->getParameter('userPHIDs', array()); 70 70 $proj_phids = $saved_query->getParameter('projectPHIDs', array()); 71 - 72 - $phids = array_merge($user_phids, $proj_phids); 73 - $handles = id(new PhabricatorHandleQuery()) 74 - ->setViewer($this->requireViewer()) 75 - ->withPHIDs($phids) 76 - ->execute(); 77 - $user_handles = array_select_keys($handles, $user_phids); 78 - $proj_handles = array_select_keys($handles, $proj_phids); 79 - 80 71 $viewer_projects = $saved_query->getParameter('viewerProjects'); 81 72 82 73 $form 83 - ->appendChild( 74 + ->appendControl( 84 75 id(new AphrontFormTokenizerControl()) 85 76 ->setDatasource(new PhabricatorPeopleDatasource()) 86 77 ->setName('users') 87 78 ->setLabel(pht('Include Users')) 88 - ->setValue($user_handles)) 89 - ->appendChild( 79 + ->setValue($user_phids)) 80 + ->appendControl( 90 81 id(new AphrontFormTokenizerControl()) 91 82 ->setDatasource(new PhabricatorProjectDatasource()) 92 83 ->setName('projectPHIDs') 93 84 ->setLabel(pht('Include Projects')) 94 - ->setValue($proj_handles)) 85 + ->setValue($proj_phids)) 95 86 ->appendChild( 96 87 id(new AphrontFormCheckboxControl()) 97 88 ->addCheckbox(
+3 -8
src/applications/files/query/PhabricatorFileSearchEngine.php
··· 54 54 AphrontFormView $form, 55 55 PhabricatorSavedQuery $saved_query) { 56 56 57 - $phids = $saved_query->getParameter('authorPHIDs', array()); 58 - $author_handles = id(new PhabricatorHandleQuery()) 59 - ->setViewer($this->requireViewer()) 60 - ->withPHIDs($phids) 61 - ->execute(); 62 - 57 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 63 58 $explicit = $saved_query->getParameter('explicit'); 64 59 65 60 $form 66 - ->appendChild( 61 + ->appendControl( 67 62 id(new AphrontFormTokenizerControl()) 68 63 ->setDatasource(new PhabricatorPeopleDatasource()) 69 64 ->setName('authors') 70 65 ->setLabel(pht('Authors')) 71 - ->setValue($author_handles)) 66 + ->setValue($author_phids)) 72 67 ->appendChild( 73 68 id(new AphrontFormCheckboxControl()) 74 69 ->addCheckbox(
+2 -8
src/applications/fund/controller/FundInitiativeEditController.php
··· 138 138 ->setObject($initiative) 139 139 ->execute(); 140 140 141 - if ($v_projects) { 142 - $project_handles = $this->loadViewerHandles($v_projects); 143 - } else { 144 - $project_handles = array(); 145 - } 146 - 147 141 $merchants = id(new PhortuneMerchantQuery()) 148 142 ->setViewer($viewer) 149 143 ->requireCapabilities( ··· 210 204 ->setName('risks') 211 205 ->setLabel(pht('Risks/Challenges')) 212 206 ->setValue($v_risk)) 213 - ->appendChild( 207 + ->appendControl( 214 208 id(new AphrontFormTokenizerControl()) 215 209 ->setLabel(pht('Projects')) 216 210 ->setName('projects') 217 - ->setValue($project_handles) 211 + ->setValue($v_projects) 218 212 ->setDatasource(new PhabricatorProjectDatasource())) 219 213 ->appendChild( 220 214 id(new AphrontFormPolicyControl())
+2 -13
src/applications/fund/query/FundBackerSearchEngine.php
··· 56 56 AphrontFormView $form, 57 57 PhabricatorSavedQuery $saved) { 58 58 59 - 60 59 $backer_phids = $saved->getParameter('backerPHIDs', array()); 61 60 62 - $all_phids = array_mergev( 63 - array( 64 - $backer_phids, 65 - )); 66 - 67 - $handles = id(new PhabricatorHandleQuery()) 68 - ->setViewer($this->requireViewer()) 69 - ->withPHIDs($all_phids) 70 - ->execute(); 71 - 72 61 $form 73 - ->appendChild( 62 + ->appendControl( 74 63 id(new AphrontFormTokenizerControl()) 75 64 ->setLabel(pht('Backers')) 76 65 ->setName('backers') 77 66 ->setDatasource(new PhabricatorPeopleDatasource()) 78 - ->setValue(array_select_keys($handles, $backer_phids))); 67 + ->setValue($backer_phids)); 79 68 } 80 69 81 70 protected function getURI($path) {
+2 -12
src/applications/fund/query/FundInitiativeSearchEngine.php
··· 51 51 52 52 $owner_phids = $saved->getParameter('ownerPHIDs', array()); 53 53 54 - $all_phids = array_mergev( 55 - array( 56 - $owner_phids, 57 - )); 58 - 59 - $handles = id(new PhabricatorHandleQuery()) 60 - ->setViewer($this->requireViewer()) 61 - ->withPHIDs($all_phids) 62 - ->execute(); 63 - 64 54 $status_map = FundInitiative::getStatusNameMap(); 65 55 $status_control = id(new AphrontFormCheckboxControl()) 66 56 ->setLabel(pht('Statuses')); ··· 73 63 } 74 64 75 65 $form 76 - ->appendChild( 66 + ->appendControl( 77 67 id(new AphrontFormTokenizerControl()) 78 68 ->setLabel(pht('Owners')) 79 69 ->setName('owners') 80 70 ->setDatasource(new PhabricatorPeopleDatasource()) 81 - ->setValue(array_select_keys($handles, $owner_phids))) 71 + ->setValue($owner_phids)) 82 72 ->appendChild($status_control); 83 73 } 84 74
+2 -7
src/applications/harbormaster/controller/HarbormasterStepEditController.php
··· 68 68 $e_description = true; 69 69 $v_description = $step->getDescription(); 70 70 $e_depends_on = true; 71 - $raw_depends_on = $step->getDetail('dependsOn', array()); 72 - 73 - $v_depends_on = id(new PhabricatorHandleQuery()) 74 - ->setViewer($viewer) 75 - ->withPHIDs($raw_depends_on) 76 - ->execute(); 71 + $v_depends_on = $step->getDetail('dependsOn', array()); 77 72 78 73 $errors = array(); 79 74 $validation_exception = null; ··· 138 133 ->setValue($v_name)); 139 134 140 135 $form 141 - ->appendChild( 136 + ->appendControl( 142 137 id(new AphrontFormTokenizerControl()) 143 138 ->setDatasource(id(new HarbormasterBuildDependencyDatasource()) 144 139 ->setParameters(array(
+3 -8
src/applications/herald/query/HeraldRuleSearchEngine.php
··· 58 58 AphrontFormView $form, 59 59 PhabricatorSavedQuery $saved_query) { 60 60 61 - $phids = $saved_query->getParameter('authorPHIDs', array()); 62 - $author_handles = id(new PhabricatorHandleQuery()) 63 - ->setViewer($this->requireViewer()) 64 - ->withPHIDs($phids) 65 - ->execute(); 66 - 61 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 67 62 $content_type = $saved_query->getParameter('contentType'); 68 63 $rule_type = $saved_query->getParameter('ruleType'); 69 64 70 65 $form 71 - ->appendChild( 66 + ->appendControl( 72 67 id(new AphrontFormTokenizerControl()) 73 68 ->setDatasource(new PhabricatorPeopleDatasource()) 74 69 ->setName('authors') 75 70 ->setLabel(pht('Authors')) 76 - ->setValue($author_handles)) 71 + ->setValue($author_phids)) 77 72 ->appendChild( 78 73 id(new AphrontFormSelectControl()) 79 74 ->setName('contentType')
+2 -3
src/applications/legalpad/controller/LegalpadDocumentSignatureAddController.php
··· 117 117 ->setUser($viewer); 118 118 119 119 if ($is_individual) { 120 - $user_handles = $this->loadViewerHandles($v_users); 121 120 $form 122 - ->appendChild( 121 + ->appendControl( 123 122 id(new AphrontFormTokenizerControl()) 124 123 ->setLabel(pht('Exempt User')) 125 124 ->setName('users') 126 125 ->setLimit(1) 127 126 ->setDatasource(new PhabricatorPeopleDatasource()) 128 - ->setValue($user_handles) 127 + ->setValue($v_users) 129 128 ->setError($e_user)); 130 129 } else { 131 130 $form
+4 -9
src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
··· 73 73 $creator_phids = $saved_query->getParameter('creatorPHIDs', array()); 74 74 $contributor_phids = $saved_query->getParameter( 75 75 'contributorPHIDs', array()); 76 - $phids = array_merge($creator_phids, $contributor_phids); 77 - $handles = id(new PhabricatorHandleQuery()) 78 - ->setViewer($this->requireViewer()) 79 - ->withPHIDs($phids) 80 - ->execute(); 81 76 82 77 $viewer_signature = $saved_query->getParameter('withViewerSignature'); 83 78 if (!$this->requireViewer()->getPHID()) { ··· 93 88 pht('Show only documents I have signed.'), 94 89 $viewer_signature) 95 90 ->setDisabled(!$this->requireViewer()->getPHID())) 96 - ->appendChild( 91 + ->appendControl( 97 92 id(new AphrontFormTokenizerControl()) 98 93 ->setDatasource(new PhabricatorPeopleDatasource()) 99 94 ->setName('creators') 100 95 ->setLabel(pht('Creators')) 101 - ->setValue(array_select_keys($handles, $creator_phids))) 102 - ->appendChild( 96 + ->setValue($creator_phids)) 97 + ->appendControl( 103 98 id(new AphrontFormTokenizerControl()) 104 99 ->setDatasource(new PhabricatorPeopleDatasource()) 105 100 ->setName('contributors') 106 101 ->setLabel(pht('Contributors')) 107 - ->setValue(array_select_keys($handles, $contributor_phids))); 102 + ->setValue($contributor_phids)); 108 103 109 104 $this->buildDateRange( 110 105 $form,
+4 -10
src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
··· 77 77 $document_phids = $saved_query->getParameter('documentPHIDs', array()); 78 78 $signer_phids = $saved_query->getParameter('signerPHIDs', array()); 79 79 80 - $phids = array_merge($document_phids, $signer_phids); 81 - $handles = id(new PhabricatorHandleQuery()) 82 - ->setViewer($this->requireViewer()) 83 - ->withPHIDs($phids) 84 - ->execute(); 85 - 86 80 if (!$this->document) { 87 81 $form 88 - ->appendChild( 82 + ->appendControl( 89 83 id(new AphrontFormTokenizerControl()) 90 84 ->setDatasource(new LegalpadDocumentDatasource()) 91 85 ->setName('documents') 92 86 ->setLabel(pht('Documents')) 93 - ->setValue(array_select_keys($handles, $document_phids))); 87 + ->setValue($document_phids)); 94 88 } 95 89 96 90 $name_contains = $saved_query->getParameter('nameContains', ''); 97 91 $email_contains = $saved_query->getParameter('emailContains', ''); 98 92 99 93 $form 100 - ->appendChild( 94 + ->appendControl( 101 95 id(new AphrontFormTokenizerControl()) 102 96 ->setDatasource(new PhabricatorPeopleDatasource()) 103 97 ->setName('signers') 104 98 ->setLabel(pht('Signers')) 105 - ->setValue(array_select_keys($handles, $signer_phids))) 99 + ->setValue($signer_phids)) 106 100 ->appendChild( 107 101 id(new AphrontFormTextControl()) 108 102 ->setLabel(pht('Name Contains'))
+5 -4
src/applications/macro/controller/PhabricatorMacroMemeDialogController.php
··· 44 44 } 45 45 } 46 46 47 - $view = id(new PHUIFormLayoutView()) 48 - ->appendChild( 47 + $view = id(new AphrontFormView()) 48 + ->setUser($user) 49 + ->appendControl( 49 50 id(new AphrontFormTokenizerControl()) 50 51 ->setLabel(pht('Macro')) 51 52 ->setName('macro') ··· 66 67 $dialog = id(new AphrontDialogView()) 67 68 ->setUser($user) 68 69 ->setTitle(pht('Create Meme')) 69 - ->appendChild($view) 70 + ->appendForm($view) 70 71 ->addCancelButton('/') 71 - ->addSubmitButton(pht('rofllolo!!~')); 72 + ->addSubmitButton(pht('Llama Diorama')); 72 73 73 74 return id(new AphrontDialogResponse())->setDialog($dialog); 74 75 }
+3 -8
src/applications/macro/query/PhabricatorMacroSearchEngine.php
··· 74 74 AphrontFormView $form, 75 75 PhabricatorSavedQuery $saved_query) { 76 76 77 - $phids = $saved_query->getParameter('authorPHIDs', array()); 78 - $author_handles = id(new PhabricatorHandleQuery()) 79 - ->setViewer($this->requireViewer()) 80 - ->withPHIDs($phids) 81 - ->execute(); 82 - 77 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 83 78 $status = $saved_query->getParameter('status'); 84 79 $names = implode(', ', $saved_query->getParameter('names', array())); 85 80 $like = $saved_query->getParameter('nameLike'); ··· 92 87 ->setLabel(pht('Status')) 93 88 ->setOptions(PhabricatorMacroQuery::getStatusOptions()) 94 89 ->setValue($status)) 95 - ->appendChild( 90 + ->appendControl( 96 91 id(new AphrontFormTokenizerControl()) 97 92 ->setDatasource(new PhabricatorPeopleDatasource()) 98 93 ->setName('authors') 99 94 ->setLabel(pht('Authors')) 100 - ->setValue($author_handles)) 95 + ->setValue($author_phids)) 101 96 ->appendChild( 102 97 id(new AphrontFormTextControl()) 103 98 ->setName('nameLike')
+3 -2
src/applications/maniphest/controller/ManiphestReportController.php
··· 320 320 321 321 $form = id(new AphrontFormView()) 322 322 ->setUser($user) 323 - ->appendChild( 323 + ->appendControl( 324 324 id(new AphrontFormTokenizerControl()) 325 325 ->setDatasource(new PhabricatorProjectDatasource()) 326 326 ->setLabel(pht('Project')) 327 327 ->setLimit(1) 328 328 ->setName('set_project') 329 - ->setValue($tokens)); 329 + // TODO: This is silly, but this is Maniphest reports. 330 + ->setValue(mpull($tokens, 'getPHID'))); 330 331 331 332 if ($has_window) { 332 333 list($window_str, $ignored, $window_error) = $this->getWindow();
+3 -3
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 202 202 ->setControlID('resolution') 203 203 ->setControlStyle('display: none') 204 204 ->setOptions($resolution_types)) 205 - ->appendChild( 205 + ->appendControl( 206 206 id(new AphrontFormTokenizerControl()) 207 207 ->setLabel(pht('Assign To')) 208 208 ->setName('assign_to') ··· 210 210 ->setControlStyle('display: none') 211 211 ->setID('assign-tokenizer') 212 212 ->setDisableBehavior(true)) 213 - ->appendChild( 213 + ->appendControl( 214 214 id(new AphrontFormTokenizerControl()) 215 215 ->setLabel(pht('CCs')) 216 216 ->setName('ccs') ··· 226 226 ->setControlID('priority') 227 227 ->setControlStyle('display: none') 228 228 ->setValue($task->getPriority())) 229 - ->appendChild( 229 + ->appendControl( 230 230 id(new AphrontFormTokenizerControl()) 231 231 ->setLabel(pht('Projects')) 232 232 ->setName('projects')
+7 -21
src/applications/maniphest/controller/ManiphestTaskEditController.php
··· 506 506 } 507 507 } 508 508 509 - $phids = array_merge( 510 - array($task->getOwnerPHID()), 511 - $task->getSubscriberPHIDs(), 512 - $task->getProjectPHIDs()); 513 - 514 - if ($parent_task) { 515 - $phids[] = $parent_task->getPHID(); 516 - } 517 - 518 - $phids = array_filter($phids); 519 - $phids = array_unique($phids); 520 - 521 - $handles = $this->loadViewerHandles($phids); 522 - 523 509 $error_view = null; 524 510 if ($errors) { 525 511 $error_view = new PHUIInfoView(); ··· 529 515 $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); 530 516 531 517 if ($task->getOwnerPHID()) { 532 - $assigned_value = array($handles[$task->getOwnerPHID()]); 518 + $assigned_value = array($task->getOwnerPHID()); 533 519 } else { 534 520 $assigned_value = array(); 535 521 } 536 522 537 523 if ($task->getSubscriberPHIDs()) { 538 - $cc_value = array_select_keys($handles, $task->getSubscriberPHIDs()); 524 + $cc_value = $task->getSubscriberPHIDs(); 539 525 } else { 540 526 $cc_value = array(); 541 527 } 542 528 543 529 if ($task->getProjectPHIDs()) { 544 - $projects_value = array_select_keys($handles, $task->getProjectPHIDs()); 530 + $projects_value = $task->getProjectPHIDs(); 545 531 } else { 546 532 $projects_value = array(); 547 533 } ··· 583 569 ->appendChild( 584 570 id(new AphrontFormStaticControl()) 585 571 ->setLabel(pht('Parent Task')) 586 - ->setValue($handles[$parent_task->getPHID()]->getFullName())) 572 + ->setValue($user->renderHandle($parent_task->getPHID()))) 587 573 ->addHiddenInput('parent', $parent_task->getID()); 588 574 } 589 575 ··· 620 606 ->execute(); 621 607 622 608 if ($can_edit_assign) { 623 - $form->appendChild( 609 + $form->appendControl( 624 610 id(new AphrontFormTokenizerControl()) 625 611 ->setLabel(pht('Assigned To')) 626 612 ->setName('assigned_to') ··· 631 617 } 632 618 633 619 $form 634 - ->appendChild( 620 + ->appendControl( 635 621 id(new AphrontFormTokenizerControl()) 636 622 ->setLabel(pht('CC')) 637 623 ->setName('cc') ··· 680 666 pht('Create New Project')); 681 667 } 682 668 $form 683 - ->appendChild( 669 + ->appendControl( 684 670 id(new AphrontFormTokenizerControl()) 685 671 ->setLabel(pht('Projects')) 686 672 ->setName('projects')
+19 -44
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 258 258 array()); 259 259 $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); 260 260 261 - $all_phids = array_merge( 262 - $assigned_phids, 263 - $author_phids, 264 - $all_project_phids, 265 - $any_project_phids, 266 - $exclude_project_phids, 267 - $user_project_phids, 268 - $subscriber_phids); 269 - 270 - if ($all_phids) { 271 - $handles = id(new PhabricatorHandleQuery()) 272 - ->setViewer($this->requireViewer()) 273 - ->withPHIDs($all_phids) 274 - ->execute(); 275 - } else { 276 - $handles = array(); 277 - } 278 - 279 - $assigned_handles = array_select_keys($handles, $assigned_phids); 280 - $author_handles = array_select_keys($handles, $author_phids); 281 - $all_project_handles = array_select_keys($handles, $all_project_phids); 282 - $any_project_handles = array_select_keys($handles, $any_project_phids); 283 - $exclude_project_handles = array_select_keys( 284 - $handles, 285 - $exclude_project_phids); 286 - $user_project_handles = array_select_keys($handles, $user_project_phids); 287 - $subscriber_handles = array_select_keys($handles, $subscriber_phids); 288 - 289 261 $with_unassigned = $saved->getParameter('withUnassigned'); 290 262 $with_no_projects = $saved->getParameter('withNoProject'); 291 263 ··· 320 292 ->setOptions(array( 321 293 '' => pht('Show All Tasks'), 322 294 'true' => pht('Show Tasks Blocking Other Tasks'), 323 - 'false' => pht('Show Tasks Not Blocking Other Tasks'),)); 295 + 'false' => pht('Show Tasks Not Blocking Other Tasks'), 296 + )); 297 + 324 298 $blocked_control = id(new AphrontFormSelectControl()) 325 299 ->setLabel(pht('Blocked')) 326 300 ->setName('blocked') ··· 328 302 ->setOptions(array( 329 303 '' => pht('Show All Tasks'), 330 304 'true' => pht('Show Tasks Blocked By Other Tasks'), 331 - 'false' => pht('Show Tasks Not Blocked By Other Tasks'),)); 305 + 'false' => pht('Show Tasks Not Blocked By Other Tasks'), 306 + )); 332 307 333 308 $ids = $saved->getParameter('ids', array()); 334 309 ··· 337 312 $all_orders = $builtin_orders + $custom_orders; 338 313 339 314 $form 340 - ->appendChild( 315 + ->appendControl( 341 316 id(new AphrontFormTokenizerControl()) 342 317 ->setDatasource(new PhabricatorPeopleDatasource()) 343 318 ->setName('assigned') 344 319 ->setLabel(pht('Assigned To')) 345 - ->setValue($assigned_handles)) 320 + ->setValue($assigned_phids)) 346 321 ->appendChild( 347 322 id(new AphrontFormCheckboxControl()) 348 323 ->addCheckbox( ··· 350 325 1, 351 326 pht('Show only unassigned tasks.'), 352 327 $with_unassigned)) 353 - ->appendChild( 328 + ->appendControl( 354 329 id(new AphrontFormTokenizerControl()) 355 330 ->setDatasource(new PhabricatorProjectDatasource()) 356 331 ->setName('allProjects') 357 332 ->setLabel(pht('In All Projects')) 358 - ->setValue($all_project_handles)); 333 + ->setValue($all_project_phids)); 359 334 360 335 if (!$this->getIsBoardView()) { 361 336 $form ··· 369 344 } 370 345 371 346 $form 372 - ->appendChild( 347 + ->appendControl( 373 348 id(new AphrontFormTokenizerControl()) 374 349 ->setDatasource(new PhabricatorProjectDatasource()) 375 350 ->setName('anyProjects') 376 351 ->setLabel(pht('In Any Project')) 377 - ->setValue($any_project_handles)) 378 - ->appendChild( 352 + ->setValue($any_project_phids)) 353 + ->appendControl( 379 354 id(new AphrontFormTokenizerControl()) 380 355 ->setDatasource(new PhabricatorProjectDatasource()) 381 356 ->setName('excludeProjects') 382 357 ->setLabel(pht('Not In Projects')) 383 - ->setValue($exclude_project_handles)) 384 - ->appendChild( 358 + ->setValue($exclude_project_phids)) 359 + ->appendControl( 385 360 id(new AphrontFormTokenizerControl()) 386 361 ->setDatasource(new PhabricatorPeopleDatasource()) 387 362 ->setName('userProjects') 388 363 ->setLabel(pht('In Users\' Projects')) 389 - ->setValue($user_project_handles)) 390 - ->appendChild( 364 + ->setValue($user_project_phids)) 365 + ->appendControl( 391 366 id(new AphrontFormTokenizerControl()) 392 367 ->setDatasource(new PhabricatorPeopleDatasource()) 393 368 ->setName('authors') 394 369 ->setLabel(pht('Authors')) 395 - ->setValue($author_handles)) 396 - ->appendChild( 370 + ->setValue($author_phids)) 371 + ->appendControl( 397 372 id(new AphrontFormTokenizerControl()) 398 373 ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) 399 374 ->setName('subscribers') 400 375 ->setLabel(pht('Subscribers')) 401 - ->setValue($subscriber_handles)) 376 + ->setValue($subscriber_phids)) 402 377 ->appendChild( 403 378 id(new AphrontFormTextControl()) 404 379 ->setName('fulltext')
+7 -9
src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php
··· 301 301 302 302 $default_user = $email_object->getConfigValue($default_user_key); 303 303 if ($default_user) { 304 - $default_user_handle = id(new PhabricatorHandleQuery()) 305 - ->setViewer($viewer) 306 - ->withPHIDs(array($default_user)) 307 - ->execute(); 304 + $default_user_value = array($default_user); 308 305 } else { 309 - $default_user_handle = array(); 306 + $default_user_value = array(); 310 307 } 311 308 312 - $form = id(new PHUIFormLayoutView()) 309 + $form = id(new AphrontFormView()) 310 + ->setUser($viewer) 313 311 ->appendChild( 314 312 id(new AphrontFormTextControl()) 315 313 ->setLabel(pht('Email')) ··· 317 315 ->setValue($email_object->getAddress()) 318 316 ->setCaption(PhabricatorUserEmail::describeAllowedAddresses()) 319 317 ->setError($e_email)) 320 - ->appendChild( 318 + ->appendControl( 321 319 id(new AphrontFormTokenizerControl()) 322 320 ->setDatasource(new PhabricatorPeopleDatasource()) 323 321 ->setLabel(pht('Default Author')) 324 322 ->setName($default_user_key) 325 323 ->setLimit(1) 326 - ->setValue($default_user_handle) 324 + ->setValue($default_user_value) 327 325 ->setCaption(pht( 328 326 'Used if the "From:" address does not map to a known account.'))); 329 327 if ($is_new) { ··· 336 334 ->setWidth(AphrontDialogView::WIDTH_FORM) 337 335 ->setTitle($title) 338 336 ->appendChild($errors) 339 - ->appendChild($form) 337 + ->appendForm($form) 340 338 ->addSubmitButton(pht('Save')) 341 339 ->addCancelButton($uri); 342 340
+3 -7
src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php
··· 36 36 AphrontFormView $form, 37 37 PhabricatorSavedQuery $saved_query) { 38 38 39 - $phids = $saved_query->getParameter('creatorPHIDs', array()); 40 - $creator_handles = id(new PhabricatorHandleQuery()) 41 - ->setViewer($this->requireViewer()) 42 - ->withPHIDs($phids) 43 - ->execute(); 39 + $creator_phids = $saved_query->getParameter('creatorPHIDs', array()); 44 40 45 41 $form 46 - ->appendChild( 42 + ->appendControl( 47 43 id(new AphrontFormTokenizerControl()) 48 44 ->setDatasource(new PhabricatorPeopleDatasource()) 49 45 ->setName('creators') 50 46 ->setLabel(pht('Creators')) 51 - ->setValue($creator_handles)); 47 + ->setValue($creator_phids)); 52 48 } 53 49 54 50 protected function getURI($path) {
+7 -11
src/applications/owners/controller/PhabricatorOwnersEditController.php
··· 114 114 } 115 115 } 116 116 117 - $handles = $this->loadViewerHandles($owners); 118 - 119 117 $primary = $package->getPrimaryOwnerPHID(); 120 - if ($primary && isset($handles[$primary])) { 121 - $handle_primary_owner = array($handles[$primary]); 118 + if ($primary) { 119 + $value_primary_owner = array($primary); 122 120 } else { 123 - $handle_primary_owner = array(); 121 + $value_primary_owner = array(); 124 122 } 125 - 126 - $handles_all_owners = array_select_keys($handles, $owners); 127 123 128 124 if ($package->getID()) { 129 125 $title = pht('Edit Package'); ··· 182 178 ->setName('name') 183 179 ->setValue($package->getName()) 184 180 ->setError($e_name)) 185 - ->appendChild( 181 + ->appendControl( 186 182 id(new AphrontFormTokenizerControl()) 187 183 ->setDatasource(new PhabricatorProjectOrUserDatasource()) 188 184 ->setLabel(pht('Primary Owner')) 189 185 ->setName('primary') 190 186 ->setLimit(1) 191 - ->setValue($handle_primary_owner) 187 + ->setValue($value_primary_owner) 192 188 ->setError($e_primary)) 193 - ->appendChild( 189 + ->appendControl( 194 190 id(new AphrontFormTokenizerControl()) 195 191 ->setDatasource(new PhabricatorProjectOrUserDatasource()) 196 192 ->setLabel(pht('Owners')) 197 193 ->setName('owners') 198 - ->setValue($handles_all_owners)) 194 + ->setValue($owners)) 199 195 ->appendChild( 200 196 id(new AphrontFormSelectControl()) 201 197 ->setName('auditing')
+3 -9
src/applications/owners/controller/PhabricatorOwnersListController.php
··· 148 148 149 149 $filter = new AphrontListFilterView(); 150 150 151 - $owners_search_value = array(); 152 - if ($request->getArr('owner')) { 153 - $phids = $request->getArr('owner'); 154 - $phid = reset($phids); 155 - $handles = $this->loadViewerHandles(array($phid)); 156 - $owners_search_value = array($handles[$phid]); 157 - } 151 + $owner_phids = $request->getArr('owner'); 158 152 159 153 $callsigns = array('' => pht('(Any Repository)')); 160 154 $repositories = id(new PhabricatorRepositoryQuery()) ··· 175 169 ->setName('name') 176 170 ->setLabel(pht('Name')) 177 171 ->setValue($request->getStr('name'))) 178 - ->appendChild( 172 + ->appendControl( 179 173 id(new AphrontFormTokenizerControl()) 180 174 ->setDatasource(new PhabricatorProjectOrUserDatasource()) 181 175 ->setLimit(1) 182 176 ->setName('owner') 183 177 ->setLabel(pht('Owner')) 184 - ->setValue($owners_search_value)) 178 + ->setValue($owner_phids)) 185 179 ->appendChild( 186 180 id(new AphrontFormSelectControl()) 187 181 ->setName('repository')
+2 -8
src/applications/paste/controller/PhabricatorPasteEditController.php
··· 188 188 ->setPolicies($policies) 189 189 ->setName('can_edit')); 190 190 191 - if ($v_projects) { 192 - $project_handles = $this->loadViewerHandles($v_projects); 193 - } else { 194 - $project_handles = array(); 195 - } 196 - 197 - $form->appendChild( 191 + $form->appendControl( 198 192 id(new AphrontFormTokenizerControl()) 199 193 ->setLabel(pht('Projects')) 200 194 ->setName('projects') 201 - ->setValue($project_handles) 195 + ->setValue($v_projects) 202 196 ->setDatasource(new PhabricatorProjectDatasource())); 203 197 204 198 $form
+3 -7
src/applications/paste/query/PhabricatorPasteSearchEngine.php
··· 52 52 public function buildSearchForm( 53 53 AphrontFormView $form, 54 54 PhabricatorSavedQuery $saved_query) { 55 - $phids = $saved_query->getParameter('authorPHIDs', array()); 56 - $author_handles = id(new PhabricatorHandleQuery()) 57 - ->setViewer($this->requireViewer()) 58 - ->withPHIDs($phids) 59 - ->execute(); 55 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 60 56 61 57 $languages = $saved_query->getParameter('languages', array()); 62 58 $no_language = false; ··· 69 65 } 70 66 71 67 $form 72 - ->appendChild( 68 + ->appendControl( 73 69 id(new AphrontFormTokenizerControl()) 74 70 ->setDatasource(new PhabricatorPeopleDatasource()) 75 71 ->setName('authors') 76 72 ->setLabel(pht('Authors')) 77 - ->setValue($author_handles)) 73 + ->setValue($author_phids)) 78 74 ->appendChild( 79 75 id(new AphrontFormTextControl()) 80 76 ->setName('languages')
+4 -20
src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
··· 89 89 $actor_phids = $saved->getParameter('actorPHIDs', array()); 90 90 $user_phids = $saved->getParameter('userPHIDs', array()); 91 91 92 - $all_phids = array_merge( 93 - $actor_phids, 94 - $user_phids); 95 - 96 - if ($all_phids) { 97 - $handles = id(new PhabricatorHandleQuery()) 98 - ->setViewer($this->requireViewer()) 99 - ->withPHIDs($all_phids) 100 - ->execute(); 101 - } else { 102 - $handles = array(); 103 - } 104 - 105 - $actor_handles = array_select_keys($handles, $actor_phids); 106 - $user_handles = array_select_keys($handles, $user_phids); 107 - 108 92 $actions = $saved->getParameter('actions', array()); 109 93 $remote_prefix = $saved->getParameter('ip'); 110 94 $sessions = $saved->getParameter('sessions', array()); ··· 122 106 } 123 107 124 108 $form 125 - ->appendChild( 109 + ->appendControl( 126 110 id(new AphrontFormTokenizerControl()) 127 111 ->setDatasource(new PhabricatorPeopleDatasource()) 128 112 ->setName('actors') 129 113 ->setLabel(pht('Actors')) 130 - ->setValue($actor_handles)) 131 - ->appendChild( 114 + ->setValue($actor_phids)) 115 + ->appendControl( 132 116 id(new AphrontFormTokenizerControl()) 133 117 ->setDatasource(new PhabricatorPeopleDatasource()) 134 118 ->setName('users') 135 119 ->setLabel(pht('Users')) 136 - ->setValue($user_handles)) 120 + ->setValue($user_phids)) 137 121 ->appendChild($action_control) 138 122 ->appendChild( 139 123 id(new AphrontFormTextControl())
+4 -15
src/applications/pholio/controller/PholioMockEditController.php
··· 245 245 $mock->setViewPolicy($v_view); 246 246 $mock->setEditPolicy($v_edit); 247 247 248 - $handles = id(new PhabricatorHandleQuery()) 249 - ->setViewer($user) 250 - ->withPHIDs($v_cc) 251 - ->execute(); 252 - 253 248 $image_elements = array(); 254 249 if ($posted_mock_images) { 255 250 $display_mock_images = $posted_mock_images; ··· 307 302 ), 308 303 )); 309 304 310 - if ($v_projects) { 311 - $project_handles = $this->loadViewerHandles($v_projects); 312 - } else { 313 - $project_handles = array(); 314 - } 315 - 316 305 require_celerity_resource('pholio-edit-css'); 317 306 $form = id(new AphrontFormView()) 318 307 ->setUser($user) ··· 342 331 } 343 332 344 333 $form 345 - ->appendChild( 334 + ->appendControl( 346 335 id(new AphrontFormTokenizerControl()) 347 336 ->setLabel(pht('Projects')) 348 337 ->setName('projects') 349 - ->setValue($project_handles) 338 + ->setValue($v_projects) 350 339 ->setDatasource(new PhabricatorProjectDatasource())) 351 - ->appendChild( 340 + ->appendControl( 352 341 id(new AphrontFormTokenizerControl()) 353 342 ->setLabel(pht('CC')) 354 343 ->setName('cc') 355 - ->setValue($handles) 344 + ->setValue($v_cc) 356 345 ->setUser($user) 357 346 ->setDatasource(new PhabricatorMetaMTAMailableDatasource())) 358 347 ->appendChild(
+3 -7
src/applications/pholio/query/PholioMockSearchEngine.php
··· 37 37 AphrontFormView $form, 38 38 PhabricatorSavedQuery $saved_query) { 39 39 40 - $phids = $saved_query->getParameter('authorPHIDs', array()); 41 - $author_handles = id(new PhabricatorHandleQuery()) 42 - ->setViewer($this->requireViewer()) 43 - ->withPHIDs($phids) 44 - ->execute(); 40 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 45 41 46 42 $statuses = array( 47 43 '' => pht('Any Status'), ··· 53 49 $status = head($status); 54 50 55 51 $form 56 - ->appendChild( 52 + ->appendControl( 57 53 id(new AphrontFormTokenizerControl()) 58 54 ->setDatasource(new PhabricatorPeopleDatasource()) 59 55 ->setName('authors') 60 56 ->setLabel(pht('Authors')) 61 - ->setValue($author_handles)) 57 + ->setValue($author_phids)) 62 58 ->appendChild( 63 59 id(new AphrontFormSelectControl()) 64 60 ->setLabel(pht('Status'))
+2 -4
src/applications/phortune/controller/PhortuneAccountEditController.php
··· 97 97 $submit_button = pht('Save Changes'); 98 98 } 99 99 100 - $member_handles = $this->loadViewerHandles($v_members); 101 - 102 100 $form = id(new AphrontFormView()) 103 101 ->setUser($viewer) 104 102 ->appendChild( ··· 107 105 ->setLabel(pht('Name')) 108 106 ->setValue($v_name) 109 107 ->setError($e_name)) 110 - ->appendChild( 108 + ->appendControl( 111 109 id(new AphrontFormTokenizerControl()) 112 110 ->setDatasource(new PhabricatorPeopleDatasource()) 113 111 ->setLabel(pht('Members')) 114 112 ->setName('memberPHIDs') 115 - ->setValue($member_handles) 113 + ->setValue($v_members) 116 114 ->setError($e_members)) 117 115 ->appendChild( 118 116 id(new AphrontFormSubmitControl())
+2 -4
src/applications/phortune/controller/PhortuneMerchantEditController.php
··· 119 119 ->setObject($merchant) 120 120 ->execute(); 121 121 122 - $member_handles = $this->loadViewerHandles($v_members); 123 - 124 122 $form = id(new AphrontFormView()) 125 123 ->setUser($viewer) 126 124 ->appendChild( ··· 135 133 ->setName('desc') 136 134 ->setLabel(pht('Description')) 137 135 ->setValue($v_desc)) 138 - ->appendChild( 136 + ->appendControl( 139 137 id(new AphrontFormTokenizerControl()) 140 138 ->setDatasource(new PhabricatorPeopleDatasource()) 141 139 ->setLabel(pht('Members')) 142 140 ->setName('memberPHIDs') 143 - ->setValue($member_handles) 141 + ->setValue($v_members) 144 142 ->setError($e_members)) 145 143 ->appendChild( 146 144 id(new AphrontFormPolicyControl())
+2 -8
src/applications/phrequent/query/PhrequentSearchEngine.php
··· 60 60 $order = $saved_query->getParameter( 61 61 'order', PhrequentUserTimeQuery::ORDER_ENDED_DESC); 62 62 63 - $phids = array_merge($user_phids); 64 - $handles = id(new PhabricatorHandleQuery()) 65 - ->setViewer($this->requireViewer()) 66 - ->withPHIDs($phids) 67 - ->execute(); 68 - 69 63 $form 70 - ->appendChild( 64 + ->appendControl( 71 65 id(new AphrontFormTokenizerControl()) 72 66 ->setDatasource(new PhabricatorPeopleDatasource()) 73 67 ->setName('users') 74 68 ->setLabel(pht('Users')) 75 - ->setValue($handles)) 69 + ->setValue($user_phids)) 76 70 ->appendChild( 77 71 id(new AphrontFormSelectControl()) 78 72 ->setLabel(pht('Ended'))
+2 -8
src/applications/ponder/controller/PonderQuestionEditController.php
··· 105 105 ->setLabel(pht('Description')) 106 106 ->setUser($user)); 107 107 108 - if ($v_projects) { 109 - $project_handles = $this->loadViewerHandles($v_projects); 110 - } else { 111 - $project_handles = array(); 112 - } 113 - 114 - $form->appendChild( 108 + $form->appendControl( 115 109 id(new AphrontFormTokenizerControl()) 116 110 ->setLabel(pht('Projects')) 117 111 ->setName('projects') 118 - ->setValue($project_handles) 112 + ->setValue($v_projects) 119 113 ->setDatasource(new PhabricatorProjectDatasource())); 120 114 121 115 $form ->appendChild(
+4 -10
src/applications/ponder/query/PonderQuestionSearchEngine.php
··· 64 64 $status = $saved_query->getParameter( 65 65 'status', PonderQuestionStatus::STATUS_OPEN); 66 66 67 - $phids = array_merge($author_phids, $answerer_phids); 68 - $handles = id(new PhabricatorHandleQuery()) 69 - ->setViewer($this->requireViewer()) 70 - ->withPHIDs($phids) 71 - ->execute(); 72 - 73 67 $form 74 - ->appendChild( 68 + ->appendControl( 75 69 id(new AphrontFormTokenizerControl()) 76 70 ->setDatasource(new PhabricatorPeopleDatasource()) 77 71 ->setName('authors') 78 72 ->setLabel(pht('Authors')) 79 - ->setValue(array_select_keys($handles, $author_phids))) 80 - ->appendChild( 73 + ->setValue($author_phids)) 74 + ->appendControl( 81 75 id(new AphrontFormTokenizerControl()) 82 76 ->setDatasource(new PhabricatorPeopleDatasource()) 83 77 ->setName('answerers') 84 78 ->setLabel(pht('Answered By')) 85 - ->setValue(array_select_keys($handles, $answerer_phids))) 79 + ->setValue($answerer_phids)) 86 80 ->appendChild( 87 81 id(new AphrontFormSelectControl()) 88 82 ->setLabel(pht('Status'))
+1
src/applications/project/controller/PhabricatorProjectBoardImportController.php
··· 74 74 ->setDatasource(id(new PhabricatorProjectDatasource()) 75 75 ->setParameters(array('mustHaveColumns' => true)) 76 76 ->setLimit(1)); 77 + 77 78 return $this->newDialog() 78 79 ->setTitle(pht('Import Columns')) 79 80 ->setWidth(AphrontDialogView::WIDTH_FORM)
+1 -1
src/applications/project/controller/PhabricatorProjectMembersEditController.php
··· 88 88 $form = new AphrontFormView(); 89 89 $form 90 90 ->setUser($user) 91 - ->appendChild( 91 + ->appendControl( 92 92 id(new AphrontFormTokenizerControl()) 93 93 ->setName('phids') 94 94 ->setLabel(pht('Add Members'))
+3 -7
src/applications/project/query/PhabricatorProjectSearchEngine.php
··· 77 77 AphrontFormView $form, 78 78 PhabricatorSavedQuery $saved) { 79 79 80 - $phids = $saved->getParameter('memberPHIDs', array()); 81 - $member_handles = id(new PhabricatorHandleQuery()) 82 - ->setViewer($this->requireViewer()) 83 - ->withPHIDs($phids) 84 - ->execute(); 80 + $member_phids = $saved->getParameter('memberPHIDs', array()); 85 81 86 82 $status = $saved->getParameter('status'); 87 83 $name_match = $saved->getParameter('name'); ··· 123 119 ->setName('name') 124 120 ->setLabel(pht('Name')) 125 121 ->setValue($name_match)) 126 - ->appendChild( 122 + ->appendControl( 127 123 id(new AphrontFormTokenizerControl()) 128 124 ->setDatasource(new PhabricatorPeopleDatasource()) 129 125 ->setName('members') 130 126 ->setLabel(pht('Members')) 131 - ->setValue($member_handles)) 127 + ->setValue($member_phids)) 132 128 ->appendChild( 133 129 id(new AphrontFormSelectControl()) 134 130 ->setLabel(pht('Status'))
+2 -9
src/applications/releeph/controller/product/ReleephProductEditController.php
··· 120 120 'pushers', 121 121 $product->getDetail('pushers', array())); 122 122 123 - $handles = id(new PhabricatorHandleQuery()) 124 - ->setViewer($request->getUser()) 125 - ->withPHIDs($pusher_phids) 126 - ->execute(); 127 - 128 - $pusher_handles = array_select_keys($handles, $pusher_phids); 129 - 130 123 $form = id(new AphrontFormView()) 131 124 ->setUser($request->getUser()) 132 125 ->appendChild( ··· 191 184 ->addStatic('projectName', $product->getName()); 192 185 193 186 $form 194 - ->appendChild( 187 + ->appendControl( 195 188 id(new AphrontFormTokenizerControl()) 196 189 ->setLabel(pht('Pushers')) 197 190 ->setName('pushers') 198 191 ->setDatasource(new PhabricatorPeopleDatasource()) 199 - ->setValue($pusher_handles)) 192 + ->setValue($pusher_phids)) 200 193 ->appendChild($branch_template_input) 201 194 ->appendChild($branch_template_preview) 202 195 ->appendRemarkupInstructions($this->getBranchHelpText());
+3 -7
src/applications/releeph/query/ReleephRequestSearchEngine.php
··· 67 67 AphrontFormView $form, 68 68 PhabricatorSavedQuery $saved_query) { 69 69 70 - $phids = $saved_query->getParameter('requestorPHIDs', array()); 71 - $requestor_handles = id(new PhabricatorHandleQuery()) 72 - ->setViewer($this->requireViewer()) 73 - ->withPHIDs($phids) 74 - ->execute(); 70 + $requestor_phids = $saved_query->getParameter('requestorPHIDs', array()); 75 71 76 72 $form 77 73 ->appendChild( ··· 86 82 ->setLabel(pht('Severity')) 87 83 ->setValue($saved_query->getParameter('severity')) 88 84 ->setOptions($this->getSeverityOptions())) 89 - ->appendChild( 85 + ->appendControl( 90 86 id(new AphrontFormTokenizerControl()) 91 87 ->setDatasource(new PhabricatorPeopleDatasource()) 92 88 ->setName('requestors') 93 89 ->setLabel(pht('Requestors')) 94 - ->setValue($requestor_handles)); 90 + ->setValue($requestor_phids)); 95 91 } 96 92 97 93 protected function getURI($path) {
+2 -5
src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
··· 59 59 } 60 60 61 61 if ($project->getSymbolIndexProjects()) { 62 - $uses = id(new PhabricatorHandleQuery()) 63 - ->setViewer($user) 64 - ->withPHIDs($project->getSymbolIndexProjects()) 65 - ->execute(); 62 + $uses = $project->getSymbolIndexProjects(); 66 63 } else { 67 64 $uses = array(); 68 65 } ··· 91 88 'Separate with commas, for example: %s', 92 89 phutil_tag('tt', array(), 'php, py'))) 93 90 ->setValue($langs)) 94 - ->appendChild( 91 + ->appendControl( 95 92 id(new AphrontFormTokenizerControl()) 96 93 ->setLabel(pht('Uses Symbols From')) 97 94 ->setName('symbolIndexProjects')
+4 -20
src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
··· 55 55 $repository_phids = $saved_query->getParameter('repositoryPHIDs', array()); 56 56 $pusher_phids = $saved_query->getParameter('pusherPHIDs', array()); 57 57 58 - $all_phids = array_merge( 59 - $repository_phids, 60 - $pusher_phids); 61 - 62 - if ($all_phids) { 63 - $handles = id(new PhabricatorHandleQuery()) 64 - ->setViewer($this->requireViewer()) 65 - ->withPHIDs($all_phids) 66 - ->execute(); 67 - } else { 68 - $handles = array(); 69 - } 70 - 71 - $repository_handles = array_select_keys($handles, $repository_phids); 72 - $pusher_handles = array_select_keys($handles, $pusher_phids); 73 - 74 58 $form 75 - ->appendChild( 59 + ->appendControl( 76 60 id(new AphrontFormTokenizerControl()) 77 61 ->setDatasource(new DiffusionRepositoryDatasource()) 78 62 ->setName('repositories') 79 63 ->setLabel(pht('Repositories')) 80 - ->setValue($repository_handles)) 81 - ->appendChild( 64 + ->setValue($repository_phids)) 65 + ->appendControl( 82 66 id(new AphrontFormTokenizerControl()) 83 67 ->setDatasource(new PhabricatorPeopleDatasource()) 84 68 ->setName('pushers') 85 69 ->setLabel(pht('Pushers')) 86 - ->setValue($pusher_handles)); 70 + ->setValue($pusher_phids)); 87 71 } 88 72 89 73 protected function getURI($path) {
+2 -11
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
··· 84 84 $name = $saved_query->getParameter('name'); 85 85 $any_project_phids = $saved_query->getParameter('anyProjectPHIDs', array()); 86 86 87 - if ($any_project_phids) { 88 - $any_project_handles = id(new PhabricatorHandleQuery()) 89 - ->setViewer($this->requireViewer()) 90 - ->withPHIDs($any_project_phids) 91 - ->execute(); 92 - } else { 93 - $any_project_handles = array(); 94 - } 95 - 96 87 $form 97 88 ->appendChild( 98 89 id(new AphrontFormTextControl()) ··· 104 95 ->setName('name') 105 96 ->setLabel(pht('Name Contains')) 106 97 ->setValue($name)) 107 - ->appendChild( 98 + ->appendControl( 108 99 id(new AphrontFormTokenizerControl()) 109 100 ->setDatasource(new PhabricatorProjectDatasource()) 110 101 ->setName('anyProjects') 111 102 ->setLabel(pht('In Any Project')) 112 - ->setValue($any_project_handles)) 103 + ->setValue($any_project_phids)) 113 104 ->appendChild( 114 105 id(new AphrontFormSelectControl()) 115 106 ->setName('status')
+8 -24
src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
··· 66 66 $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); 67 67 $project_phids = $saved->getParameter('projectPHIDs', array()); 68 68 69 - $all_phids = array_merge( 70 - $author_phids, 71 - $owner_phids, 72 - $subscriber_phids, 73 - $project_phids); 74 - 75 - $all_handles = id(new PhabricatorHandleQuery()) 76 - ->setViewer($this->requireViewer()) 77 - ->withPHIDs($all_phids) 78 - ->execute(); 79 - 80 - $author_handles = array_select_keys($all_handles, $author_phids); 81 - $owner_handles = array_select_keys($all_handles, $owner_phids); 82 - $subscriber_handles = array_select_keys($all_handles, $subscriber_phids); 83 - $project_handles = array_select_keys($all_handles, $project_phids); 84 - 85 69 $with_unowned = $saved->getParameter('withUnowned', array()); 86 70 87 71 $status_values = $saved->getParameter('statuses', array()); ··· 132 116 ->setValue($saved->getParameter('query'))) 133 117 ->appendChild($status_control) 134 118 ->appendChild($types_control) 135 - ->appendChild( 119 + ->appendControl( 136 120 id(new AphrontFormTokenizerControl()) 137 121 ->setName('authorPHIDs') 138 122 ->setLabel('Authors') 139 123 ->setDatasource(new PhabricatorPeopleDatasource()) 140 - ->setValue($author_handles)) 141 - ->appendChild( 124 + ->setValue($author_phids)) 125 + ->appendControl( 142 126 id(new AphrontFormTokenizerControl()) 143 127 ->setName('ownerPHIDs') 144 128 ->setLabel('Owners') 145 129 ->setDatasource(new PhabricatorTypeaheadOwnerDatasource()) 146 - ->setValue($owner_handles)) 130 + ->setValue($owner_phids)) 147 131 ->appendChild( 148 132 id(new AphrontFormCheckboxControl()) 149 133 ->addCheckbox( ··· 151 135 1, 152 136 pht('Show only unowned documents.'), 153 137 $with_unowned)) 154 - ->appendChild( 138 + ->appendControl( 155 139 id(new AphrontFormTokenizerControl()) 156 140 ->setName('subscriberPHIDs') 157 141 ->setLabel('Subscribers') 158 142 ->setDatasource(new PhabricatorPeopleDatasource()) 159 - ->setValue($subscriber_handles)) 160 - ->appendChild( 143 + ->setValue($subscriber_phids)) 144 + ->appendControl( 161 145 id(new AphrontFormTokenizerControl()) 162 146 ->setName('projectPHIDs') 163 147 ->setLabel('In Any Project') 164 148 ->setDatasource(new PhabricatorProjectDatasource()) 165 - ->setValue($project_handles)); 149 + ->setValue($project_phids)); 166 150 } 167 151 168 152 protected function getURI($path) {
+2 -8
src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
··· 145 145 pht('Resolve issues and build consensus through '. 146 146 'protracted deliberation.')); 147 147 148 - if ($v_projects) { 149 - $project_handles = $this->loadViewerHandles($v_projects); 150 - } else { 151 - $project_handles = array(); 152 - } 153 - 154 148 $form = id(new AphrontFormView()) 155 149 ->setUser($user) 156 150 ->appendChild($instructions) ··· 167 161 ->setLabel(pht('Description')) 168 162 ->setName('description') 169 163 ->setValue($v_description)) 170 - ->appendChild( 164 + ->appendControl( 171 165 id(new AphrontFormTokenizerControl()) 172 166 ->setLabel(pht('Projects')) 173 167 ->setName('projects') 174 - ->setValue($project_handles) 168 + ->setValue($v_projects) 175 169 ->setDatasource(new PhabricatorProjectDatasource())); 176 170 177 171 if ($is_new) {
+3 -7
src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
··· 47 47 public function buildSearchForm( 48 48 AphrontFormView $form, 49 49 PhabricatorSavedQuery $saved_query) { 50 - $phids = $saved_query->getParameter('authorPHIDs', array()); 51 - $author_handles = id(new PhabricatorHandleQuery()) 52 - ->setViewer($this->requireViewer()) 53 - ->withPHIDs($phids) 54 - ->execute(); 50 + $author_phids = $saved_query->getParameter('authorPHIDs', array()); 55 51 56 52 $voted = $saved_query->getParameter('voted', false); 57 53 $statuses = $saved_query->getParameter('statuses', array()); 58 54 59 55 $form 60 - ->appendChild( 56 + ->appendControl( 61 57 id(new AphrontFormTokenizerControl()) 62 58 ->setDatasource(new PhabricatorPeopleDatasource()) 63 59 ->setName('authors') 64 60 ->setLabel(pht('Authors')) 65 - ->setValue($author_handles)) 61 + ->setValue($author_phids)) 66 62 ->appendChild( 67 63 id(new AphrontFormCheckboxControl()) 68 64 ->addCheckbox(
+4 -8
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
··· 9 9 10 10 public function renderEditControl(array $handles) { 11 11 $value = $this->getFieldValue(); 12 - if ($value) { 13 - $control_value = array_select_keys($handles, $value); 14 - } else { 15 - $control_value = array(); 16 - } 17 12 18 13 $control = id(new AphrontFormTokenizerControl()) 14 + ->setUser($this->getViewer()) 19 15 ->setLabel($this->getFieldName()) 20 16 ->setName($this->getFieldKey()) 21 17 ->setDatasource(new PhabricatorPeopleDatasource()) 22 18 ->setCaption($this->getCaption()) 23 - ->setValue($control_value); 19 + ->setValue(nonempty($value, array())); 24 20 25 21 $limit = $this->getFieldConfigValue('limit'); 26 22 if ($limit) { ··· 40 36 ->setLabel($this->getFieldName()) 41 37 ->setName($this->getFieldKey()) 42 38 ->setDatasource(new PhabricatorPeopleDatasource()) 43 - ->setValue($handles); 39 + ->setValue(nonempty($value, array())); 44 40 45 - $form->appendChild($control); 41 + $form->appendControl($control); 46 42 } 47 43 48 44 public function getHeraldFieldValueType($condition) {
+11
src/view/form/AphrontFormView.php
··· 13 13 private $sigils = array(); 14 14 private $metadata; 15 15 private $controls = array(); 16 + private $fullWidth = false; 16 17 17 18 public function setMetadata($metadata) { 18 19 $this->metadata = $metadata; ··· 63 64 return $this; 64 65 } 65 66 67 + public function setFullWidth($full_width) { 68 + $this->fullWidth = $full_width; 69 + return $this; 70 + } 71 + 72 + public function getFullWidth() { 73 + return $this->fullWidth; 74 + } 75 + 66 76 public function appendInstructions($text) { 67 77 return $this->appendChild( 68 78 phutil_tag( ··· 83 93 84 94 public function buildLayoutView() { 85 95 return id(new PHUIFormLayoutView()) 96 + ->setFullWidth($this->getFullWidth()) 86 97 ->appendChild($this->renderDataInputs()) 87 98 ->appendChild($this->renderChildren()); 88 99 }