1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

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:
epriestley 2015-03-31 14:10:55 -07:00
parent 7711ea9855
commit d403700e1f
59 changed files with 261 additions and 560 deletions

View file

@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => '20d3b672',
'core.pkg.css' => 'ad650d52',
'core.pkg.js' => '0c88e7f6',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '3500921f',
@ -20,7 +20,7 @@ return array(
'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => 'd2e76b88',
'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/notification.css' => '9c279160',
'rsrc/css/aphront/pager-view.css' => '2e3539af',
@ -34,7 +34,7 @@ return array(
'rsrc/css/aphront/typeahead.css' => '0e403212',
'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af',
'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/phabricator-application-launch-view.css' => '16ca323f',
'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/unhandled-exception.css' => '37d4f9a2',
'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/notification.css' => '04a6e10a',
'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/conpherence/ConpherenceThreadManager.js' => 'bb928342',
'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-quicksand-blacklist.js' => '7927a7d3',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '1ec93bcf',
@ -501,7 +501,7 @@ return array(
'aphront-bars' => '231ac33c',
'aphront-dark-console-css' => '6378ef3d',
'aphront-dialog-view-css' => 'd2e76b88',
'aphront-list-filter-view-css' => '2ae43867',
'aphront-list-filter-view-css' => '18b7e144',
'aphront-multi-column-view-css' => 'fd18389d',
'aphront-pager-view-css' => '2e3539af',
'aphront-panel-view-css' => '8427b78d',
@ -515,7 +515,7 @@ return array(
'config-options-css' => '7fedf08b',
'config-welcome-css' => '6abd79be',
'conpherence-durable-column-view' => 'caa12d4a',
'conpherence-menu-css' => 'beef0920',
'conpherence-menu-css' => '7c900089',
'conpherence-message-pane-css' => '44154798',
'conpherence-notification-css' => '04a6e10a',
'conpherence-thread-manager' => 'bb928342',
@ -557,7 +557,7 @@ return array(
'javelin-behavior-boards-dropdown' => '0ec56e1d',
'javelin-behavior-choose-control' => '6153c708',
'javelin-behavior-config-reorder-fields' => '14a827de',
'javelin-behavior-conpherence-menu' => 'de5579b4',
'javelin-behavior-conpherence-menu' => 'cda6de80',
'javelin-behavior-conpherence-pontificate' => '21ba5861',
'javelin-behavior-conpherence-widget-pane' => '1ec93bcf',
'javelin-behavior-countdown-timer' => 'e4cc26b3',
@ -729,7 +729,7 @@ return array(
'phabricator-hovercard-view-css' => '893f4783',
'phabricator-keyboard-shortcut' => '1ae869f2',
'phabricator-keyboard-shortcut-manager' => 'c1700f6f',
'phabricator-main-menu-view' => 'cfa2ec0f',
'phabricator-main-menu-view' => '361a51f9',
'phabricator-nav-view-css' => '7aeaf435',
'phabricator-notification' => '0c6946e7',
'phabricator-notification-css' => '9c279160',
@ -1755,6 +1755,18 @@ return array(
'javelin-stratcom',
'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(
'javelin-install',
'javelin-dom',
@ -1807,18 +1819,6 @@ return array(
'javelin-typeahead-ondemand-source',
'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(
'javelin-behavior',
'javelin-dom',

View file

@ -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/');
$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())
->setWidth(AphrontDialogView::WIDTH_FORM)
->setErrors($errors)
@ -80,17 +64,17 @@ final class ConpherenceNewController extends ConpherenceController {
->addCancelButton($cancel_uri)
->addSubmitButton(pht('Send Message'));
$form = id(new PHUIFormLayoutView())
$form = id(new AphrontFormView())
->setUser($user)
->setFullWidth(true)
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('participants')
->setValue($participant_handles)
->setUser($user)
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('To'))
->setError($e_participants))
->setName('participants')
->setValue($participants)
->setUser($user)
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('To'))
->setError($e_participants))
->appendChild(
id(new PhabricatorRemarkupControl())
->setUser($user)
@ -99,7 +83,7 @@ final class ConpherenceNewController extends ConpherenceController {
->setLabel(pht('Message'))
->setError($e_message));
$dialog->appendChild($form);
$dialog->appendForm($form);
return id(new AphrontDialogResponse())->setDialog($dialog);
}

View file

@ -225,14 +225,14 @@ final class ConpherenceUpdateController
$user = $request->getUser();
$add_person = $request->getStr('add_person');
$form = id(new PHUIFormLayoutView())
$form = id(new AphrontFormView())
->setUser($user)
->setFullWidth(true)
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('add_person')
->setUser($user)
->setDatasource(new PhabricatorPeopleDatasource()));
->setName('add_person')
->setUser($user)
->setDatasource(new PhabricatorPeopleDatasource()));
require_celerity_resource('conpherence-update-css');
$view = id(new AphrontDialogView())
@ -241,7 +241,7 @@ final class ConpherenceUpdateController
->addHiddenInput(
'latest_transaction_id',
$request->getInt('latest_transaction_id'))
->appendChild($form);
->appendForm($form);
if ($request->getExists('minimal_display')) {
$view->addHiddenInput('minimal_display', true);

View file

@ -52,18 +52,15 @@ final class ConpherenceThreadSearchEngine
AphrontFormView $form,
PhabricatorSavedQuery $saved) {
$phids = $saved->getParameter('participantPHIDs', array());
$participant_handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($phids)
->execute();
$participant_phids = $saved->getParameter('participantPHIDs', array());
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('participants')
->setLabel(pht('Participants'))
->setValue($participant_handles));
->setDatasource(new PhabricatorPeopleDatasource())
->setName('participants')
->setLabel(pht('Participants'))
->setValue($participant_phids));
}
protected function getURI($path) {

View file

@ -40,21 +40,17 @@ final class PhabricatorCountdownSearchEngine
public function buildSearchForm(
AphrontFormView $form,
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');
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(

View file

@ -28,7 +28,6 @@ final class DifferentialDiffCreateController extends DifferentialController {
// This object is just for policy stuff
$diff_object = DifferentialDiff::initializeNewDiff($viewer);
$repository_phid = null;
$repository_value = array();
$errors = array();
$e_diff = null;
$e_file = null;
@ -62,7 +61,8 @@ final class DifferentialDiffCreateController extends DifferentialController {
array(
'diff' => $diff,
'repositoryPHID' => $repository_phid,
'viewPolicy' => $request->getStr('viewPolicy'),));
'viewPolicy' => $request->getStr('viewPolicy'),
));
$call->setUser($viewer);
$result = $call->execute();
@ -93,10 +93,6 @@ final class DifferentialDiffCreateController extends DifferentialController {
$cancel_uri = $this->getApplicationURI();
if ($repository_phid) {
$repository_value = $this->loadViewerHandles(array($repository_phid));
}
$policies = id(new PhabricatorPolicyQuery())
->setViewer($viewer)
->setObject($diff_object)
@ -148,6 +144,12 @@ final class DifferentialDiffCreateController extends DifferentialController {
->setValue($revision_handle->renderLink()));
}
if ($repository_phid) {
$repository_value = array($repository_phid);
} else {
$repository_value = array();
}
$form
->appendChild(
id(new AphrontFormTextAreaControl())
@ -161,20 +163,20 @@ final class DifferentialDiffCreateController extends DifferentialController {
->setLabel(pht('Raw Diff From File'))
->setName('diff-file')
->setError($e_file))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setName(id(new DifferentialRepositoryField())->getFieldKey())
->setLabel(pht('Repository'))
->setDatasource(new DiffusionRepositoryDatasource())
->setValue($repository_value)
->setLimit(1))
->setName(id(new DifferentialRepositoryField())->getFieldKey())
->setLabel(pht('Repository'))
->setDatasource(new DiffusionRepositoryDatasource())
->setValue($repository_value)
->setLimit(1))
->appendChild(
id(new AphrontFormPolicyControl())
->setUser($viewer)
->setName('viewPolicy')
->setPolicyObject($diff_object)
->setPolicies($policies)
->setCapability(PhabricatorPolicyCapability::CAN_VIEW))
->setUser($viewer)
->setName('viewPolicy')
->setPolicyObject($diff_object)
->setPolicies($policies)
->setCapability(PhabricatorPolicyCapability::CAN_VIEW))
->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton($cancel_uri)

