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
This commit is contained in:
		| @@ -7,7 +7,7 @@ | |||||||
|  */ |  */ | ||||||
| return array( | return array( | ||||||
|   'names' => array( |   'names' => array( | ||||||
|     'core.pkg.css' => '20d3b672', |     'core.pkg.css' => 'ad650d52', | ||||||
|     'core.pkg.js' => '0c88e7f6', |     'core.pkg.js' => '0c88e7f6', | ||||||
|     'darkconsole.pkg.js' => '8ab24e01', |     'darkconsole.pkg.js' => '8ab24e01', | ||||||
|     'differential.pkg.css' => '3500921f', |     'differential.pkg.css' => '3500921f', | ||||||
| @@ -20,7 +20,7 @@ return array( | |||||||
|     'rsrc/css/aphront/dark-console.css' => '6378ef3d', |     'rsrc/css/aphront/dark-console.css' => '6378ef3d', | ||||||
|     'rsrc/css/aphront/dialog-view.css' => 'd2e76b88', |     'rsrc/css/aphront/dialog-view.css' => 'd2e76b88', | ||||||
|     'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', |     'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', | ||||||
|     'rsrc/css/aphront/list-filter-view.css' => '2ae43867', |     'rsrc/css/aphront/list-filter-view.css' => '18b7e144', | ||||||
|     'rsrc/css/aphront/multi-column.css' => 'fd18389d', |     'rsrc/css/aphront/multi-column.css' => 'fd18389d', | ||||||
|     'rsrc/css/aphront/notification.css' => '9c279160', |     'rsrc/css/aphront/notification.css' => '9c279160', | ||||||
|     'rsrc/css/aphront/pager-view.css' => '2e3539af', |     'rsrc/css/aphront/pager-view.css' => '2e3539af', | ||||||
| @@ -34,7 +34,7 @@ return array( | |||||||
|     'rsrc/css/aphront/typeahead.css' => '0e403212', |     'rsrc/css/aphront/typeahead.css' => '0e403212', | ||||||
|     'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af', |     'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af', | ||||||
|     'rsrc/css/application/auth/auth.css' => '1e655982', |     'rsrc/css/application/auth/auth.css' => '1e655982', | ||||||
|     'rsrc/css/application/base/main-menu-view.css' => 'cfa2ec0f', |     'rsrc/css/application/base/main-menu-view.css' => '361a51f9', | ||||||
|     'rsrc/css/application/base/notification-menu.css' => '6aa0a74b', |     'rsrc/css/application/base/notification-menu.css' => '6aa0a74b', | ||||||
|     'rsrc/css/application/base/phabricator-application-launch-view.css' => '16ca323f', |     'rsrc/css/application/base/phabricator-application-launch-view.css' => '16ca323f', | ||||||
|     'rsrc/css/application/base/standard-page-view.css' => 'd2a6518d', |     'rsrc/css/application/base/standard-page-view.css' => 'd2a6518d', | ||||||
| @@ -45,7 +45,7 @@ return array( | |||||||
|     'rsrc/css/application/config/setup-issue.css' => '22270af2', |     'rsrc/css/application/config/setup-issue.css' => '22270af2', | ||||||
|     'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', |     'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2', | ||||||
|     'rsrc/css/application/conpherence/durable-column.css' => 'caa12d4a', |     'rsrc/css/application/conpherence/durable-column.css' => 'caa12d4a', | ||||||
|     'rsrc/css/application/conpherence/menu.css' => 'beef0920', |     'rsrc/css/application/conpherence/menu.css' => '7c900089', | ||||||
|     'rsrc/css/application/conpherence/message-pane.css' => '44154798', |     'rsrc/css/application/conpherence/message-pane.css' => '44154798', | ||||||
|     'rsrc/css/application/conpherence/notification.css' => '04a6e10a', |     'rsrc/css/application/conpherence/notification.css' => '04a6e10a', | ||||||
|     'rsrc/css/application/conpherence/update.css' => '1099a660', |     'rsrc/css/application/conpherence/update.css' => '1099a660', | ||||||
| @@ -355,7 +355,7 @@ return array( | |||||||
|     'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', |     'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', | ||||||
|     'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'bb928342', |     'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'bb928342', | ||||||
|     'rsrc/js/application/conpherence/behavior-durable-column.js' => 'a0216452', |     'rsrc/js/application/conpherence/behavior-durable-column.js' => 'a0216452', | ||||||
|     'rsrc/js/application/conpherence/behavior-menu.js' => 'de5579b4', |     'rsrc/js/application/conpherence/behavior-menu.js' => 'cda6de80', | ||||||
|     'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', |     'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', | ||||||
|     'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', |     'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', | ||||||
|     'rsrc/js/application/conpherence/behavior-widget-pane.js' => '1ec93bcf', |     'rsrc/js/application/conpherence/behavior-widget-pane.js' => '1ec93bcf', | ||||||
| @@ -501,7 +501,7 @@ return array( | |||||||
|     'aphront-bars' => '231ac33c', |     'aphront-bars' => '231ac33c', | ||||||
|     'aphront-dark-console-css' => '6378ef3d', |     'aphront-dark-console-css' => '6378ef3d', | ||||||
|     'aphront-dialog-view-css' => 'd2e76b88', |     'aphront-dialog-view-css' => 'd2e76b88', | ||||||
|     'aphront-list-filter-view-css' => '2ae43867', |     'aphront-list-filter-view-css' => '18b7e144', | ||||||
|     'aphront-multi-column-view-css' => 'fd18389d', |     'aphront-multi-column-view-css' => 'fd18389d', | ||||||
|     'aphront-pager-view-css' => '2e3539af', |     'aphront-pager-view-css' => '2e3539af', | ||||||
|     'aphront-panel-view-css' => '8427b78d', |     'aphront-panel-view-css' => '8427b78d', | ||||||
| @@ -515,7 +515,7 @@ return array( | |||||||
|     'config-options-css' => '7fedf08b', |     'config-options-css' => '7fedf08b', | ||||||
|     'config-welcome-css' => '6abd79be', |     'config-welcome-css' => '6abd79be', | ||||||
|     'conpherence-durable-column-view' => 'caa12d4a', |     'conpherence-durable-column-view' => 'caa12d4a', | ||||||
|     'conpherence-menu-css' => 'beef0920', |     'conpherence-menu-css' => '7c900089', | ||||||
|     'conpherence-message-pane-css' => '44154798', |     'conpherence-message-pane-css' => '44154798', | ||||||
|     'conpherence-notification-css' => '04a6e10a', |     'conpherence-notification-css' => '04a6e10a', | ||||||
|     'conpherence-thread-manager' => 'bb928342', |     'conpherence-thread-manager' => 'bb928342', | ||||||
| @@ -557,7 +557,7 @@ return array( | |||||||
|     'javelin-behavior-boards-dropdown' => '0ec56e1d', |     'javelin-behavior-boards-dropdown' => '0ec56e1d', | ||||||
|     'javelin-behavior-choose-control' => '6153c708', |     'javelin-behavior-choose-control' => '6153c708', | ||||||
|     'javelin-behavior-config-reorder-fields' => '14a827de', |     'javelin-behavior-config-reorder-fields' => '14a827de', | ||||||
|     'javelin-behavior-conpherence-menu' => 'de5579b4', |     'javelin-behavior-conpherence-menu' => 'cda6de80', | ||||||
|     'javelin-behavior-conpherence-pontificate' => '21ba5861', |     'javelin-behavior-conpherence-pontificate' => '21ba5861', | ||||||
|     'javelin-behavior-conpherence-widget-pane' => '1ec93bcf', |     'javelin-behavior-conpherence-widget-pane' => '1ec93bcf', | ||||||
|     'javelin-behavior-countdown-timer' => 'e4cc26b3', |     'javelin-behavior-countdown-timer' => 'e4cc26b3', | ||||||
| @@ -729,7 +729,7 @@ return array( | |||||||
|     'phabricator-hovercard-view-css' => '893f4783', |     'phabricator-hovercard-view-css' => '893f4783', | ||||||
|     'phabricator-keyboard-shortcut' => '1ae869f2', |     'phabricator-keyboard-shortcut' => '1ae869f2', | ||||||
|     'phabricator-keyboard-shortcut-manager' => 'c1700f6f', |     'phabricator-keyboard-shortcut-manager' => 'c1700f6f', | ||||||
|     'phabricator-main-menu-view' => 'cfa2ec0f', |     'phabricator-main-menu-view' => '361a51f9', | ||||||
|     'phabricator-nav-view-css' => '7aeaf435', |     'phabricator-nav-view-css' => '7aeaf435', | ||||||
|     'phabricator-notification' => '0c6946e7', |     'phabricator-notification' => '0c6946e7', | ||||||
|     'phabricator-notification-css' => '9c279160', |     'phabricator-notification-css' => '9c279160', | ||||||
| @@ -1755,6 +1755,18 @@ return array( | |||||||
|       'javelin-stratcom', |       'javelin-stratcom', | ||||||
|       'phabricator-phtize', |       'phabricator-phtize', | ||||||
|     ), |     ), | ||||||
|  |     'cda6de80' => array( | ||||||
|  |       'javelin-behavior', | ||||||
|  |       'javelin-dom', | ||||||
|  |       'javelin-util', | ||||||
|  |       'javelin-stratcom', | ||||||
|  |       'javelin-workflow', | ||||||
|  |       'javelin-behavior-device', | ||||||
|  |       'javelin-history', | ||||||
|  |       'javelin-vector', | ||||||
|  |       'phabricator-shaped-request', | ||||||
|  |       'conpherence-thread-manager', | ||||||
|  |     ), | ||||||
|     'd19198c8' => array( |     'd19198c8' => array( | ||||||
|       'javelin-install', |       'javelin-install', | ||||||
|       'javelin-dom', |       'javelin-dom', | ||||||
| @@ -1807,18 +1819,6 @@ return array( | |||||||
|       'javelin-typeahead-ondemand-source', |       'javelin-typeahead-ondemand-source', | ||||||
|       'javelin-dom', |       'javelin-dom', | ||||||
|     ), |     ), | ||||||
|     'de5579b4' => array( |  | ||||||
|       'javelin-behavior', |  | ||||||
|       'javelin-dom', |  | ||||||
|       'javelin-util', |  | ||||||
|       'javelin-stratcom', |  | ||||||
|       'javelin-workflow', |  | ||||||
|       'javelin-behavior-device', |  | ||||||
|       'javelin-history', |  | ||||||
|       'javelin-vector', |  | ||||||
|       'phabricator-shaped-request', |  | ||||||
|       'conpherence-thread-manager', |  | ||||||
|     ), |  | ||||||
|     'e10f8e18' => array( |     'e10f8e18' => array( | ||||||
|       'javelin-behavior', |       'javelin-behavior', | ||||||
|       'javelin-dom', |       'javelin-dom', | ||||||
|   | |||||||
| @@ -53,25 +53,9 @@ final class ConpherenceNewController extends ConpherenceController { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     $participant_handles = array(); |  | ||||||
|     if ($participants) { |  | ||||||
|       $participant_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|         ->setViewer($user) |  | ||||||
|         ->withPHIDs($participants) |  | ||||||
|         ->execute(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $submit_uri = $this->getApplicationURI('new/'); |     $submit_uri = $this->getApplicationURI('new/'); | ||||||
|     $cancel_uri = $this->getApplicationURI(); |     $cancel_uri = $this->getApplicationURI(); | ||||||
|  |  | ||||||
|     // TODO - we can get a better cancel_uri once we get better at crazy |  | ||||||
|     // ajax jonx T2086 |  | ||||||
|     if ($participant_prefill) { |  | ||||||
|       $handle = $participant_handles[$participant_prefill]; |  | ||||||
|       $cancel_uri = $handle->getURI(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $dialog = id(new AphrontDialogView()) |     $dialog = id(new AphrontDialogView()) | ||||||
|       ->setWidth(AphrontDialogView::WIDTH_FORM) |       ->setWidth(AphrontDialogView::WIDTH_FORM) | ||||||
|       ->setErrors($errors) |       ->setErrors($errors) | ||||||
| @@ -80,13 +64,13 @@ final class ConpherenceNewController extends ConpherenceController { | |||||||
|       ->addCancelButton($cancel_uri) |       ->addCancelButton($cancel_uri) | ||||||
|       ->addSubmitButton(pht('Send Message')); |       ->addSubmitButton(pht('Send Message')); | ||||||
|  |  | ||||||
|     $form = id(new PHUIFormLayoutView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
|       ->setFullWidth(true) |       ->setFullWidth(true) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName('participants') |           ->setName('participants') | ||||||
|         ->setValue($participant_handles) |           ->setValue($participants) | ||||||
|           ->setUser($user) |           ->setUser($user) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setLabel(pht('To')) |           ->setLabel(pht('To')) | ||||||
| @@ -99,7 +83,7 @@ final class ConpherenceNewController extends ConpherenceController { | |||||||
|           ->setLabel(pht('Message')) |           ->setLabel(pht('Message')) | ||||||
|           ->setError($e_message)); |           ->setError($e_message)); | ||||||
|  |  | ||||||
|     $dialog->appendChild($form); |     $dialog->appendForm($form); | ||||||
|  |  | ||||||
|     return id(new AphrontDialogResponse())->setDialog($dialog); |     return id(new AphrontDialogResponse())->setDialog($dialog); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -225,10 +225,10 @@ final class ConpherenceUpdateController | |||||||
|     $user = $request->getUser(); |     $user = $request->getUser(); | ||||||
|     $add_person = $request->getStr('add_person'); |     $add_person = $request->getStr('add_person'); | ||||||
|  |  | ||||||
|     $form = id(new PHUIFormLayoutView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
|       ->setFullWidth(true) |       ->setFullWidth(true) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName('add_person') |           ->setName('add_person') | ||||||
|           ->setUser($user) |           ->setUser($user) | ||||||
| @@ -241,7 +241,7 @@ final class ConpherenceUpdateController | |||||||
|       ->addHiddenInput( |       ->addHiddenInput( | ||||||
|         'latest_transaction_id', |         'latest_transaction_id', | ||||||
|         $request->getInt('latest_transaction_id')) |         $request->getInt('latest_transaction_id')) | ||||||
|       ->appendChild($form); |       ->appendForm($form); | ||||||
|  |  | ||||||
|     if ($request->getExists('minimal_display')) { |     if ($request->getExists('minimal_display')) { | ||||||
|       $view->addHiddenInput('minimal_display', true); |       $view->addHiddenInput('minimal_display', true); | ||||||
|   | |||||||
| @@ -52,18 +52,15 @@ final class ConpherenceThreadSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved) { |     PhabricatorSavedQuery $saved) { | ||||||
|  |  | ||||||
|     $phids = $saved->getParameter('participantPHIDs', array()); |     $participant_phids = $saved->getParameter('participantPHIDs', array()); | ||||||
|     $participant_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('participants') |           ->setName('participants') | ||||||
|           ->setLabel(pht('Participants')) |           ->setLabel(pht('Participants')) | ||||||
|         ->setValue($participant_handles)); |           ->setValue($participant_phids)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   protected function getURI($path) { |   protected function getURI($path) { | ||||||
|   | |||||||
| @@ -40,21 +40,17 @@ final class PhabricatorCountdownSearchEngine | |||||||
|   public function buildSearchForm( |   public function buildSearchForm( | ||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |  | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|  |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $upcoming = $saved_query->getParameter('upcoming'); |     $upcoming = $saved_query->getParameter('upcoming'); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormCheckboxControl()) |         id(new AphrontFormCheckboxControl()) | ||||||
|           ->addCheckbox( |           ->addCheckbox( | ||||||
|   | |||||||
| @@ -28,7 +28,6 @@ final class DifferentialDiffCreateController extends DifferentialController { | |||||||
|     // This object is just for policy stuff |     // This object is just for policy stuff | ||||||
|     $diff_object = DifferentialDiff::initializeNewDiff($viewer); |     $diff_object = DifferentialDiff::initializeNewDiff($viewer); | ||||||
|     $repository_phid = null; |     $repository_phid = null; | ||||||
|     $repository_value = array(); |  | ||||||
|     $errors = array(); |     $errors = array(); | ||||||
|     $e_diff = null; |     $e_diff = null; | ||||||
|     $e_file = null; |     $e_file = null; | ||||||
| @@ -62,7 +61,8 @@ final class DifferentialDiffCreateController extends DifferentialController { | |||||||
|             array( |             array( | ||||||
|               'diff' => $diff, |               'diff' => $diff, | ||||||
|               'repositoryPHID' => $repository_phid, |               'repositoryPHID' => $repository_phid, | ||||||
|               'viewPolicy' => $request->getStr('viewPolicy'),)); |               'viewPolicy' => $request->getStr('viewPolicy'), | ||||||
|  |             )); | ||||||
|           $call->setUser($viewer); |           $call->setUser($viewer); | ||||||
|           $result = $call->execute(); |           $result = $call->execute(); | ||||||
|  |  | ||||||
| @@ -93,10 +93,6 @@ final class DifferentialDiffCreateController extends DifferentialController { | |||||||
|  |  | ||||||
|     $cancel_uri = $this->getApplicationURI(); |     $cancel_uri = $this->getApplicationURI(); | ||||||
|  |  | ||||||
|     if ($repository_phid) { |  | ||||||
|       $repository_value = $this->loadViewerHandles(array($repository_phid)); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $policies = id(new PhabricatorPolicyQuery()) |     $policies = id(new PhabricatorPolicyQuery()) | ||||||
|       ->setViewer($viewer) |       ->setViewer($viewer) | ||||||
|       ->setObject($diff_object) |       ->setObject($diff_object) | ||||||
| @@ -148,6 +144,12 @@ final class DifferentialDiffCreateController extends DifferentialController { | |||||||
|           ->setValue($revision_handle->renderLink())); |           ->setValue($revision_handle->renderLink())); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if ($repository_phid) { | ||||||
|  |       $repository_value = array($repository_phid); | ||||||
|  |     } else { | ||||||
|  |       $repository_value = array(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextAreaControl()) |         id(new AphrontFormTextAreaControl()) | ||||||
| @@ -161,7 +163,7 @@ final class DifferentialDiffCreateController extends DifferentialController { | |||||||
|           ->setLabel(pht('Raw Diff From File')) |           ->setLabel(pht('Raw Diff From File')) | ||||||
|           ->setName('diff-file') |           ->setName('diff-file') | ||||||
|           ->setError($e_file)) |           ->setError($e_file)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName(id(new DifferentialRepositoryField())->getFieldKey()) |           ->setName(id(new DifferentialRepositoryField())->getFieldKey()) | ||||||
|           ->setLabel(pht('Repository')) |           ->setLabel(pht('Repository')) | ||||||
|   | |||||||
| @@ -49,15 +49,12 @@ final class DifferentialProjectsField | |||||||
|     $this->setValue($request->getArr($this->getFieldKey())); |     $this->setValue($request->getArr($this->getFieldKey())); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   public function getRequiredHandlePHIDsForEdit() { |  | ||||||
|     return $this->getValue(); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   public function renderEditControl(array $handles) { |   public function renderEditControl(array $handles) { | ||||||
|     return id(new AphrontFormTokenizerControl()) |     return id(new AphrontFormTokenizerControl()) | ||||||
|  |       ->setUser($this->getViewer()) | ||||||
|       ->setName($this->getFieldKey()) |       ->setName($this->getFieldKey()) | ||||||
|       ->setDatasource(new PhabricatorProjectDatasource()) |       ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|       ->setValue($handles) |       ->setValue($this->getValue()) | ||||||
|       ->setLabel($this->getFieldName()); |       ->setLabel($this->getFieldName()); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,25 +32,18 @@ final class DifferentialRepositoryField | |||||||
|     $this->setValue(nonempty($first, null)); |     $this->setValue(nonempty($first, null)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   public function getRequiredHandlePHIDsForEdit() { |  | ||||||
|     $phids = array(); |  | ||||||
|     if ($this->getValue()) { |  | ||||||
|       $phids[] = $this->getValue(); |  | ||||||
|     } |  | ||||||
|     return $phids; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   public function renderEditControl(array $handles) { |   public function renderEditControl(array $handles) { | ||||||
|     if ($this->getValue()) { |     if ($this->getValue()) { | ||||||
|       $control_value = array_select_keys($handles, array($this->getValue())); |       $value = array($this->getValue()); | ||||||
|     } else { |     } else { | ||||||
|       $control_value = array(); |       $value = array(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     return id(new AphrontFormTokenizerControl()) |     return id(new AphrontFormTokenizerControl()) | ||||||
|  |       ->setUser($this->getViewer()) | ||||||
|       ->setName($this->getFieldKey()) |       ->setName($this->getFieldKey()) | ||||||
|       ->setDatasource(new DiffusionRepositoryDatasource()) |       ->setDatasource(new DiffusionRepositoryDatasource()) | ||||||
|       ->setValue($control_value) |       ->setValue($value) | ||||||
|       ->setError($this->getFieldError()) |       ->setError($this->getFieldError()) | ||||||
|       ->setLabel($this->getFieldName()) |       ->setLabel($this->getFieldName()) | ||||||
|       ->setLimit(1); |       ->setLimit(1); | ||||||
|   | |||||||
| @@ -62,19 +62,17 @@ final class DifferentialReviewersField | |||||||
|     $this->setValue($new_status); |     $this->setValue($new_status); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   public function getRequiredHandlePHIDsForEdit() { |   public function renderEditControl(array $handles) { | ||||||
|     $phids = array(); |     $phids = array(); | ||||||
|     if ($this->getValue()) { |     if ($this->getValue()) { | ||||||
|       $phids = mpull($this->getValue(), 'getReviewerPHID'); |       $phids = mpull($this->getValue(), 'getReviewerPHID'); | ||||||
|     } |     } | ||||||
|     return $phids; |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   public function renderEditControl(array $handles) { |  | ||||||
|     return id(new AphrontFormTokenizerControl()) |     return id(new AphrontFormTokenizerControl()) | ||||||
|  |       ->setUser($this->getViewer()) | ||||||
|       ->setName($this->getFieldKey()) |       ->setName($this->getFieldKey()) | ||||||
|       ->setDatasource(new PhabricatorProjectOrUserDatasource()) |       ->setDatasource(new PhabricatorProjectOrUserDatasource()) | ||||||
|       ->setValue($handles) |       ->setValue($phids) | ||||||
|       ->setError($this->getFieldError()) |       ->setError($this->getFieldError()) | ||||||
|       ->setLabel($this->getFieldName()); |       ->setLabel($this->getFieldName()); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -37,15 +37,12 @@ final class DifferentialSubscribersField | |||||||
|     $this->setValue($request->getArr($this->getFieldKey())); |     $this->setValue($request->getArr($this->getFieldKey())); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   public function getRequiredHandlePHIDsForEdit() { |  | ||||||
|     return $this->getValue(); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   public function renderEditControl(array $handles) { |   public function renderEditControl(array $handles) { | ||||||
|     return id(new AphrontFormTokenizerControl()) |     return id(new AphrontFormTokenizerControl()) | ||||||
|  |       ->setUser($this->getViewer()) | ||||||
|       ->setName($this->getFieldKey()) |       ->setName($this->getFieldKey()) | ||||||
|       ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) |       ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) | ||||||
|       ->setValue($handles) |       ->setValue($this->getValue()) | ||||||
|       ->setError($this->getFieldError()) |       ->setError($this->getFieldError()) | ||||||
|       ->setLabel($this->getFieldName()); |       ->setLabel($this->getFieldName()); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -124,51 +124,37 @@ final class DifferentialRevisionSearchEngine | |||||||
|     $repository_phids = $saved->getParameter('repositoryPHIDs', array()); |     $repository_phids = $saved->getParameter('repositoryPHIDs', array()); | ||||||
|     $only_draft = $saved->getParameter('draft', false); |     $only_draft = $saved->getParameter('draft', false); | ||||||
|  |  | ||||||
|     $all_phids = array_mergev( |  | ||||||
|       array( |  | ||||||
|         $responsible_phids, |  | ||||||
|         $author_phids, |  | ||||||
|         $reviewer_phids, |  | ||||||
|         $subscriber_phids, |  | ||||||
|         $repository_phids, |  | ||||||
|       )); |  | ||||||
|  |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($all_phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Responsible Users')) |           ->setLabel(pht('Responsible Users')) | ||||||
|           ->setName('responsibles') |           ->setName('responsibles') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $responsible_phids))) |           ->setValue($responsible_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $author_phids))) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Reviewers')) |           ->setLabel(pht('Reviewers')) | ||||||
|           ->setName('reviewers') |           ->setName('reviewers') | ||||||
|           ->setDatasource(new PhabricatorProjectOrUserDatasource()) |           ->setDatasource(new PhabricatorProjectOrUserDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $reviewer_phids))) |           ->setValue($reviewer_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Subscribers')) |           ->setLabel(pht('Subscribers')) | ||||||
|           ->setName('subscribers') |           ->setName('subscribers') | ||||||
|           ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) |           ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $subscriber_phids))) |           ->setValue($subscriber_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Repositories')) |           ->setLabel(pht('Repositories')) | ||||||
|           ->setName('repositories') |           ->setName('repositories') | ||||||
|           ->setDatasource(new DiffusionRepositoryDatasource()) |           ->setDatasource(new DiffusionRepositoryDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $repository_phids))) |           ->setValue($repository_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setLabel(pht('Status')) |           ->setLabel(pht('Status')) | ||||||
|   | |||||||
| @@ -80,7 +80,7 @@ final class DifferentialAddCommentView extends AphrontView { | |||||||
|           ->setValue($action) |           ->setValue($action) | ||||||
|           ->setID('comment-action') |           ->setID('comment-action') | ||||||
|           ->setOptions($this->actions)) |           ->setOptions($this->actions)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel($enable_reviewers ? $add_reviewers_labels[$action] : |           ->setLabel($enable_reviewers ? $add_reviewers_labels[$action] : | ||||||
|             $add_reviewers_labels['add_reviewers']) |             $add_reviewers_labels['add_reviewers']) | ||||||
| @@ -89,7 +89,7 @@ final class DifferentialAddCommentView extends AphrontView { | |||||||
|           ->setControlStyle($enable_reviewers ? null : 'display: none') |           ->setControlStyle($enable_reviewers ? null : 'display: none') | ||||||
|           ->setID('add-reviewers-tokenizer') |           ->setID('add-reviewers-tokenizer') | ||||||
|           ->setDisableBehavior(true)) |           ->setDisableBehavior(true)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Add Subscribers')) |           ->setLabel(pht('Add Subscribers')) | ||||||
|           ->setName('ccs') |           ->setName('ccs') | ||||||
|   | |||||||
| @@ -687,7 +687,7 @@ final class DiffusionCommitController extends DiffusionController { | |||||||
|           ->setName('action') |           ->setName('action') | ||||||
|           ->setID('audit-action') |           ->setID('audit-action') | ||||||
|           ->setOptions($actions)) |           ->setOptions($actions)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Add Auditors')) |           ->setLabel(pht('Add Auditors')) | ||||||
|           ->setName('auditors') |           ->setName('auditors') | ||||||
| @@ -695,7 +695,7 @@ final class DiffusionCommitController extends DiffusionController { | |||||||
|           ->setControlStyle('display: none') |           ->setControlStyle('display: none') | ||||||
|           ->setID('add-auditors-tokenizer') |           ->setID('add-auditors-tokenizer') | ||||||
|           ->setDisableBehavior(true)) |           ->setDisableBehavior(true)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Add CCs')) |           ->setLabel(pht('Add CCs')) | ||||||
|           ->setName('ccs') |           ->setName('ccs') | ||||||
|   | |||||||
| @@ -20,8 +20,6 @@ final class DiffusionCommitEditController extends DiffusionController { | |||||||
|     $current_proj_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( |     $current_proj_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | ||||||
|       $commit_phid, |       $commit_phid, | ||||||
|       $edge_type); |       $edge_type); | ||||||
|     $handles = $this->loadViewerHandles($current_proj_phids); |  | ||||||
|     $proj_t_values = $handles; |  | ||||||
|  |  | ||||||
|     if ($request->isFormPost()) { |     if ($request->isFormPost()) { | ||||||
|       $xactions = array(); |       $xactions = array(); | ||||||
| @@ -43,11 +41,11 @@ final class DiffusionCommitEditController extends DiffusionController { | |||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
|       ->setAction($request->getRequestURI()->getPath()) |       ->setAction($request->getRequestURI()->getPath()) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|         ->setLabel(pht('Projects')) |         ->setLabel(pht('Projects')) | ||||||
|         ->setName('projects') |         ->setName('projects') | ||||||
|         ->setValue($proj_t_values) |         ->setValue($current_proj_phids) | ||||||
|         ->setID($tokenizer_id) |         ->setID($tokenizer_id) | ||||||
|         ->setCaption( |         ->setCaption( | ||||||
|           javelin_tag( |           javelin_tag( | ||||||
|   | |||||||
| @@ -24,7 +24,6 @@ final class DiffusionLintController extends DiffusionController { | |||||||
|       } else { |       } else { | ||||||
|         $owners = array(head($request->getArr('owner'))); |         $owners = array(head($request->getArr('owner'))); | ||||||
|       } |       } | ||||||
|       $owner_handles = $this->loadViewerHandles($owners); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $codes = $this->loadLintCodes($owners); |     $codes = $this->loadLintCodes($owners); | ||||||
| @@ -108,13 +107,13 @@ final class DiffusionLintController extends DiffusionController { | |||||||
|       $form = id(new AphrontFormView()) |       $form = id(new AphrontFormView()) | ||||||
|         ->setUser($user) |         ->setUser($user) | ||||||
|         ->setMethod('GET') |         ->setMethod('GET') | ||||||
|         ->appendChild( |         ->appendControl( | ||||||
|           id(new AphrontFormTokenizerControl()) |           id(new AphrontFormTokenizerControl()) | ||||||
|             ->setDatasource(new PhabricatorPeopleDatasource()) |             ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|             ->setLimit(1) |             ->setLimit(1) | ||||||
|             ->setName('owner') |             ->setName('owner') | ||||||
|             ->setLabel(pht('Owner')) |             ->setLabel(pht('Owner')) | ||||||
|             ->setValue($owner_handles)) |             ->setValue($owners)) | ||||||
|         ->appendChild( |         ->appendChild( | ||||||
|           id(new AphrontFormSubmitControl()) |           id(new AphrontFormSubmitControl()) | ||||||
|             ->setValue('Filter')); |             ->setValue('Filter')); | ||||||
|   | |||||||
| @@ -92,7 +92,6 @@ final class DiffusionRepositoryEditBasicController | |||||||
|     $crumbs->addTextCrumb(pht('Edit Basics')); |     $crumbs->addTextCrumb(pht('Edit Basics')); | ||||||
|  |  | ||||||
|     $title = pht('Edit %s', $repository->getName()); |     $title = pht('Edit %s', $repository->getName()); | ||||||
|     $project_handles = $this->loadViewerHandles($repository->getProjectPHIDs()); |  | ||||||
|  |  | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
| @@ -123,12 +122,12 @@ final class DiffusionRepositoryEditBasicController | |||||||
|           ->setName('description') |           ->setName('description') | ||||||
|           ->setLabel(pht('Description')) |           ->setLabel(pht('Description')) | ||||||
|           ->setValue($v_desc)) |           ->setValue($v_desc)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setName('projectPHIDs') |           ->setName('projectPHIDs') | ||||||
|           ->setLabel(pht('Projects')) |           ->setLabel(pht('Projects')) | ||||||
|           ->setValue($project_handles)) |           ->setValue($repository->getProjectPHIDs())) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSubmitControl()) |         id(new AphrontFormSubmitControl()) | ||||||
|           ->setValue(pht('Save')) |           ->setValue(pht('Save')) | ||||||
|   | |||||||
| @@ -68,30 +68,21 @@ final class PhabricatorFeedSearchEngine | |||||||
|  |  | ||||||
|     $user_phids = $saved_query->getParameter('userPHIDs', array()); |     $user_phids = $saved_query->getParameter('userPHIDs', array()); | ||||||
|     $proj_phids = $saved_query->getParameter('projectPHIDs', array()); |     $proj_phids = $saved_query->getParameter('projectPHIDs', array()); | ||||||
|  |  | ||||||
|     $phids = array_merge($user_phids, $proj_phids); |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|     $user_handles = array_select_keys($handles, $user_phids); |  | ||||||
|     $proj_handles = array_select_keys($handles, $proj_phids); |  | ||||||
|  |  | ||||||
|     $viewer_projects = $saved_query->getParameter('viewerProjects'); |     $viewer_projects = $saved_query->getParameter('viewerProjects'); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('users') |           ->setName('users') | ||||||
|           ->setLabel(pht('Include Users')) |           ->setLabel(pht('Include Users')) | ||||||
|           ->setValue($user_handles)) |           ->setValue($user_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setName('projectPHIDs') |           ->setName('projectPHIDs') | ||||||
|           ->setLabel(pht('Include Projects')) |           ->setLabel(pht('Include Projects')) | ||||||
|           ->setValue($proj_handles)) |           ->setValue($proj_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormCheckboxControl()) |         id(new AphrontFormCheckboxControl()) | ||||||
|           ->addCheckbox( |           ->addCheckbox( | ||||||
|   | |||||||
| @@ -54,21 +54,16 @@ final class PhabricatorFileSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|  |  | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $explicit = $saved_query->getParameter('explicit'); |     $explicit = $saved_query->getParameter('explicit'); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormCheckboxControl()) |         id(new AphrontFormCheckboxControl()) | ||||||
|           ->addCheckbox( |           ->addCheckbox( | ||||||
|   | |||||||
| @@ -138,12 +138,6 @@ final class FundInitiativeEditController | |||||||
|       ->setObject($initiative) |       ->setObject($initiative) | ||||||
|       ->execute(); |       ->execute(); | ||||||
|  |  | ||||||
|     if ($v_projects) { |  | ||||||
|       $project_handles = $this->loadViewerHandles($v_projects); |  | ||||||
|     } else { |  | ||||||
|       $project_handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $merchants = id(new PhortuneMerchantQuery()) |     $merchants = id(new PhortuneMerchantQuery()) | ||||||
|       ->setViewer($viewer) |       ->setViewer($viewer) | ||||||
|       ->requireCapabilities( |       ->requireCapabilities( | ||||||
| @@ -210,11 +204,11 @@ final class FundInitiativeEditController | |||||||
|           ->setName('risks') |           ->setName('risks') | ||||||
|           ->setLabel(pht('Risks/Challenges')) |           ->setLabel(pht('Risks/Challenges')) | ||||||
|           ->setValue($v_risk)) |           ->setValue($v_risk)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Projects')) |           ->setLabel(pht('Projects')) | ||||||
|           ->setName('projects') |           ->setName('projects') | ||||||
|           ->setValue($project_handles) |           ->setValue($v_projects) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource())) |           ->setDatasource(new PhabricatorProjectDatasource())) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormPolicyControl()) |         id(new AphrontFormPolicyControl()) | ||||||
|   | |||||||
| @@ -56,26 +56,15 @@ final class FundBackerSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved) { |     PhabricatorSavedQuery $saved) { | ||||||
|  |  | ||||||
|  |  | ||||||
|     $backer_phids = $saved->getParameter('backerPHIDs', array()); |     $backer_phids = $saved->getParameter('backerPHIDs', array()); | ||||||
|  |  | ||||||
|     $all_phids = array_mergev( |  | ||||||
|       array( |  | ||||||
|         $backer_phids, |  | ||||||
|       )); |  | ||||||
|  |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($all_phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Backers')) |           ->setLabel(pht('Backers')) | ||||||
|           ->setName('backers') |           ->setName('backers') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $backer_phids))); |           ->setValue($backer_phids)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   protected function getURI($path) { |   protected function getURI($path) { | ||||||
|   | |||||||
| @@ -51,16 +51,6 @@ final class FundInitiativeSearchEngine | |||||||
|  |  | ||||||
|     $owner_phids = $saved->getParameter('ownerPHIDs', array()); |     $owner_phids = $saved->getParameter('ownerPHIDs', array()); | ||||||
|  |  | ||||||
|     $all_phids = array_mergev( |  | ||||||
|       array( |  | ||||||
|         $owner_phids, |  | ||||||
|       )); |  | ||||||
|  |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($all_phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $status_map = FundInitiative::getStatusNameMap(); |     $status_map = FundInitiative::getStatusNameMap(); | ||||||
|     $status_control = id(new AphrontFormCheckboxControl()) |     $status_control = id(new AphrontFormCheckboxControl()) | ||||||
|       ->setLabel(pht('Statuses')); |       ->setLabel(pht('Statuses')); | ||||||
| @@ -73,12 +63,12 @@ final class FundInitiativeSearchEngine | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Owners')) |           ->setLabel(pht('Owners')) | ||||||
|           ->setName('owners') |           ->setName('owners') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue(array_select_keys($handles, $owner_phids))) |           ->setValue($owner_phids)) | ||||||
|       ->appendChild($status_control); |       ->appendChild($status_control); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -68,12 +68,7 @@ final class HarbormasterStepEditController extends HarbormasterController { | |||||||
|     $e_description = true; |     $e_description = true; | ||||||
|     $v_description = $step->getDescription(); |     $v_description = $step->getDescription(); | ||||||
|     $e_depends_on = true; |     $e_depends_on = true; | ||||||
|     $raw_depends_on = $step->getDetail('dependsOn', array()); |     $v_depends_on = $step->getDetail('dependsOn', array()); | ||||||
|  |  | ||||||
|     $v_depends_on = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($viewer) |  | ||||||
|       ->withPHIDs($raw_depends_on) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $errors = array(); |     $errors = array(); | ||||||
|     $validation_exception = null; |     $validation_exception = null; | ||||||
| @@ -138,7 +133,7 @@ final class HarbormasterStepEditController extends HarbormasterController { | |||||||
|           ->setValue($v_name)); |           ->setValue($v_name)); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(id(new HarbormasterBuildDependencyDatasource()) |           ->setDatasource(id(new HarbormasterBuildDependencyDatasource()) | ||||||
|             ->setParameters(array( |             ->setParameters(array( | ||||||
|   | |||||||
| @@ -58,22 +58,17 @@ final class HeraldRuleSearchEngine extends PhabricatorApplicationSearchEngine { | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|  |  | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $content_type = $saved_query->getParameter('contentType'); |     $content_type = $saved_query->getParameter('contentType'); | ||||||
|     $rule_type = $saved_query->getParameter('ruleType'); |     $rule_type = $saved_query->getParameter('ruleType'); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setName('contentType') |           ->setName('contentType') | ||||||
|   | |||||||
| @@ -117,15 +117,14 @@ final class LegalpadDocumentSignatureAddController extends LegalpadController { | |||||||
|       ->setUser($viewer); |       ->setUser($viewer); | ||||||
|  |  | ||||||
|     if ($is_individual) { |     if ($is_individual) { | ||||||
|       $user_handles = $this->loadViewerHandles($v_users); |  | ||||||
|       $form |       $form | ||||||
|         ->appendChild( |         ->appendControl( | ||||||
|           id(new AphrontFormTokenizerControl()) |           id(new AphrontFormTokenizerControl()) | ||||||
|             ->setLabel(pht('Exempt User')) |             ->setLabel(pht('Exempt User')) | ||||||
|             ->setName('users') |             ->setName('users') | ||||||
|             ->setLimit(1) |             ->setLimit(1) | ||||||
|             ->setDatasource(new PhabricatorPeopleDatasource()) |             ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|             ->setValue($user_handles) |             ->setValue($v_users) | ||||||
|             ->setError($e_user)); |             ->setError($e_user)); | ||||||
|     } else { |     } else { | ||||||
|       $form |       $form | ||||||
|   | |||||||
| @@ -73,11 +73,6 @@ final class LegalpadDocumentSearchEngine | |||||||
|     $creator_phids = $saved_query->getParameter('creatorPHIDs', array()); |     $creator_phids = $saved_query->getParameter('creatorPHIDs', array()); | ||||||
|     $contributor_phids = $saved_query->getParameter( |     $contributor_phids = $saved_query->getParameter( | ||||||
|       'contributorPHIDs', array()); |       'contributorPHIDs', array()); | ||||||
|     $phids = array_merge($creator_phids, $contributor_phids); |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $viewer_signature = $saved_query->getParameter('withViewerSignature'); |     $viewer_signature = $saved_query->getParameter('withViewerSignature'); | ||||||
|     if (!$this->requireViewer()->getPHID()) { |     if (!$this->requireViewer()->getPHID()) { | ||||||
| @@ -93,18 +88,18 @@ final class LegalpadDocumentSearchEngine | |||||||
|             pht('Show only documents I have signed.'), |             pht('Show only documents I have signed.'), | ||||||
|             $viewer_signature) |             $viewer_signature) | ||||||
|           ->setDisabled(!$this->requireViewer()->getPHID())) |           ->setDisabled(!$this->requireViewer()->getPHID())) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('creators') |           ->setName('creators') | ||||||
|           ->setLabel(pht('Creators')) |           ->setLabel(pht('Creators')) | ||||||
|           ->setValue(array_select_keys($handles, $creator_phids))) |           ->setValue($creator_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('contributors') |           ->setName('contributors') | ||||||
|           ->setLabel(pht('Contributors')) |           ->setLabel(pht('Contributors')) | ||||||
|           ->setValue(array_select_keys($handles, $contributor_phids))); |           ->setValue($contributor_phids)); | ||||||
|  |  | ||||||
|     $this->buildDateRange( |     $this->buildDateRange( | ||||||
|       $form, |       $form, | ||||||
|   | |||||||
| @@ -77,32 +77,26 @@ final class LegalpadDocumentSignatureSearchEngine | |||||||
|     $document_phids = $saved_query->getParameter('documentPHIDs', array()); |     $document_phids = $saved_query->getParameter('documentPHIDs', array()); | ||||||
|     $signer_phids = $saved_query->getParameter('signerPHIDs', array()); |     $signer_phids = $saved_query->getParameter('signerPHIDs', array()); | ||||||
|  |  | ||||||
|     $phids = array_merge($document_phids, $signer_phids); |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     if (!$this->document) { |     if (!$this->document) { | ||||||
|       $form |       $form | ||||||
|         ->appendChild( |         ->appendControl( | ||||||
|           id(new AphrontFormTokenizerControl()) |           id(new AphrontFormTokenizerControl()) | ||||||
|             ->setDatasource(new LegalpadDocumentDatasource()) |             ->setDatasource(new LegalpadDocumentDatasource()) | ||||||
|             ->setName('documents') |             ->setName('documents') | ||||||
|             ->setLabel(pht('Documents')) |             ->setLabel(pht('Documents')) | ||||||
|             ->setValue(array_select_keys($handles, $document_phids))); |             ->setValue($document_phids)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $name_contains = $saved_query->getParameter('nameContains', ''); |     $name_contains = $saved_query->getParameter('nameContains', ''); | ||||||
|     $email_contains = $saved_query->getParameter('emailContains', ''); |     $email_contains = $saved_query->getParameter('emailContains', ''); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('signers') |           ->setName('signers') | ||||||
|           ->setLabel(pht('Signers')) |           ->setLabel(pht('Signers')) | ||||||
|           ->setValue(array_select_keys($handles, $signer_phids))) |           ->setValue($signer_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
|           ->setLabel(pht('Name Contains')) |           ->setLabel(pht('Name Contains')) | ||||||
|   | |||||||
| @@ -44,8 +44,9 @@ final class PhabricatorMacroMemeDialogController | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $view = id(new PHUIFormLayoutView()) |     $view = id(new AphrontFormView()) | ||||||
|       ->appendChild( |       ->setUser($user) | ||||||
|  |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Macro')) |           ->setLabel(pht('Macro')) | ||||||
|           ->setName('macro') |           ->setName('macro') | ||||||
| @@ -66,9 +67,9 @@ final class PhabricatorMacroMemeDialogController | |||||||
|     $dialog = id(new AphrontDialogView()) |     $dialog = id(new AphrontDialogView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
|       ->setTitle(pht('Create Meme')) |       ->setTitle(pht('Create Meme')) | ||||||
|       ->appendChild($view) |       ->appendForm($view) | ||||||
|       ->addCancelButton('/') |       ->addCancelButton('/') | ||||||
|       ->addSubmitButton(pht('rofllolo!!~')); |       ->addSubmitButton(pht('Llama Diorama')); | ||||||
|  |  | ||||||
|     return id(new AphrontDialogResponse())->setDialog($dialog); |     return id(new AphrontDialogResponse())->setDialog($dialog); | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -74,12 +74,7 @@ final class PhabricatorMacroSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|  |  | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $status = $saved_query->getParameter('status'); |     $status = $saved_query->getParameter('status'); | ||||||
|     $names = implode(', ', $saved_query->getParameter('names', array())); |     $names = implode(', ', $saved_query->getParameter('names', array())); | ||||||
|     $like = $saved_query->getParameter('nameLike'); |     $like = $saved_query->getParameter('nameLike'); | ||||||
| @@ -92,12 +87,12 @@ final class PhabricatorMacroSearchEngine | |||||||
|           ->setLabel(pht('Status')) |           ->setLabel(pht('Status')) | ||||||
|           ->setOptions(PhabricatorMacroQuery::getStatusOptions()) |           ->setOptions(PhabricatorMacroQuery::getStatusOptions()) | ||||||
|           ->setValue($status)) |           ->setValue($status)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
|           ->setName('nameLike') |           ->setName('nameLike') | ||||||
|   | |||||||
| @@ -320,13 +320,14 @@ final class ManiphestReportController extends ManiphestController { | |||||||
|  |  | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setLabel(pht('Project')) |           ->setLabel(pht('Project')) | ||||||
|           ->setLimit(1) |           ->setLimit(1) | ||||||
|           ->setName('set_project') |           ->setName('set_project') | ||||||
|           ->setValue($tokens)); |           // TODO: This is silly, but this is Maniphest reports. | ||||||
|  |           ->setValue(mpull($tokens, 'getPHID'))); | ||||||
|  |  | ||||||
|     if ($has_window) { |     if ($has_window) { | ||||||
|       list($window_str, $ignored, $window_error) = $this->getWindow(); |       list($window_str, $ignored, $window_error) = $this->getWindow(); | ||||||
|   | |||||||
| @@ -202,7 +202,7 @@ final class ManiphestTaskDetailController extends ManiphestController { | |||||||
|           ->setControlID('resolution') |           ->setControlID('resolution') | ||||||
|           ->setControlStyle('display: none') |           ->setControlStyle('display: none') | ||||||
|           ->setOptions($resolution_types)) |           ->setOptions($resolution_types)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Assign To')) |           ->setLabel(pht('Assign To')) | ||||||
|           ->setName('assign_to') |           ->setName('assign_to') | ||||||
| @@ -210,7 +210,7 @@ final class ManiphestTaskDetailController extends ManiphestController { | |||||||
|           ->setControlStyle('display: none') |           ->setControlStyle('display: none') | ||||||
|           ->setID('assign-tokenizer') |           ->setID('assign-tokenizer') | ||||||
|           ->setDisableBehavior(true)) |           ->setDisableBehavior(true)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('CCs')) |           ->setLabel(pht('CCs')) | ||||||
|           ->setName('ccs') |           ->setName('ccs') | ||||||
| @@ -226,7 +226,7 @@ final class ManiphestTaskDetailController extends ManiphestController { | |||||||
|           ->setControlID('priority') |           ->setControlID('priority') | ||||||
|           ->setControlStyle('display: none') |           ->setControlStyle('display: none') | ||||||
|           ->setValue($task->getPriority())) |           ->setValue($task->getPriority())) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Projects')) |           ->setLabel(pht('Projects')) | ||||||
|           ->setName('projects') |           ->setName('projects') | ||||||
|   | |||||||
| @@ -506,20 +506,6 @@ final class ManiphestTaskEditController extends ManiphestController { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $phids = array_merge( |  | ||||||
|       array($task->getOwnerPHID()), |  | ||||||
|       $task->getSubscriberPHIDs(), |  | ||||||
|       $task->getProjectPHIDs()); |  | ||||||
|  |  | ||||||
|     if ($parent_task) { |  | ||||||
|       $phids[] = $parent_task->getPHID(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $phids = array_filter($phids); |  | ||||||
|     $phids = array_unique($phids); |  | ||||||
|  |  | ||||||
|     $handles = $this->loadViewerHandles($phids); |  | ||||||
|  |  | ||||||
|     $error_view = null; |     $error_view = null; | ||||||
|     if ($errors) { |     if ($errors) { | ||||||
|       $error_view = new PHUIInfoView(); |       $error_view = new PHUIInfoView(); | ||||||
| @@ -529,19 +515,19 @@ final class ManiphestTaskEditController extends ManiphestController { | |||||||
|     $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); |     $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); | ||||||
|  |  | ||||||
|     if ($task->getOwnerPHID()) { |     if ($task->getOwnerPHID()) { | ||||||
|       $assigned_value = array($handles[$task->getOwnerPHID()]); |       $assigned_value = array($task->getOwnerPHID()); | ||||||
|     } else { |     } else { | ||||||
|       $assigned_value = array(); |       $assigned_value = array(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if ($task->getSubscriberPHIDs()) { |     if ($task->getSubscriberPHIDs()) { | ||||||
|       $cc_value = array_select_keys($handles, $task->getSubscriberPHIDs()); |       $cc_value = $task->getSubscriberPHIDs(); | ||||||
|     } else { |     } else { | ||||||
|       $cc_value = array(); |       $cc_value = array(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     if ($task->getProjectPHIDs()) { |     if ($task->getProjectPHIDs()) { | ||||||
|       $projects_value = array_select_keys($handles, $task->getProjectPHIDs()); |       $projects_value = $task->getProjectPHIDs(); | ||||||
|     } else { |     } else { | ||||||
|       $projects_value = array(); |       $projects_value = array(); | ||||||
|     } |     } | ||||||
| @@ -583,7 +569,7 @@ final class ManiphestTaskEditController extends ManiphestController { | |||||||
|         ->appendChild( |         ->appendChild( | ||||||
|           id(new AphrontFormStaticControl()) |           id(new AphrontFormStaticControl()) | ||||||
|             ->setLabel(pht('Parent Task')) |             ->setLabel(pht('Parent Task')) | ||||||
|             ->setValue($handles[$parent_task->getPHID()]->getFullName())) |             ->setValue($user->renderHandle($parent_task->getPHID()))) | ||||||
|         ->addHiddenInput('parent', $parent_task->getID()); |         ->addHiddenInput('parent', $parent_task->getID()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -620,7 +606,7 @@ final class ManiphestTaskEditController extends ManiphestController { | |||||||
|       ->execute(); |       ->execute(); | ||||||
|  |  | ||||||
|     if ($can_edit_assign) { |     if ($can_edit_assign) { | ||||||
|       $form->appendChild( |       $form->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Assigned To')) |           ->setLabel(pht('Assigned To')) | ||||||
|           ->setName('assigned_to') |           ->setName('assigned_to') | ||||||
| @@ -631,7 +617,7 @@ final class ManiphestTaskEditController extends ManiphestController { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('CC')) |           ->setLabel(pht('CC')) | ||||||
|           ->setName('cc') |           ->setName('cc') | ||||||
| @@ -680,7 +666,7 @@ final class ManiphestTaskEditController extends ManiphestController { | |||||||
|           pht('Create New Project')); |           pht('Create New Project')); | ||||||
|       } |       } | ||||||
|       $form |       $form | ||||||
|         ->appendChild( |         ->appendControl( | ||||||
|           id(new AphrontFormTokenizerControl()) |           id(new AphrontFormTokenizerControl()) | ||||||
|             ->setLabel(pht('Projects')) |             ->setLabel(pht('Projects')) | ||||||
|             ->setName('projects') |             ->setName('projects') | ||||||
|   | |||||||
| @@ -258,34 +258,6 @@ final class ManiphestTaskSearchEngine | |||||||
|       array()); |       array()); | ||||||
|     $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); |     $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | ||||||
|  |  | ||||||
|     $all_phids = array_merge( |  | ||||||
|       $assigned_phids, |  | ||||||
|       $author_phids, |  | ||||||
|       $all_project_phids, |  | ||||||
|       $any_project_phids, |  | ||||||
|       $exclude_project_phids, |  | ||||||
|       $user_project_phids, |  | ||||||
|       $subscriber_phids); |  | ||||||
|  |  | ||||||
|     if ($all_phids) { |  | ||||||
|       $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|         ->setViewer($this->requireViewer()) |  | ||||||
|         ->withPHIDs($all_phids) |  | ||||||
|         ->execute(); |  | ||||||
|     } else { |  | ||||||
|       $handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $assigned_handles = array_select_keys($handles, $assigned_phids); |  | ||||||
|     $author_handles = array_select_keys($handles, $author_phids); |  | ||||||
|     $all_project_handles = array_select_keys($handles, $all_project_phids); |  | ||||||
|     $any_project_handles = array_select_keys($handles, $any_project_phids); |  | ||||||
|     $exclude_project_handles = array_select_keys( |  | ||||||
|       $handles, |  | ||||||
|       $exclude_project_phids); |  | ||||||
|     $user_project_handles = array_select_keys($handles, $user_project_phids); |  | ||||||
|     $subscriber_handles = array_select_keys($handles, $subscriber_phids); |  | ||||||
|  |  | ||||||
|     $with_unassigned = $saved->getParameter('withUnassigned'); |     $with_unassigned = $saved->getParameter('withUnassigned'); | ||||||
|     $with_no_projects = $saved->getParameter('withNoProject'); |     $with_no_projects = $saved->getParameter('withNoProject'); | ||||||
|  |  | ||||||
| @@ -320,7 +292,9 @@ final class ManiphestTaskSearchEngine | |||||||
|       ->setOptions(array( |       ->setOptions(array( | ||||||
|         '' => pht('Show All Tasks'), |         '' => pht('Show All Tasks'), | ||||||
|         'true' => pht('Show Tasks Blocking Other Tasks'), |         'true' => pht('Show Tasks Blocking Other Tasks'), | ||||||
|         'false' => pht('Show Tasks Not Blocking Other Tasks'),)); |         'false' => pht('Show Tasks Not Blocking Other Tasks'), | ||||||
|  |       )); | ||||||
|  |  | ||||||
|     $blocked_control = id(new AphrontFormSelectControl()) |     $blocked_control = id(new AphrontFormSelectControl()) | ||||||
|       ->setLabel(pht('Blocked')) |       ->setLabel(pht('Blocked')) | ||||||
|       ->setName('blocked') |       ->setName('blocked') | ||||||
| @@ -328,7 +302,8 @@ final class ManiphestTaskSearchEngine | |||||||
|       ->setOptions(array( |       ->setOptions(array( | ||||||
|         '' => pht('Show All Tasks'), |         '' => pht('Show All Tasks'), | ||||||
|         'true' => pht('Show Tasks Blocked By Other Tasks'), |         'true' => pht('Show Tasks Blocked By Other Tasks'), | ||||||
|         'false' => pht('Show Tasks Not Blocked By Other Tasks'),)); |         'false' => pht('Show Tasks Not Blocked By Other Tasks'), | ||||||
|  |       )); | ||||||
|  |  | ||||||
|     $ids = $saved->getParameter('ids', array()); |     $ids = $saved->getParameter('ids', array()); | ||||||
|  |  | ||||||
| @@ -337,12 +312,12 @@ final class ManiphestTaskSearchEngine | |||||||
|     $all_orders = $builtin_orders + $custom_orders; |     $all_orders = $builtin_orders + $custom_orders; | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('assigned') |           ->setName('assigned') | ||||||
|           ->setLabel(pht('Assigned To')) |           ->setLabel(pht('Assigned To')) | ||||||
|           ->setValue($assigned_handles)) |           ->setValue($assigned_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormCheckboxControl()) |         id(new AphrontFormCheckboxControl()) | ||||||
|           ->addCheckbox( |           ->addCheckbox( | ||||||
| @@ -350,12 +325,12 @@ final class ManiphestTaskSearchEngine | |||||||
|             1, |             1, | ||||||
|             pht('Show only unassigned tasks.'), |             pht('Show only unassigned tasks.'), | ||||||
|             $with_unassigned)) |             $with_unassigned)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setName('allProjects') |           ->setName('allProjects') | ||||||
|           ->setLabel(pht('In All Projects')) |           ->setLabel(pht('In All Projects')) | ||||||
|           ->setValue($all_project_handles)); |           ->setValue($all_project_phids)); | ||||||
|  |  | ||||||
|     if (!$this->getIsBoardView()) { |     if (!$this->getIsBoardView()) { | ||||||
|       $form |       $form | ||||||
| @@ -369,36 +344,36 @@ final class ManiphestTaskSearchEngine | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setName('anyProjects') |           ->setName('anyProjects') | ||||||
|           ->setLabel(pht('In Any Project')) |           ->setLabel(pht('In Any Project')) | ||||||
|           ->setValue($any_project_handles)) |           ->setValue($any_project_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setName('excludeProjects') |           ->setName('excludeProjects') | ||||||
|           ->setLabel(pht('Not In Projects')) |           ->setLabel(pht('Not In Projects')) | ||||||
|           ->setValue($exclude_project_handles)) |           ->setValue($exclude_project_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('userProjects') |           ->setName('userProjects') | ||||||
|           ->setLabel(pht('In Users\' Projects')) |           ->setLabel(pht('In Users\' Projects')) | ||||||
|           ->setValue($user_project_handles)) |           ->setValue($user_project_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) |           ->setDatasource(new PhabricatorMetaMTAMailableDatasource()) | ||||||
|           ->setName('subscribers') |           ->setName('subscribers') | ||||||
|           ->setLabel(pht('Subscribers')) |           ->setLabel(pht('Subscribers')) | ||||||
|           ->setValue($subscriber_handles)) |           ->setValue($subscriber_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
|           ->setName('fulltext') |           ->setName('fulltext') | ||||||
|   | |||||||
| @@ -301,15 +301,13 @@ final class PhabricatorMetaMTAApplicationEmailPanel | |||||||
|  |  | ||||||
|     $default_user = $email_object->getConfigValue($default_user_key); |     $default_user = $email_object->getConfigValue($default_user_key); | ||||||
|     if ($default_user) { |     if ($default_user) { | ||||||
|       $default_user_handle = id(new PhabricatorHandleQuery()) |       $default_user_value = array($default_user); | ||||||
|         ->setViewer($viewer) |  | ||||||
|         ->withPHIDs(array($default_user)) |  | ||||||
|         ->execute(); |  | ||||||
|     } else { |     } else { | ||||||
|       $default_user_handle = array(); |       $default_user_value = array(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form = id(new PHUIFormLayoutView()) |     $form = id(new AphrontFormView()) | ||||||
|  |       ->setUser($viewer) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
|           ->setLabel(pht('Email')) |           ->setLabel(pht('Email')) | ||||||
| @@ -317,13 +315,13 @@ final class PhabricatorMetaMTAApplicationEmailPanel | |||||||
|           ->setValue($email_object->getAddress()) |           ->setValue($email_object->getAddress()) | ||||||
|           ->setCaption(PhabricatorUserEmail::describeAllowedAddresses()) |           ->setCaption(PhabricatorUserEmail::describeAllowedAddresses()) | ||||||
|           ->setError($e_email)) |           ->setError($e_email)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setLabel(pht('Default Author')) |           ->setLabel(pht('Default Author')) | ||||||
|           ->setName($default_user_key) |           ->setName($default_user_key) | ||||||
|           ->setLimit(1) |           ->setLimit(1) | ||||||
|           ->setValue($default_user_handle) |           ->setValue($default_user_value) | ||||||
|           ->setCaption(pht( |           ->setCaption(pht( | ||||||
|             'Used if the "From:" address does not map to a known account.'))); |             'Used if the "From:" address does not map to a known account.'))); | ||||||
|     if ($is_new) { |     if ($is_new) { | ||||||
| @@ -336,7 +334,7 @@ final class PhabricatorMetaMTAApplicationEmailPanel | |||||||
|       ->setWidth(AphrontDialogView::WIDTH_FORM) |       ->setWidth(AphrontDialogView::WIDTH_FORM) | ||||||
|       ->setTitle($title) |       ->setTitle($title) | ||||||
|       ->appendChild($errors) |       ->appendChild($errors) | ||||||
|       ->appendChild($form) |       ->appendForm($form) | ||||||
|       ->addSubmitButton(pht('Save')) |       ->addSubmitButton(pht('Save')) | ||||||
|       ->addCancelButton($uri); |       ->addCancelButton($uri); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,19 +36,15 @@ final class PhabricatorOAuthServerClientSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|  |  | ||||||
|     $phids = $saved_query->getParameter('creatorPHIDs', array()); |     $creator_phids = $saved_query->getParameter('creatorPHIDs', array()); | ||||||
|     $creator_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('creators') |           ->setName('creators') | ||||||
|           ->setLabel(pht('Creators')) |           ->setLabel(pht('Creators')) | ||||||
|           ->setValue($creator_handles)); |           ->setValue($creator_phids)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   protected function getURI($path) { |   protected function getURI($path) { | ||||||
|   | |||||||
| @@ -114,17 +114,13 @@ final class PhabricatorOwnersEditController | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $handles = $this->loadViewerHandles($owners); |  | ||||||
|  |  | ||||||
|     $primary = $package->getPrimaryOwnerPHID(); |     $primary = $package->getPrimaryOwnerPHID(); | ||||||
|     if ($primary && isset($handles[$primary])) { |     if ($primary) { | ||||||
|       $handle_primary_owner = array($handles[$primary]); |       $value_primary_owner = array($primary); | ||||||
|     } else { |     } else { | ||||||
|       $handle_primary_owner = array(); |       $value_primary_owner = array(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $handles_all_owners = array_select_keys($handles, $owners); |  | ||||||
|  |  | ||||||
|     if ($package->getID()) { |     if ($package->getID()) { | ||||||
|       $title = pht('Edit Package'); |       $title = pht('Edit Package'); | ||||||
|       $side_nav_filter = 'edit/'.$this->id; |       $side_nav_filter = 'edit/'.$this->id; | ||||||
| @@ -182,20 +178,20 @@ final class PhabricatorOwnersEditController | |||||||
|           ->setName('name') |           ->setName('name') | ||||||
|           ->setValue($package->getName()) |           ->setValue($package->getName()) | ||||||
|           ->setError($e_name)) |           ->setError($e_name)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectOrUserDatasource()) |           ->setDatasource(new PhabricatorProjectOrUserDatasource()) | ||||||
|           ->setLabel(pht('Primary Owner')) |           ->setLabel(pht('Primary Owner')) | ||||||
|           ->setName('primary') |           ->setName('primary') | ||||||
|           ->setLimit(1) |           ->setLimit(1) | ||||||
|           ->setValue($handle_primary_owner) |           ->setValue($value_primary_owner) | ||||||
|           ->setError($e_primary)) |           ->setError($e_primary)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectOrUserDatasource()) |           ->setDatasource(new PhabricatorProjectOrUserDatasource()) | ||||||
|           ->setLabel(pht('Owners')) |           ->setLabel(pht('Owners')) | ||||||
|           ->setName('owners') |           ->setName('owners') | ||||||
|           ->setValue($handles_all_owners)) |           ->setValue($owners)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setName('auditing') |           ->setName('auditing') | ||||||
|   | |||||||
| @@ -148,13 +148,7 @@ final class PhabricatorOwnersListController | |||||||
|  |  | ||||||
|     $filter = new AphrontListFilterView(); |     $filter = new AphrontListFilterView(); | ||||||
|  |  | ||||||
|     $owners_search_value = array(); |     $owner_phids = $request->getArr('owner'); | ||||||
|     if ($request->getArr('owner')) { |  | ||||||
|       $phids = $request->getArr('owner'); |  | ||||||
|       $phid = reset($phids); |  | ||||||
|       $handles = $this->loadViewerHandles(array($phid)); |  | ||||||
|       $owners_search_value = array($handles[$phid]); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $callsigns = array('' => pht('(Any Repository)')); |     $callsigns = array('' => pht('(Any Repository)')); | ||||||
|     $repositories = id(new PhabricatorRepositoryQuery()) |     $repositories = id(new PhabricatorRepositoryQuery()) | ||||||
| @@ -175,13 +169,13 @@ final class PhabricatorOwnersListController | |||||||
|           ->setName('name') |           ->setName('name') | ||||||
|           ->setLabel(pht('Name')) |           ->setLabel(pht('Name')) | ||||||
|           ->setValue($request->getStr('name'))) |           ->setValue($request->getStr('name'))) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectOrUserDatasource()) |           ->setDatasource(new PhabricatorProjectOrUserDatasource()) | ||||||
|           ->setLimit(1) |           ->setLimit(1) | ||||||
|           ->setName('owner') |           ->setName('owner') | ||||||
|           ->setLabel(pht('Owner')) |           ->setLabel(pht('Owner')) | ||||||
|           ->setValue($owners_search_value)) |           ->setValue($owner_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setName('repository') |           ->setName('repository') | ||||||
|   | |||||||
| @@ -188,17 +188,11 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { | |||||||
|         ->setPolicies($policies) |         ->setPolicies($policies) | ||||||
|         ->setName('can_edit')); |         ->setName('can_edit')); | ||||||
|  |  | ||||||
|     if ($v_projects) { |     $form->appendControl( | ||||||
|       $project_handles = $this->loadViewerHandles($v_projects); |  | ||||||
|     } else { |  | ||||||
|       $project_handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $form->appendChild( |  | ||||||
|       id(new AphrontFormTokenizerControl()) |       id(new AphrontFormTokenizerControl()) | ||||||
|         ->setLabel(pht('Projects')) |         ->setLabel(pht('Projects')) | ||||||
|         ->setName('projects') |         ->setName('projects') | ||||||
|         ->setValue($project_handles) |         ->setValue($v_projects) | ||||||
|         ->setDatasource(new PhabricatorProjectDatasource())); |         ->setDatasource(new PhabricatorProjectDatasource())); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|   | |||||||
| @@ -52,11 +52,7 @@ final class PhabricatorPasteSearchEngine | |||||||
|   public function buildSearchForm( |   public function buildSearchForm( | ||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $languages = $saved_query->getParameter('languages', array()); |     $languages = $saved_query->getParameter('languages', array()); | ||||||
|     $no_language = false; |     $no_language = false; | ||||||
| @@ -69,12 +65,12 @@ final class PhabricatorPasteSearchEngine | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
|           ->setName('languages') |           ->setName('languages') | ||||||
|   | |||||||
| @@ -89,22 +89,6 @@ final class PhabricatorPeopleLogSearchEngine | |||||||
|     $actor_phids = $saved->getParameter('actorPHIDs', array()); |     $actor_phids = $saved->getParameter('actorPHIDs', array()); | ||||||
|     $user_phids = $saved->getParameter('userPHIDs', array()); |     $user_phids = $saved->getParameter('userPHIDs', array()); | ||||||
|  |  | ||||||
|     $all_phids = array_merge( |  | ||||||
|       $actor_phids, |  | ||||||
|       $user_phids); |  | ||||||
|  |  | ||||||
|     if ($all_phids) { |  | ||||||
|       $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|         ->setViewer($this->requireViewer()) |  | ||||||
|         ->withPHIDs($all_phids) |  | ||||||
|         ->execute(); |  | ||||||
|     } else { |  | ||||||
|       $handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $actor_handles = array_select_keys($handles, $actor_phids); |  | ||||||
|     $user_handles = array_select_keys($handles, $user_phids); |  | ||||||
|  |  | ||||||
|     $actions = $saved->getParameter('actions', array()); |     $actions = $saved->getParameter('actions', array()); | ||||||
|     $remote_prefix = $saved->getParameter('ip'); |     $remote_prefix = $saved->getParameter('ip'); | ||||||
|     $sessions = $saved->getParameter('sessions', array()); |     $sessions = $saved->getParameter('sessions', array()); | ||||||
| @@ -122,18 +106,18 @@ final class PhabricatorPeopleLogSearchEngine | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('actors') |           ->setName('actors') | ||||||
|           ->setLabel(pht('Actors')) |           ->setLabel(pht('Actors')) | ||||||
|           ->setValue($actor_handles)) |           ->setValue($actor_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('users') |           ->setName('users') | ||||||
|           ->setLabel(pht('Users')) |           ->setLabel(pht('Users')) | ||||||
|           ->setValue($user_handles)) |           ->setValue($user_phids)) | ||||||
|       ->appendChild($action_control) |       ->appendChild($action_control) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
|   | |||||||
| @@ -245,11 +245,6 @@ final class PholioMockEditController extends PholioController { | |||||||
|     $mock->setViewPolicy($v_view); |     $mock->setViewPolicy($v_view); | ||||||
|     $mock->setEditPolicy($v_edit); |     $mock->setEditPolicy($v_edit); | ||||||
|  |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($user) |  | ||||||
|       ->withPHIDs($v_cc) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $image_elements = array(); |     $image_elements = array(); | ||||||
|     if ($posted_mock_images) { |     if ($posted_mock_images) { | ||||||
|       $display_mock_images = $posted_mock_images; |       $display_mock_images = $posted_mock_images; | ||||||
| @@ -307,12 +302,6 @@ final class PholioMockEditController extends PholioController { | |||||||
|         ), |         ), | ||||||
|       )); |       )); | ||||||
|  |  | ||||||
|     if ($v_projects) { |  | ||||||
|       $project_handles = $this->loadViewerHandles($v_projects); |  | ||||||
|     } else { |  | ||||||
|       $project_handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     require_celerity_resource('pholio-edit-css'); |     require_celerity_resource('pholio-edit-css'); | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
| @@ -342,17 +331,17 @@ final class PholioMockEditController extends PholioController { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Projects')) |           ->setLabel(pht('Projects')) | ||||||
|           ->setName('projects') |           ->setName('projects') | ||||||
|           ->setValue($project_handles) |           ->setValue($v_projects) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource())) |           ->setDatasource(new PhabricatorProjectDatasource())) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('CC')) |           ->setLabel(pht('CC')) | ||||||
|           ->setName('cc') |           ->setName('cc') | ||||||
|           ->setValue($handles) |           ->setValue($v_cc) | ||||||
|           ->setUser($user) |           ->setUser($user) | ||||||
|           ->setDatasource(new PhabricatorMetaMTAMailableDatasource())) |           ->setDatasource(new PhabricatorMetaMTAMailableDatasource())) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|   | |||||||
| @@ -37,11 +37,7 @@ final class PholioMockSearchEngine extends PhabricatorApplicationSearchEngine { | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|  |  | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $statuses = array( |     $statuses = array( | ||||||
|       '' => pht('Any Status'), |       '' => pht('Any Status'), | ||||||
| @@ -53,12 +49,12 @@ final class PholioMockSearchEngine extends PhabricatorApplicationSearchEngine { | |||||||
|     $status = head($status); |     $status = head($status); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setLabel(pht('Status')) |           ->setLabel(pht('Status')) | ||||||
|   | |||||||
| @@ -97,8 +97,6 @@ final class PhortuneAccountEditController extends PhortuneController { | |||||||
|       $submit_button = pht('Save Changes'); |       $submit_button = pht('Save Changes'); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $member_handles = $this->loadViewerHandles($v_members); |  | ||||||
|  |  | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($viewer) |       ->setUser($viewer) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
| @@ -107,12 +105,12 @@ final class PhortuneAccountEditController extends PhortuneController { | |||||||
|           ->setLabel(pht('Name')) |           ->setLabel(pht('Name')) | ||||||
|           ->setValue($v_name) |           ->setValue($v_name) | ||||||
|           ->setError($e_name)) |           ->setError($e_name)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setLabel(pht('Members')) |           ->setLabel(pht('Members')) | ||||||
|           ->setName('memberPHIDs') |           ->setName('memberPHIDs') | ||||||
|           ->setValue($member_handles) |           ->setValue($v_members) | ||||||
|           ->setError($e_members)) |           ->setError($e_members)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSubmitControl()) |         id(new AphrontFormSubmitControl()) | ||||||
|   | |||||||
| @@ -119,8 +119,6 @@ final class PhortuneMerchantEditController | |||||||
|       ->setObject($merchant) |       ->setObject($merchant) | ||||||
|       ->execute(); |       ->execute(); | ||||||
|  |  | ||||||
|     $member_handles = $this->loadViewerHandles($v_members); |  | ||||||
|  |  | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($viewer) |       ->setUser($viewer) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
| @@ -135,12 +133,12 @@ final class PhortuneMerchantEditController | |||||||
|           ->setName('desc') |           ->setName('desc') | ||||||
|           ->setLabel(pht('Description')) |           ->setLabel(pht('Description')) | ||||||
|           ->setValue($v_desc)) |           ->setValue($v_desc)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setLabel(pht('Members')) |           ->setLabel(pht('Members')) | ||||||
|           ->setName('memberPHIDs') |           ->setName('memberPHIDs') | ||||||
|           ->setValue($member_handles) |           ->setValue($v_members) | ||||||
|           ->setError($e_members)) |           ->setError($e_members)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormPolicyControl()) |         id(new AphrontFormPolicyControl()) | ||||||
|   | |||||||
| @@ -60,19 +60,13 @@ final class PhrequentSearchEngine extends PhabricatorApplicationSearchEngine { | |||||||
|     $order = $saved_query->getParameter( |     $order = $saved_query->getParameter( | ||||||
|       'order', PhrequentUserTimeQuery::ORDER_ENDED_DESC); |       'order', PhrequentUserTimeQuery::ORDER_ENDED_DESC); | ||||||
|  |  | ||||||
|     $phids = array_merge($user_phids); |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('users') |           ->setName('users') | ||||||
|           ->setLabel(pht('Users')) |           ->setLabel(pht('Users')) | ||||||
|           ->setValue($handles)) |           ->setValue($user_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setLabel(pht('Ended')) |           ->setLabel(pht('Ended')) | ||||||
|   | |||||||
| @@ -105,17 +105,11 @@ final class PonderQuestionEditController extends PonderController { | |||||||
|           ->setLabel(pht('Description')) |           ->setLabel(pht('Description')) | ||||||
|           ->setUser($user)); |           ->setUser($user)); | ||||||
|  |  | ||||||
|     if ($v_projects) { |     $form->appendControl( | ||||||
|       $project_handles = $this->loadViewerHandles($v_projects); |  | ||||||
|     } else { |  | ||||||
|       $project_handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $form->appendChild( |  | ||||||
|       id(new AphrontFormTokenizerControl()) |       id(new AphrontFormTokenizerControl()) | ||||||
|         ->setLabel(pht('Projects')) |         ->setLabel(pht('Projects')) | ||||||
|         ->setName('projects') |         ->setName('projects') | ||||||
|         ->setValue($project_handles) |         ->setValue($v_projects) | ||||||
|         ->setDatasource(new PhabricatorProjectDatasource())); |         ->setDatasource(new PhabricatorProjectDatasource())); | ||||||
|  |  | ||||||
|     $form ->appendChild( |     $form ->appendChild( | ||||||
|   | |||||||
| @@ -64,25 +64,19 @@ final class PonderQuestionSearchEngine | |||||||
|     $status = $saved_query->getParameter( |     $status = $saved_query->getParameter( | ||||||
|       'status', PonderQuestionStatus::STATUS_OPEN); |       'status', PonderQuestionStatus::STATUS_OPEN); | ||||||
|  |  | ||||||
|     $phids = array_merge($author_phids, $answerer_phids); |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue(array_select_keys($handles, $author_phids))) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('answerers') |           ->setName('answerers') | ||||||
|           ->setLabel(pht('Answered By')) |           ->setLabel(pht('Answered By')) | ||||||
|           ->setValue(array_select_keys($handles, $answerer_phids))) |           ->setValue($answerer_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setLabel(pht('Status')) |           ->setLabel(pht('Status')) | ||||||
|   | |||||||
| @@ -74,6 +74,7 @@ final class PhabricatorProjectBoardImportController | |||||||
|       ->setDatasource(id(new PhabricatorProjectDatasource()) |       ->setDatasource(id(new PhabricatorProjectDatasource()) | ||||||
|         ->setParameters(array('mustHaveColumns' => true)) |         ->setParameters(array('mustHaveColumns' => true)) | ||||||
|       ->setLimit(1)); |       ->setLimit(1)); | ||||||
|  |  | ||||||
|     return $this->newDialog() |     return $this->newDialog() | ||||||
|       ->setTitle(pht('Import Columns')) |       ->setTitle(pht('Import Columns')) | ||||||
|       ->setWidth(AphrontDialogView::WIDTH_FORM) |       ->setWidth(AphrontDialogView::WIDTH_FORM) | ||||||
|   | |||||||
| @@ -88,7 +88,7 @@ final class PhabricatorProjectMembersEditController | |||||||
|       $form = new AphrontFormView(); |       $form = new AphrontFormView(); | ||||||
|       $form |       $form | ||||||
|         ->setUser($user) |         ->setUser($user) | ||||||
|         ->appendChild( |         ->appendControl( | ||||||
|           id(new AphrontFormTokenizerControl()) |           id(new AphrontFormTokenizerControl()) | ||||||
|             ->setName('phids') |             ->setName('phids') | ||||||
|             ->setLabel(pht('Add Members')) |             ->setLabel(pht('Add Members')) | ||||||
|   | |||||||
| @@ -77,11 +77,7 @@ final class PhabricatorProjectSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved) { |     PhabricatorSavedQuery $saved) { | ||||||
|  |  | ||||||
|     $phids = $saved->getParameter('memberPHIDs', array()); |     $member_phids = $saved->getParameter('memberPHIDs', array()); | ||||||
|     $member_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $status = $saved->getParameter('status'); |     $status = $saved->getParameter('status'); | ||||||
|     $name_match = $saved->getParameter('name'); |     $name_match = $saved->getParameter('name'); | ||||||
| @@ -123,12 +119,12 @@ final class PhabricatorProjectSearchEngine | |||||||
|           ->setName('name') |           ->setName('name') | ||||||
|           ->setLabel(pht('Name')) |           ->setLabel(pht('Name')) | ||||||
|           ->setValue($name_match)) |           ->setValue($name_match)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('members') |           ->setName('members') | ||||||
|           ->setLabel(pht('Members')) |           ->setLabel(pht('Members')) | ||||||
|           ->setValue($member_handles)) |           ->setValue($member_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setLabel(pht('Status')) |           ->setLabel(pht('Status')) | ||||||
|   | |||||||
| @@ -120,13 +120,6 @@ final class ReleephProductEditController extends ReleephProductController { | |||||||
|       'pushers', |       'pushers', | ||||||
|       $product->getDetail('pushers', array())); |       $product->getDetail('pushers', array())); | ||||||
|  |  | ||||||
|     $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($request->getUser()) |  | ||||||
|       ->withPHIDs($pusher_phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $pusher_handles = array_select_keys($handles, $pusher_phids); |  | ||||||
|  |  | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($request->getUser()) |       ->setUser($request->getUser()) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
| @@ -191,12 +184,12 @@ final class ReleephProductEditController extends ReleephProductController { | |||||||
|       ->addStatic('projectName', $product->getName()); |       ->addStatic('projectName', $product->getName()); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Pushers')) |           ->setLabel(pht('Pushers')) | ||||||
|           ->setName('pushers') |           ->setName('pushers') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue($pusher_handles)) |           ->setValue($pusher_phids)) | ||||||
|       ->appendChild($branch_template_input) |       ->appendChild($branch_template_input) | ||||||
|       ->appendChild($branch_template_preview) |       ->appendChild($branch_template_preview) | ||||||
|       ->appendRemarkupInstructions($this->getBranchHelpText()); |       ->appendRemarkupInstructions($this->getBranchHelpText()); | ||||||
|   | |||||||
| @@ -67,11 +67,7 @@ final class ReleephRequestSearchEngine | |||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|  |  | ||||||
|     $phids = $saved_query->getParameter('requestorPHIDs', array()); |     $requestor_phids = $saved_query->getParameter('requestorPHIDs', array()); | ||||||
|     $requestor_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
| @@ -86,12 +82,12 @@ final class ReleephRequestSearchEngine | |||||||
|           ->setLabel(pht('Severity')) |           ->setLabel(pht('Severity')) | ||||||
|           ->setValue($saved_query->getParameter('severity')) |           ->setValue($saved_query->getParameter('severity')) | ||||||
|           ->setOptions($this->getSeverityOptions())) |           ->setOptions($this->getSeverityOptions())) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('requestors') |           ->setName('requestors') | ||||||
|           ->setLabel(pht('Requestors')) |           ->setLabel(pht('Requestors')) | ||||||
|           ->setValue($requestor_handles)); |           ->setValue($requestor_phids)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   protected function getURI($path) { |   protected function getURI($path) { | ||||||
|   | |||||||
| @@ -59,10 +59,7 @@ final class PhabricatorRepositoryArcanistProjectEditController | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     if ($project->getSymbolIndexProjects()) { |     if ($project->getSymbolIndexProjects()) { | ||||||
|       $uses = id(new PhabricatorHandleQuery()) |       $uses = $project->getSymbolIndexProjects(); | ||||||
|         ->setViewer($user) |  | ||||||
|         ->withPHIDs($project->getSymbolIndexProjects()) |  | ||||||
|         ->execute(); |  | ||||||
|     } else { |     } else { | ||||||
|       $uses = array(); |       $uses = array(); | ||||||
|     } |     } | ||||||
| @@ -91,7 +88,7 @@ final class PhabricatorRepositoryArcanistProjectEditController | |||||||
|             'Separate with commas, for example: %s', |             'Separate with commas, for example: %s', | ||||||
|             phutil_tag('tt', array(), 'php, py'))) |             phutil_tag('tt', array(), 'php, py'))) | ||||||
|           ->setValue($langs)) |           ->setValue($langs)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Uses Symbols From')) |           ->setLabel(pht('Uses Symbols From')) | ||||||
|           ->setName('symbolIndexProjects') |           ->setName('symbolIndexProjects') | ||||||
|   | |||||||
| @@ -55,35 +55,19 @@ final class PhabricatorRepositoryPushLogSearchEngine | |||||||
|     $repository_phids = $saved_query->getParameter('repositoryPHIDs', array()); |     $repository_phids = $saved_query->getParameter('repositoryPHIDs', array()); | ||||||
|     $pusher_phids = $saved_query->getParameter('pusherPHIDs', array()); |     $pusher_phids = $saved_query->getParameter('pusherPHIDs', array()); | ||||||
|  |  | ||||||
|     $all_phids = array_merge( |  | ||||||
|       $repository_phids, |  | ||||||
|       $pusher_phids); |  | ||||||
|  |  | ||||||
|     if ($all_phids) { |  | ||||||
|       $handles = id(new PhabricatorHandleQuery()) |  | ||||||
|         ->setViewer($this->requireViewer()) |  | ||||||
|         ->withPHIDs($all_phids) |  | ||||||
|         ->execute(); |  | ||||||
|     } else { |  | ||||||
|       $handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $repository_handles = array_select_keys($handles, $repository_phids); |  | ||||||
|     $pusher_handles = array_select_keys($handles, $pusher_phids); |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new DiffusionRepositoryDatasource()) |           ->setDatasource(new DiffusionRepositoryDatasource()) | ||||||
|           ->setName('repositories') |           ->setName('repositories') | ||||||
|           ->setLabel(pht('Repositories')) |           ->setLabel(pht('Repositories')) | ||||||
|           ->setValue($repository_handles)) |           ->setValue($repository_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('pushers') |           ->setName('pushers') | ||||||
|           ->setLabel(pht('Pushers')) |           ->setLabel(pht('Pushers')) | ||||||
|           ->setValue($pusher_handles)); |           ->setValue($pusher_phids)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   protected function getURI($path) { |   protected function getURI($path) { | ||||||
|   | |||||||
| @@ -84,15 +84,6 @@ final class PhabricatorRepositorySearchEngine | |||||||
|     $name = $saved_query->getParameter('name'); |     $name = $saved_query->getParameter('name'); | ||||||
|     $any_project_phids = $saved_query->getParameter('anyProjectPHIDs', array()); |     $any_project_phids = $saved_query->getParameter('anyProjectPHIDs', array()); | ||||||
|  |  | ||||||
|     if ($any_project_phids) { |  | ||||||
|       $any_project_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|         ->setViewer($this->requireViewer()) |  | ||||||
|         ->withPHIDs($any_project_phids) |  | ||||||
|         ->execute(); |  | ||||||
|     } else { |  | ||||||
|       $any_project_handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormTextControl()) |         id(new AphrontFormTextControl()) | ||||||
| @@ -104,12 +95,12 @@ final class PhabricatorRepositorySearchEngine | |||||||
|           ->setName('name') |           ->setName('name') | ||||||
|           ->setLabel(pht('Name Contains')) |           ->setLabel(pht('Name Contains')) | ||||||
|           ->setValue($name)) |           ->setValue($name)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setName('anyProjects') |           ->setName('anyProjects') | ||||||
|           ->setLabel(pht('In Any Project')) |           ->setLabel(pht('In Any Project')) | ||||||
|           ->setValue($any_project_handles)) |           ->setValue($any_project_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormSelectControl()) |         id(new AphrontFormSelectControl()) | ||||||
|           ->setName('status') |           ->setName('status') | ||||||
|   | |||||||
| @@ -66,22 +66,6 @@ final class PhabricatorSearchApplicationSearchEngine | |||||||
|     $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); |     $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); | ||||||
|     $project_phids = $saved->getParameter('projectPHIDs', array()); |     $project_phids = $saved->getParameter('projectPHIDs', array()); | ||||||
|  |  | ||||||
|     $all_phids = array_merge( |  | ||||||
|       $author_phids, |  | ||||||
|       $owner_phids, |  | ||||||
|       $subscriber_phids, |  | ||||||
|       $project_phids); |  | ||||||
|  |  | ||||||
|     $all_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($all_phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $author_handles = array_select_keys($all_handles, $author_phids); |  | ||||||
|     $owner_handles = array_select_keys($all_handles, $owner_phids); |  | ||||||
|     $subscriber_handles = array_select_keys($all_handles, $subscriber_phids); |  | ||||||
|     $project_handles = array_select_keys($all_handles, $project_phids); |  | ||||||
|  |  | ||||||
|     $with_unowned = $saved->getParameter('withUnowned', array()); |     $with_unowned = $saved->getParameter('withUnowned', array()); | ||||||
|  |  | ||||||
|     $status_values = $saved->getParameter('statuses', array()); |     $status_values = $saved->getParameter('statuses', array()); | ||||||
| @@ -132,18 +116,18 @@ final class PhabricatorSearchApplicationSearchEngine | |||||||
|           ->setValue($saved->getParameter('query'))) |           ->setValue($saved->getParameter('query'))) | ||||||
|       ->appendChild($status_control) |       ->appendChild($status_control) | ||||||
|       ->appendChild($types_control) |       ->appendChild($types_control) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName('authorPHIDs') |           ->setName('authorPHIDs') | ||||||
|           ->setLabel('Authors') |           ->setLabel('Authors') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName('ownerPHIDs') |           ->setName('ownerPHIDs') | ||||||
|           ->setLabel('Owners') |           ->setLabel('Owners') | ||||||
|           ->setDatasource(new PhabricatorTypeaheadOwnerDatasource()) |           ->setDatasource(new PhabricatorTypeaheadOwnerDatasource()) | ||||||
|           ->setValue($owner_handles)) |           ->setValue($owner_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormCheckboxControl()) |         id(new AphrontFormCheckboxControl()) | ||||||
|           ->addCheckbox( |           ->addCheckbox( | ||||||
| @@ -151,18 +135,18 @@ final class PhabricatorSearchApplicationSearchEngine | |||||||
|             1, |             1, | ||||||
|             pht('Show only unowned documents.'), |             pht('Show only unowned documents.'), | ||||||
|             $with_unowned)) |             $with_unowned)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName('subscriberPHIDs') |           ->setName('subscriberPHIDs') | ||||||
|           ->setLabel('Subscribers') |           ->setLabel('Subscribers') | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setValue($subscriber_handles)) |           ->setValue($subscriber_phids)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setName('projectPHIDs') |           ->setName('projectPHIDs') | ||||||
|           ->setLabel('In Any Project') |           ->setLabel('In Any Project') | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource()) |           ->setDatasource(new PhabricatorProjectDatasource()) | ||||||
|           ->setValue($project_handles)); |           ->setValue($project_phids)); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   protected function getURI($path) { |   protected function getURI($path) { | ||||||
|   | |||||||
| @@ -145,12 +145,6 @@ final class PhabricatorSlowvoteEditController | |||||||
|         pht('Resolve issues and build consensus through '. |         pht('Resolve issues and build consensus through '. | ||||||
|           'protracted deliberation.')); |           'protracted deliberation.')); | ||||||
|  |  | ||||||
|     if ($v_projects) { |  | ||||||
|       $project_handles = $this->loadViewerHandles($v_projects); |  | ||||||
|     } else { |  | ||||||
|       $project_handles = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $form = id(new AphrontFormView()) |     $form = id(new AphrontFormView()) | ||||||
|       ->setUser($user) |       ->setUser($user) | ||||||
|       ->appendChild($instructions) |       ->appendChild($instructions) | ||||||
| @@ -167,11 +161,11 @@ final class PhabricatorSlowvoteEditController | |||||||
|           ->setLabel(pht('Description')) |           ->setLabel(pht('Description')) | ||||||
|           ->setName('description') |           ->setName('description') | ||||||
|           ->setValue($v_description)) |           ->setValue($v_description)) | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setLabel(pht('Projects')) |           ->setLabel(pht('Projects')) | ||||||
|           ->setName('projects') |           ->setName('projects') | ||||||
|           ->setValue($project_handles) |           ->setValue($v_projects) | ||||||
|           ->setDatasource(new PhabricatorProjectDatasource())); |           ->setDatasource(new PhabricatorProjectDatasource())); | ||||||
|  |  | ||||||
|     if ($is_new) { |     if ($is_new) { | ||||||
|   | |||||||
| @@ -47,22 +47,18 @@ final class PhabricatorSlowvoteSearchEngine | |||||||
|   public function buildSearchForm( |   public function buildSearchForm( | ||||||
|     AphrontFormView $form, |     AphrontFormView $form, | ||||||
|     PhabricatorSavedQuery $saved_query) { |     PhabricatorSavedQuery $saved_query) { | ||||||
|     $phids = $saved_query->getParameter('authorPHIDs', array()); |     $author_phids = $saved_query->getParameter('authorPHIDs', array()); | ||||||
|     $author_handles = id(new PhabricatorHandleQuery()) |  | ||||||
|       ->setViewer($this->requireViewer()) |  | ||||||
|       ->withPHIDs($phids) |  | ||||||
|       ->execute(); |  | ||||||
|  |  | ||||||
|     $voted = $saved_query->getParameter('voted', false); |     $voted = $saved_query->getParameter('voted', false); | ||||||
|     $statuses = $saved_query->getParameter('statuses', array()); |     $statuses = $saved_query->getParameter('statuses', array()); | ||||||
|  |  | ||||||
|     $form |     $form | ||||||
|       ->appendChild( |       ->appendControl( | ||||||
|         id(new AphrontFormTokenizerControl()) |         id(new AphrontFormTokenizerControl()) | ||||||
|           ->setDatasource(new PhabricatorPeopleDatasource()) |           ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|           ->setName('authors') |           ->setName('authors') | ||||||
|           ->setLabel(pht('Authors')) |           ->setLabel(pht('Authors')) | ||||||
|           ->setValue($author_handles)) |           ->setValue($author_phids)) | ||||||
|       ->appendChild( |       ->appendChild( | ||||||
|         id(new AphrontFormCheckboxControl()) |         id(new AphrontFormCheckboxControl()) | ||||||
|           ->addCheckbox( |           ->addCheckbox( | ||||||
|   | |||||||
| @@ -9,18 +9,14 @@ final class PhabricatorStandardCustomFieldUsers | |||||||
|  |  | ||||||
|   public function renderEditControl(array $handles) { |   public function renderEditControl(array $handles) { | ||||||
|     $value = $this->getFieldValue(); |     $value = $this->getFieldValue(); | ||||||
|     if ($value) { |  | ||||||
|       $control_value = array_select_keys($handles, $value); |  | ||||||
|     } else { |  | ||||||
|       $control_value = array(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     $control = id(new AphrontFormTokenizerControl()) |     $control = id(new AphrontFormTokenizerControl()) | ||||||
|  |       ->setUser($this->getViewer()) | ||||||
|       ->setLabel($this->getFieldName()) |       ->setLabel($this->getFieldName()) | ||||||
|       ->setName($this->getFieldKey()) |       ->setName($this->getFieldKey()) | ||||||
|       ->setDatasource(new PhabricatorPeopleDatasource()) |       ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|       ->setCaption($this->getCaption()) |       ->setCaption($this->getCaption()) | ||||||
|       ->setValue($control_value); |       ->setValue(nonempty($value, array())); | ||||||
|  |  | ||||||
|     $limit = $this->getFieldConfigValue('limit'); |     $limit = $this->getFieldConfigValue('limit'); | ||||||
|     if ($limit) { |     if ($limit) { | ||||||
| @@ -40,9 +36,9 @@ final class PhabricatorStandardCustomFieldUsers | |||||||
|       ->setLabel($this->getFieldName()) |       ->setLabel($this->getFieldName()) | ||||||
|       ->setName($this->getFieldKey()) |       ->setName($this->getFieldKey()) | ||||||
|       ->setDatasource(new PhabricatorPeopleDatasource()) |       ->setDatasource(new PhabricatorPeopleDatasource()) | ||||||
|       ->setValue($handles); |       ->setValue(nonempty($value, array())); | ||||||
|  |  | ||||||
|     $form->appendChild($control); |     $form->appendControl($control); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   public function getHeraldFieldValueType($condition) { |   public function getHeraldFieldValueType($condition) { | ||||||
|   | |||||||
| @@ -13,6 +13,7 @@ final class AphrontFormView extends AphrontView { | |||||||
|   private $sigils = array(); |   private $sigils = array(); | ||||||
|   private $metadata; |   private $metadata; | ||||||
|   private $controls = array(); |   private $controls = array(); | ||||||
|  |   private $fullWidth = false; | ||||||
|  |  | ||||||
|   public function setMetadata($metadata) { |   public function setMetadata($metadata) { | ||||||
|     $this->metadata = $metadata; |     $this->metadata = $metadata; | ||||||
| @@ -63,6 +64,15 @@ final class AphrontFormView extends AphrontView { | |||||||
|     return $this; |     return $this; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   public function setFullWidth($full_width) { | ||||||
|  |     $this->fullWidth = $full_width; | ||||||
|  |     return $this; | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   public function getFullWidth() { | ||||||
|  |     return $this->fullWidth; | ||||||
|  |   } | ||||||
|  |  | ||||||
|   public function appendInstructions($text) { |   public function appendInstructions($text) { | ||||||
|     return $this->appendChild( |     return $this->appendChild( | ||||||
|       phutil_tag( |       phutil_tag( | ||||||
| @@ -83,6 +93,7 @@ final class AphrontFormView extends AphrontView { | |||||||
|  |  | ||||||
|   public function buildLayoutView() { |   public function buildLayoutView() { | ||||||
|     return id(new PHUIFormLayoutView()) |     return id(new PHUIFormLayoutView()) | ||||||
|  |       ->setFullWidth($this->getFullWidth()) | ||||||
|       ->appendChild($this->renderDataInputs()) |       ->appendChild($this->renderDataInputs()) | ||||||
|       ->appendChild($this->renderChildren()); |       ->appendChild($this->renderChildren()); | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 epriestley
					epriestley