View file

@ -49,15 +49,12 @@ final class DifferentialProjectsField
$this->setValue($request->getArr($this->getFieldKey()));
}
public function getRequiredHandlePHIDsForEdit() {
return $this->getValue();
}
public function renderEditControl(array $handles) {
return id(new AphrontFormTokenizerControl())
->setUser($this->getViewer())
->setName($this->getFieldKey())
->setDatasource(new PhabricatorProjectDatasource())
->setValue($handles)
->setValue($this->getValue())
->setLabel($this->getFieldName());
}

View file

@ -32,25 +32,18 @@ final class DifferentialRepositoryField
$this->setValue(nonempty($first, null));
}
public function getRequiredHandlePHIDsForEdit() {
$phids = array();
if ($this->getValue()) {
$phids[] = $this->getValue();
}
return $phids;
}
public function renderEditControl(array $handles) {
if ($this->getValue()) {
$control_value = array_select_keys($handles, array($this->getValue()));
$value = array($this->getValue());
} else {
$control_value = array();
$value = array();
}
return id(new AphrontFormTokenizerControl())
->setUser($this->getViewer())
->setName($this->getFieldKey())
->setDatasource(new DiffusionRepositoryDatasource())
->setValue($control_value)
->setValue($value)
->setError($this->getFieldError())
->setLabel($this->getFieldName())
->setLimit(1);

View file

@ -62,19 +62,17 @@ final class DifferentialReviewersField
$this->setValue($new_status);
}
public function getRequiredHandlePHIDsForEdit() {
public function renderEditControl(array $handles) {
$phids = array();
if ($this->getValue()) {
$phids = mpull($this->getValue(), 'getReviewerPHID');
}
return $phids;
}
public function renderEditControl(array $handles) {
return id(new AphrontFormTokenizerControl())
->setUser($this->getViewer())
->setName($this->getFieldKey())
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setValue($handles)
->setValue($phids)
->setError($this->getFieldError())
->setLabel($this->getFieldName());
}

View file

@ -37,15 +37,12 @@ final class DifferentialSubscribersField
$this->setValue($request->getArr($this->getFieldKey()));
}
public function getRequiredHandlePHIDsForEdit() {
return $this->getValue();
}
public function renderEditControl(array $handles) {
return id(new AphrontFormTokenizerControl())
->setUser($this->getViewer())
->setName($this->getFieldKey())
->setDatasource(new PhabricatorMetaMTAMailableDatasource())
->setValue($handles)
->setValue($this->getValue())
->setError($this->getFieldError())
->setLabel($this->getFieldName());
}

View file

@ -124,51 +124,37 @@ final class DifferentialRevisionSearchEngine
$repository_phids = $saved->getParameter('repositoryPHIDs', array());
$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
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Responsible Users'))
->setName('responsibles')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue(array_select_keys($handles, $responsible_phids)))
->appendChild(
->setValue($responsible_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Authors'))
->setName('authors')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue(array_select_keys($handles, $author_phids)))
->appendChild(
->setValue($author_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Reviewers'))
->setName('reviewers')
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setValue(array_select_keys($handles, $reviewer_phids)))
->appendChild(
->setValue($reviewer_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Subscribers'))
->setName('subscribers')
->setDatasource(new PhabricatorMetaMTAMailableDatasource())
->setValue(array_select_keys($handles, $subscriber_phids)))
->appendChild(
->setValue($subscriber_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Repositories'))
->setName('repositories')
->setDatasource(new DiffusionRepositoryDatasource())
->setValue(array_select_keys($handles, $repository_phids)))
->setValue($repository_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Status'))

View file

@ -80,7 +80,7 @@ final class DifferentialAddCommentView extends AphrontView {
->setValue($action)
->setID('comment-action')
->setOptions($this->actions))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel($enable_reviewers ? $add_reviewers_labels[$action] :
$add_reviewers_labels['add_reviewers'])
@ -89,7 +89,7 @@ final class DifferentialAddCommentView extends AphrontView {
->setControlStyle($enable_reviewers ? null : 'display: none')
->setID('add-reviewers-tokenizer')
->setDisableBehavior(true))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Add Subscribers'))
->setName('ccs')

View file

@ -687,7 +687,7 @@ final class DiffusionCommitController extends DiffusionController {
->setName('action')
->setID('audit-action')
->setOptions($actions))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Add Auditors'))
->setName('auditors')
@ -695,7 +695,7 @@ final class DiffusionCommitController extends DiffusionController {
->setControlStyle('display: none')
->setID('add-auditors-tokenizer')
->setDisableBehavior(true))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Add CCs'))
->setName('ccs')

View file

@ -15,13 +15,11 @@ final class DiffusionCommitEditController extends DiffusionController {
return new Aphront404Response();
}
$commit_phid = $commit->getPHID();
$edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$commit_phid = $commit->getPHID();
$edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST;
$current_proj_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$commit_phid,
$edge_type);
$handles = $this->loadViewerHandles($current_proj_phids);
$proj_t_values = $handles;
if ($request->isFormPost()) {
$xactions = array();
@ -36,18 +34,18 @@ final class DiffusionCommitEditController extends DiffusionController {
->setContentSourceFromRequest($request);
$xactions = $editor->applyTransactions($commit, $xactions);
return id(new AphrontRedirectResponse())
->setURI('/r'.$callsign.$commit->getCommitIdentifier());
->setURI('/r'.$callsign.$commit->getCommitIdentifier());
}
$tokenizer_id = celerity_generate_unique_node_id();
$form = id(new AphrontFormView())
->setUser($user)
->setAction($request->getRequestURI()->getPath())
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
->setValue($proj_t_values)
->setValue($current_proj_phids)
->setID($tokenizer_id)
->setCaption(
javelin_tag(

View file

@ -24,7 +24,6 @@ final class DiffusionLintController extends DiffusionController {
} else {
$owners = array(head($request->getArr('owner')));
}
$owner_handles = $this->loadViewerHandles($owners);
}
$codes = $this->loadLintCodes($owners);
@ -108,13 +107,13 @@ final class DiffusionLintController extends DiffusionController {
$form = id(new AphrontFormView())
->setUser($user)
->setMethod('GET')
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setLimit(1)
->setName('owner')
->setLabel(pht('Owner'))
->setValue($owner_handles))
->setValue($owners))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Filter'));

View file

@ -92,7 +92,6 @@ final class DiffusionRepositoryEditBasicController
$crumbs->addTextCrumb(pht('Edit Basics'));
$title = pht('Edit %s', $repository->getName());
$project_handles = $this->loadViewerHandles($repository->getProjectPHIDs());
$form = id(new AphrontFormView())
->setUser($user)
@ -123,12 +122,12 @@ final class DiffusionRepositoryEditBasicController
->setName('description')
->setLabel(pht('Description'))
->setValue($v_desc))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setName('projectPHIDs')
->setLabel(pht('Projects'))
->setValue($project_handles))
->setValue($repository->getProjectPHIDs()))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Save'))

View file

@ -68,30 +68,21 @@ final class PhabricatorFeedSearchEngine
$user_phids = $saved_query->getParameter('userPHIDs', 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');
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('users')
->setLabel(pht('Include Users'))
->setValue($user_handles))
->appendChild(
->setValue($user_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setName('projectPHIDs')
->setLabel(pht('Include Projects'))
->setValue($proj_handles))
->setValue($proj_phids))
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(

View file

@ -54,21 +54,16 @@ final class PhabricatorFileSearchEngine
AphrontFormView $form,
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());
$explicit = $saved_query->getParameter('explicit');
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(

View file

@ -138,12 +138,6 @@ final class FundInitiativeEditController
->setObject($initiative)
->execute();
if ($v_projects) {
$project_handles = $this->loadViewerHandles($v_projects);
} else {
$project_handles = array();
}
$merchants = id(new PhortuneMerchantQuery())
->setViewer($viewer)
->requireCapabilities(
@ -210,11 +204,11 @@ final class FundInitiativeEditController
->setName('risks')
->setLabel(pht('Risks/Challenges'))
->setValue($v_risk))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
->setValue($project_handles)
->setValue($v_projects)
->setDatasource(new PhabricatorProjectDatasource()))
->appendChild(
id(new AphrontFormPolicyControl())

View file

@ -56,26 +56,15 @@ final class FundBackerSearchEngine
AphrontFormView $form,
PhabricatorSavedQuery $saved) {
$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
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Backers'))
->setName('backers')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue(array_select_keys($handles, $backer_phids)));
->setValue($backer_phids));
}
protected function getURI($path) {

View file

@ -51,16 +51,6 @@ final class FundInitiativeSearchEngine
$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_control = id(new AphrontFormCheckboxControl())
->setLabel(pht('Statuses'));
@ -73,12 +63,12 @@ final class FundInitiativeSearchEngine
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Owners'))
->setName('owners')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue(array_select_keys($handles, $owner_phids)))
->setValue($owner_phids))
->appendChild($status_control);
}

View file

@ -68,12 +68,7 @@ final class HarbormasterStepEditController extends HarbormasterController {
$e_description = true;
$v_description = $step->getDescription();
$e_depends_on = true;
$raw_depends_on = $step->getDetail('dependsOn', array());
$v_depends_on = id(new PhabricatorHandleQuery())
->setViewer($viewer)
->withPHIDs($raw_depends_on)
->execute();
$v_depends_on = $step->getDetail('dependsOn', array());
$errors = array();
$validation_exception = null;
@ -138,7 +133,7 @@ final class HarbormasterStepEditController extends HarbormasterController {
->setValue($v_name));
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(id(new HarbormasterBuildDependencyDatasource())
->setParameters(array(

View file

@ -58,22 +58,17 @@ final class HeraldRuleSearchEngine extends PhabricatorApplicationSearchEngine {
AphrontFormView $form,
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());
$content_type = $saved_query->getParameter('contentType');
$rule_type = $saved_query->getParameter('ruleType');
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setName('contentType')

View file

@ -117,15 +117,14 @@ final class LegalpadDocumentSignatureAddController extends LegalpadController {
->setUser($viewer);
if ($is_individual) {
$user_handles = $this->loadViewerHandles($v_users);
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Exempt User'))
->setName('users')
->setLimit(1)
->setDatasource(new PhabricatorPeopleDatasource())
->setValue($user_handles)
->setValue($v_users)
->setError($e_user));
} else {
$form

View file

@ -73,11 +73,6 @@ final class LegalpadDocumentSearchEngine
$creator_phids = $saved_query->getParameter('creatorPHIDs', array());
$contributor_phids = $saved_query->getParameter(
'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');
if (!$this->requireViewer()->getPHID()) {
@ -93,18 +88,18 @@ final class LegalpadDocumentSearchEngine
pht('Show only documents I have signed.'),
$viewer_signature)
->setDisabled(!$this->requireViewer()->getPHID()))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('creators')
->setLabel(pht('Creators'))
->setValue(array_select_keys($handles, $creator_phids)))
->appendChild(
->setValue($creator_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('contributors')
->setLabel(pht('Contributors'))
->setValue(array_select_keys($handles, $contributor_phids)));
->setValue($contributor_phids));
$this->buildDateRange(
$form,

View file

@ -77,32 +77,26 @@ final class LegalpadDocumentSignatureSearchEngine
$document_phids = $saved_query->getParameter('documentPHIDs', 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) {
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new LegalpadDocumentDatasource())
->setName('documents')
->setLabel(pht('Documents'))
->setValue(array_select_keys($handles, $document_phids)));
->setValue($document_phids));
}
$name_contains = $saved_query->getParameter('nameContains', '');
$email_contains = $saved_query->getParameter('emailContains', '');
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('signers')
->setLabel(pht('Signers'))
->setValue(array_select_keys($handles, $signer_phids)))
->setValue($signer_phids))
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Name Contains'))

View file

@ -44,8 +44,9 @@ final class PhabricatorMacroMemeDialogController
}
}
$view = id(new PHUIFormLayoutView())
->appendChild(
$view = id(new AphrontFormView())
->setUser($user)
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Macro'))
->setName('macro')
@ -66,9 +67,9 @@ final class PhabricatorMacroMemeDialogController
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Create Meme'))
->appendChild($view)
->appendForm($view)
->addCancelButton('/')
->addSubmitButton(pht('rofllolo!!~'));
->addSubmitButton(pht('Llama Diorama'));
return id(new AphrontDialogResponse())->setDialog($dialog);
}

View file

@ -74,12 +74,7 @@ final class PhabricatorMacroSearchEngine
AphrontFormView $form,
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());
$status = $saved_query->getParameter('status');
$names = implode(', ', $saved_query->getParameter('names', array()));
$like = $saved_query->getParameter('nameLike');
@ -92,12 +87,12 @@ final class PhabricatorMacroSearchEngine
->setLabel(pht('Status'))
->setOptions(PhabricatorMacroQuery::getStatusOptions())
->setValue($status))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormTextControl())
->setName('nameLike')

View file

@ -320,13 +320,14 @@ final class ManiphestReportController extends ManiphestController {
$form = id(new AphrontFormView())
->setUser($user)
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setLabel(pht('Project'))
->setLimit(1)
->setName('set_project')
->setValue($tokens));
// TODO: This is silly, but this is Maniphest reports.
->setValue(mpull($tokens, 'getPHID')));
if ($has_window) {
list($window_str, $ignored, $window_error) = $this->getWindow();

View file

@ -202,7 +202,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setControlID('resolution')
->setControlStyle('display: none')
->setOptions($resolution_types))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Assign To'))
->setName('assign_to')
@ -210,7 +210,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setControlStyle('display: none')
->setID('assign-tokenizer')
->setDisableBehavior(true))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('CCs'))
->setName('ccs')
@ -226,7 +226,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setControlID('priority')
->setControlStyle('display: none')
->setValue($task->getPriority()))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')

View file

@ -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;
if ($errors) {
$error_view = new PHUIInfoView();
@ -529,19 +515,19 @@ final class ManiphestTaskEditController extends ManiphestController {
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
if ($task->getOwnerPHID()) {
$assigned_value = array($handles[$task->getOwnerPHID()]);
$assigned_value = array($task->getOwnerPHID());
} else {
$assigned_value = array();
}
if ($task->getSubscriberPHIDs()) {
$cc_value = array_select_keys($handles, $task->getSubscriberPHIDs());
$cc_value = $task->getSubscriberPHIDs();
} else {
$cc_value = array();
}
if ($task->getProjectPHIDs()) {
$projects_value = array_select_keys($handles, $task->getProjectPHIDs());
$projects_value = $task->getProjectPHIDs();
} else {
$projects_value = array();
}
@ -583,7 +569,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Parent Task'))
->setValue($handles[$parent_task->getPHID()]->getFullName()))
->setValue($user->renderHandle($parent_task->getPHID())))
->addHiddenInput('parent', $parent_task->getID());
}
@ -620,7 +606,7 @@ final class ManiphestTaskEditController extends ManiphestController {
->execute();
if ($can_edit_assign) {
$form->appendChild(
$form->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Assigned To'))
->setName('assigned_to')
@ -631,7 +617,7 @@ final class ManiphestTaskEditController extends ManiphestController {
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('CC'))
->setName('cc')
@ -680,7 +666,7 @@ final class ManiphestTaskEditController extends ManiphestController {
pht('Create New Project'));
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')

View file

@ -258,34 +258,6 @@ final class ManiphestTaskSearchEngine
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_no_projects = $saved->getParameter('withNoProject');
@ -320,7 +292,9 @@ final class ManiphestTaskSearchEngine
->setOptions(array(
'' => pht('Show All 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())
->setLabel(pht('Blocked'))
->setName('blocked')
@ -328,7 +302,8 @@ final class ManiphestTaskSearchEngine
->setOptions(array(
'' => pht('Show All 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());
@ -337,12 +312,12 @@ final class ManiphestTaskSearchEngine
$all_orders = $builtin_orders + $custom_orders;
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('assigned')
->setLabel(pht('Assigned To'))
->setValue($assigned_handles))
->setValue($assigned_phids))
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(
@ -350,12 +325,12 @@ final class ManiphestTaskSearchEngine
1,
pht('Show only unassigned tasks.'),
$with_unassigned))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setName('allProjects')
->setLabel(pht('In All Projects'))
->setValue($all_project_handles));
->setValue($all_project_phids));
if (!$this->getIsBoardView()) {
$form
@ -369,36 +344,36 @@ final class ManiphestTaskSearchEngine
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setName('anyProjects')
->setLabel(pht('In Any Project'))
->setValue($any_project_handles))
->appendChild(
->setValue($any_project_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setName('excludeProjects')
->setLabel(pht('Not In Projects'))
->setValue($exclude_project_handles))
->appendChild(
->setValue($exclude_project_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('userProjects')
->setLabel(pht('In Users\' Projects'))
->setValue($user_project_handles))
->appendChild(
->setValue($user_project_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->appendChild(
->setValue($author_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorMetaMTAMailableDatasource())
->setName('subscribers')
->setLabel(pht('Subscribers'))
->setValue($subscriber_handles))
->setValue($subscriber_phids))
->appendChild(
id(new AphrontFormTextControl())
->setName('fulltext')

View file

@ -301,15 +301,13 @@ final class PhabricatorMetaMTAApplicationEmailPanel
$default_user = $email_object->getConfigValue($default_user_key);
if ($default_user) {
$default_user_handle = id(new PhabricatorHandleQuery())
->setViewer($viewer)
->withPHIDs(array($default_user))
->execute();
$default_user_value = array($default_user);
} else {
$default_user_handle = array();
$default_user_value = array();
}
$form = id(new PHUIFormLayoutView())
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Email'))
@ -317,13 +315,13 @@ final class PhabricatorMetaMTAApplicationEmailPanel
->setValue($email_object->getAddress())
->setCaption(PhabricatorUserEmail::describeAllowedAddresses())
->setError($e_email))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('Default Author'))
->setName($default_user_key)
->setLimit(1)
->setValue($default_user_handle)
->setValue($default_user_value)
->setCaption(pht(
'Used if the "From:" address does not map to a known account.')));
if ($is_new) {
@ -336,7 +334,7 @@ final class PhabricatorMetaMTAApplicationEmailPanel
->setWidth(AphrontDialogView::WIDTH_FORM)
->setTitle($title)
->appendChild($errors)
->appendChild($form)
->appendForm($form)
->addSubmitButton(pht('Save'))
->addCancelButton($uri);

View file

@ -36,19 +36,15 @@ final class PhabricatorOAuthServerClientSearchEngine
AphrontFormView $form,
PhabricatorSavedQuery $saved_query) {
$phids = $saved_query->getParameter('creatorPHIDs', array());
$creator_handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($phids)
->execute();
$creator_phids = $saved_query->getParameter('creatorPHIDs', array());
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('creators')
->setLabel(pht('Creators'))
->setValue($creator_handles));
->setValue($creator_phids));
}
protected function getURI($path) {

View file

@ -114,17 +114,13 @@ final class PhabricatorOwnersEditController
}
}
$handles = $this->loadViewerHandles($owners);
$primary = $package->getPrimaryOwnerPHID();
if ($primary && isset($handles[$primary])) {
$handle_primary_owner = array($handles[$primary]);
if ($primary) {
$value_primary_owner = array($primary);
} else {
$handle_primary_owner = array();
$value_primary_owner = array();
}
$handles_all_owners = array_select_keys($handles, $owners);
if ($package->getID()) {
$title = pht('Edit Package');
$side_nav_filter = 'edit/'.$this->id;
@ -182,20 +178,20 @@ final class PhabricatorOwnersEditController
->setName('name')
->setValue($package->getName())
->setError($e_name))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setLabel(pht('Primary Owner'))
->setName('primary')
->setLimit(1)
->setValue($handle_primary_owner)
->setValue($value_primary_owner)
->setError($e_primary))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setLabel(pht('Owners'))
->setName('owners')
->setValue($handles_all_owners))
->setValue($owners))
->appendChild(
id(new AphrontFormSelectControl())
->setName('auditing')

View file

@ -148,13 +148,7 @@ final class PhabricatorOwnersListController
$filter = new AphrontListFilterView();
$owners_search_value = array();
if ($request->getArr('owner')) {
$phids = $request->getArr('owner');
$phid = reset($phids);
$handles = $this->loadViewerHandles(array($phid));
$owners_search_value = array($handles[$phid]);
}
$owner_phids = $request->getArr('owner');
$callsigns = array('' => pht('(Any Repository)'));
$repositories = id(new PhabricatorRepositoryQuery())
@ -175,13 +169,13 @@ final class PhabricatorOwnersListController
->setName('name')
->setLabel(pht('Name'))
->setValue($request->getStr('name')))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectOrUserDatasource())
->setLimit(1)
->setName('owner')
->setLabel(pht('Owner'))
->setValue($owners_search_value))
->setValue($owner_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setName('repository')

View file

@ -188,17 +188,11 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
->setPolicies($policies)
->setName('can_edit'));
if ($v_projects) {
$project_handles = $this->loadViewerHandles($v_projects);
} else {
$project_handles = array();
}
$form->appendChild(
$form->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
->setValue($project_handles)
->setValue($v_projects)
->setDatasource(new PhabricatorProjectDatasource()));
$form

View file

@ -52,11 +52,7 @@ final class PhabricatorPasteSearchEngine
public function buildSearchForm(
AphrontFormView $form,
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());
$languages = $saved_query->getParameter('languages', array());
$no_language = false;
@ -69,12 +65,12 @@ final class PhabricatorPasteSearchEngine
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormTextControl())
->setName('languages')

View file

@ -89,22 +89,6 @@ final class PhabricatorPeopleLogSearchEngine
$actor_phids = $saved->getParameter('actorPHIDs', 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());
$remote_prefix = $saved->getParameter('ip');
$sessions = $saved->getParameter('sessions', array());
@ -122,18 +106,18 @@ final class PhabricatorPeopleLogSearchEngine
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('actors')
->setLabel(pht('Actors'))
->setValue($actor_handles))
->appendChild(
->setValue($actor_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('users')
->setLabel(pht('Users'))
->setValue($user_handles))
->setValue($user_phids))
->appendChild($action_control)
->appendChild(
id(new AphrontFormTextControl())

View file

@ -245,11 +245,6 @@ final class PholioMockEditController extends PholioController {
$mock->setViewPolicy($v_view);
$mock->setEditPolicy($v_edit);
$handles = id(new PhabricatorHandleQuery())
->setViewer($user)
->withPHIDs($v_cc)
->execute();
$image_elements = array();
if ($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');
$form = id(new AphrontFormView())
->setUser($user)
@ -342,17 +331,17 @@ final class PholioMockEditController extends PholioController {
}
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
->setValue($project_handles)
->setValue($v_projects)
->setDatasource(new PhabricatorProjectDatasource()))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('CC'))
->setName('cc')
->setValue($handles)
->setValue($v_cc)
->setUser($user)
->setDatasource(new PhabricatorMetaMTAMailableDatasource()))
->appendChild(

View file

@ -37,11 +37,7 @@ final class PholioMockSearchEngine extends PhabricatorApplicationSearchEngine {
AphrontFormView $form,
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());
$statuses = array(
'' => pht('Any Status'),
@ -53,12 +49,12 @@ final class PholioMockSearchEngine extends PhabricatorApplicationSearchEngine {
$status = head($status);
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Status'))

View file

@ -97,8 +97,6 @@ final class PhortuneAccountEditController extends PhortuneController {
$submit_button = pht('Save Changes');
}
$member_handles = $this->loadViewerHandles($v_members);
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
@ -107,12 +105,12 @@ final class PhortuneAccountEditController extends PhortuneController {
->setLabel(pht('Name'))
->setValue($v_name)
->setError($e_name))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('Members'))
->setName('memberPHIDs')
->setValue($member_handles)
->setValue($v_members)
->setError($e_members))
->appendChild(
id(new AphrontFormSubmitControl())

View file

@ -119,8 +119,6 @@ final class PhortuneMerchantEditController
->setObject($merchant)
->execute();
$member_handles = $this->loadViewerHandles($v_members);
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
@ -135,12 +133,12 @@ final class PhortuneMerchantEditController
->setName('desc')
->setLabel(pht('Description'))
->setValue($v_desc))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setLabel(pht('Members'))
->setName('memberPHIDs')
->setValue($member_handles)
->setValue($v_members)
->setError($e_members))
->appendChild(
id(new AphrontFormPolicyControl())

View file

@ -60,19 +60,13 @@ final class PhrequentSearchEngine extends PhabricatorApplicationSearchEngine {
$order = $saved_query->getParameter(
'order', PhrequentUserTimeQuery::ORDER_ENDED_DESC);
$phids = array_merge($user_phids);
$handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($phids)
->execute();
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('users')
->setLabel(pht('Users'))
->setValue($handles))
->setValue($user_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Ended'))

View file

@ -105,17 +105,11 @@ final class PonderQuestionEditController extends PonderController {
->setLabel(pht('Description'))
->setUser($user));
if ($v_projects) {
$project_handles = $this->loadViewerHandles($v_projects);
} else {
$project_handles = array();
}
$form->appendChild(
$form->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
->setValue($project_handles)
->setValue($v_projects)
->setDatasource(new PhabricatorProjectDatasource()));
$form ->appendChild(

View file

@ -64,25 +64,19 @@ final class PonderQuestionSearchEngine
$status = $saved_query->getParameter(
'status', PonderQuestionStatus::STATUS_OPEN);
$phids = array_merge($author_phids, $answerer_phids);
$handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($phids)
->execute();
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue(array_select_keys($handles, $author_phids)))
->appendChild(
->setValue($author_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('answerers')
->setLabel(pht('Answered By'))
->setValue(array_select_keys($handles, $answerer_phids)))
->setValue($answerer_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Status'))

View file

@ -74,6 +74,7 @@ final class PhabricatorProjectBoardImportController
->setDatasource(id(new PhabricatorProjectDatasource())
->setParameters(array('mustHaveColumns' => true))
->setLimit(1));
return $this->newDialog()
->setTitle(pht('Import Columns'))
->setWidth(AphrontDialogView::WIDTH_FORM)

View file

@ -88,7 +88,7 @@ final class PhabricatorProjectMembersEditController
$form = new AphrontFormView();
$form
->setUser($user)
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('phids')
->setLabel(pht('Add Members'))

View file

@ -77,11 +77,7 @@ final class PhabricatorProjectSearchEngine
AphrontFormView $form,
PhabricatorSavedQuery $saved) {
$phids = $saved->getParameter('memberPHIDs', array());
$member_handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($phids)
->execute();
$member_phids = $saved->getParameter('memberPHIDs', array());
$status = $saved->getParameter('status');
$name_match = $saved->getParameter('name');
@ -123,12 +119,12 @@ final class PhabricatorProjectSearchEngine
->setName('name')
->setLabel(pht('Name'))
->setValue($name_match))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('members')
->setLabel(pht('Members'))
->setValue($member_handles))
->setValue($member_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setLabel(pht('Status'))

View file

@ -120,13 +120,6 @@ final class ReleephProductEditController extends ReleephProductController {
'pushers',
$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())
->setUser($request->getUser())
->appendChild(
@ -191,12 +184,12 @@ final class ReleephProductEditController extends ReleephProductController {
->addStatic('projectName', $product->getName());
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Pushers'))
->setName('pushers')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue($pusher_handles))
->setValue($pusher_phids))
->appendChild($branch_template_input)
->appendChild($branch_template_preview)
->appendRemarkupInstructions($this->getBranchHelpText());

View file

@ -67,11 +67,7 @@ final class ReleephRequestSearchEngine
AphrontFormView $form,
PhabricatorSavedQuery $saved_query) {
$phids = $saved_query->getParameter('requestorPHIDs', array());
$requestor_handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($phids)
->execute();
$requestor_phids = $saved_query->getParameter('requestorPHIDs', array());
$form
->appendChild(
@ -86,12 +82,12 @@ final class ReleephRequestSearchEngine
->setLabel(pht('Severity'))
->setValue($saved_query->getParameter('severity'))
->setOptions($this->getSeverityOptions()))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('requestors')
->setLabel(pht('Requestors'))
->setValue($requestor_handles));
->setValue($requestor_phids));
}
protected function getURI($path) {

View file

@ -59,10 +59,7 @@ final class PhabricatorRepositoryArcanistProjectEditController
}
if ($project->getSymbolIndexProjects()) {
$uses = id(new PhabricatorHandleQuery())
->setViewer($user)
->withPHIDs($project->getSymbolIndexProjects())
->execute();
$uses = $project->getSymbolIndexProjects();
} else {
$uses = array();
}
@ -91,7 +88,7 @@ final class PhabricatorRepositoryArcanistProjectEditController
'Separate with commas, for example: %s',
phutil_tag('tt', array(), 'php, py')))
->setValue($langs))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Uses Symbols From'))
->setName('symbolIndexProjects')

View file

@ -55,35 +55,19 @@ final class PhabricatorRepositoryPushLogSearchEngine
$repository_phids = $saved_query->getParameter('repositoryPHIDs', 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
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new DiffusionRepositoryDatasource())
->setName('repositories')
->setLabel(pht('Repositories'))
->setValue($repository_handles))
->appendChild(
->setValue($repository_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('pushers')
->setLabel(pht('Pushers'))
->setValue($pusher_handles));
->setValue($pusher_phids));
}
protected function getURI($path) {

View file

@ -84,15 +84,6 @@ final class PhabricatorRepositorySearchEngine
$name = $saved_query->getParameter('name');
$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
->appendChild(
id(new AphrontFormTextControl())
@ -104,12 +95,12 @@ final class PhabricatorRepositorySearchEngine
->setName('name')
->setLabel(pht('Name Contains'))
->setValue($name))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorProjectDatasource())
->setName('anyProjects')
->setLabel(pht('In Any Project'))
->setValue($any_project_handles))
->setValue($any_project_phids))
->appendChild(
id(new AphrontFormSelectControl())
->setName('status')

View file

@ -66,22 +66,6 @@ final class PhabricatorSearchApplicationSearchEngine
$subscriber_phids = $saved->getParameter('subscriberPHIDs', 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());
$status_values = $saved->getParameter('statuses', array());
@ -132,18 +116,18 @@ final class PhabricatorSearchApplicationSearchEngine
->setValue($saved->getParameter('query')))
->appendChild($status_control)
->appendChild($types_control)
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('authorPHIDs')
->setLabel('Authors')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue($author_handles))
->appendChild(
->setValue($author_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('ownerPHIDs')
->setLabel('Owners')
->setDatasource(new PhabricatorTypeaheadOwnerDatasource())
->setValue($owner_handles))
->setValue($owner_phids))
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(
@ -151,18 +135,18 @@ final class PhabricatorSearchApplicationSearchEngine
1,
pht('Show only unowned documents.'),
$with_unowned))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('subscriberPHIDs')
->setLabel('Subscribers')
->setDatasource(new PhabricatorPeopleDatasource())
->setValue($subscriber_handles))
->appendChild(
->setValue($subscriber_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('projectPHIDs')
->setLabel('In Any Project')
->setDatasource(new PhabricatorProjectDatasource())
->setValue($project_handles));
->setValue($project_phids));
}
protected function getURI($path) {

View file

@ -145,12 +145,6 @@ final class PhabricatorSlowvoteEditController
pht('Resolve issues and build consensus through '.
'protracted deliberation.'));
if ($v_projects) {
$project_handles = $this->loadViewerHandles($v_projects);
} else {
$project_handles = array();
}
$form = id(new AphrontFormView())
->setUser($user)
->appendChild($instructions)
@ -167,11 +161,11 @@ final class PhabricatorSlowvoteEditController
->setLabel(pht('Description'))
->setName('description')
->setValue($v_description))
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
->setValue($project_handles)
->setValue($v_projects)
->setDatasource(new PhabricatorProjectDatasource()));
if ($is_new) {

View file

@ -47,22 +47,18 @@ final class PhabricatorSlowvoteSearchEngine
public function buildSearchForm(
AphrontFormView $form,
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());
$voted = $saved_query->getParameter('voted', false);
$statuses = $saved_query->getParameter('statuses', array());
$form
->appendChild(
->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(new PhabricatorPeopleDatasource())
->setName('authors')
->setLabel(pht('Authors'))
->setValue($author_handles))
->setValue($author_phids))
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(

View file

@ -9,18 +9,14 @@ final class PhabricatorStandardCustomFieldUsers
public function renderEditControl(array $handles) {
$value = $this->getFieldValue();
if ($value) {
$control_value = array_select_keys($handles, $value);
} else {
$control_value = array();
}
$control = id(new AphrontFormTokenizerControl())
->setUser($this->getViewer())
->setLabel($this->getFieldName())
->setName($this->getFieldKey())
->setDatasource(new PhabricatorPeopleDatasource())
->setCaption($this->getCaption())
->setValue($control_value);
->setValue(nonempty($value, array()));
$limit = $this->getFieldConfigValue('limit');
if ($limit) {
@ -40,9 +36,9 @@ final class PhabricatorStandardCustomFieldUsers
->setLabel($this->getFieldName())
->setName($this->getFieldKey())
->setDatasource(new PhabricatorPeopleDatasource())
->setValue($handles);
->setValue(nonempty($value, array()));
$form->appendChild($control);
$form->appendControl($control);
}
public function getHeraldFieldValueType($condition) {

View file

@ -13,6 +13,7 @@ final class AphrontFormView extends AphrontView {
private $sigils = array();
private $metadata;
private $controls = array();
private $fullWidth = false;
public function setMetadata($metadata) {
$this->metadata = $metadata;
@ -63,6 +64,15 @@ final class AphrontFormView extends AphrontView {
return $this;
}
public function setFullWidth($full_width) {
$this->fullWidth = $full_width;
return $this;
}
public function getFullWidth() {
return $this->fullWidth;
}
public function appendInstructions($text) {
return $this->appendChild(
phutil_tag(
@ -83,6 +93,7 @@ final class AphrontFormView extends AphrontView {
public function buildLayoutView() {
return id(new PHUIFormLayoutView())
->setFullWidth($this->getFullWidth())
->appendChild($this->renderDataInputs())
->appendChild($this->renderChildren());
}