Page MenuHomePhabricator

D12224.id29371.diff
No OneTemporary

D12224.id29371.diff

diff --git a/src/applications/conpherence/controller/ConpherenceNewController.php b/src/applications/conpherence/controller/ConpherenceNewController.php
--- a/src/applications/conpherence/controller/ConpherenceNewController.php
+++ b/src/applications/conpherence/controller/ConpherenceNewController.php
@@ -53,25 +53,9 @@
}
}
-
- $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 @@
->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 @@
->setLabel(pht('Message'))
->setError($e_message));
- $dialog->appendChild($form);
+ $dialog->appendForm($form);
return id(new AphrontDialogResponse())->setDialog($dialog);
}
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -224,14 +224,14 @@
$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())
@@ -240,7 +240,7 @@
->addHiddenInput(
'latest_transaction_id',
$request->getInt('latest_transaction_id'))
- ->appendChild($form);
+ ->appendForm($form);
if ($request->getExists('minimal_display')) {
$view->addHiddenInput('minimal_display', true);
diff --git a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
--- a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
+++ b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
@@ -52,18 +52,15 @@
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) {
diff --git a/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php b/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
--- a/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
+++ b/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
@@ -40,21 +40,17 @@
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(
diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php
--- a/src/applications/differential/controller/DifferentialDiffCreateController.php
+++ b/src/applications/differential/controller/DifferentialDiffCreateController.php
@@ -28,7 +28,6 @@
// 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 @@
array(
'diff' => $diff,
'repositoryPHID' => $repository_phid,
- 'viewPolicy' => $request->getStr('viewPolicy'),));
+ 'viewPolicy' => $request->getStr('viewPolicy'),
+ ));
$call->setUser($viewer);
$result = $call->execute();
@@ -93,10 +93,6 @@
$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 @@
->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 @@
->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)
diff --git a/src/applications/differential/customfield/DifferentialProjectsField.php b/src/applications/differential/customfield/DifferentialProjectsField.php
--- a/src/applications/differential/customfield/DifferentialProjectsField.php
+++ b/src/applications/differential/customfield/DifferentialProjectsField.php
@@ -49,15 +49,12 @@
$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());
}
diff --git a/src/applications/differential/customfield/DifferentialRepositoryField.php b/src/applications/differential/customfield/DifferentialRepositoryField.php
--- a/src/applications/differential/customfield/DifferentialRepositoryField.php
+++ b/src/applications/differential/customfield/DifferentialRepositoryField.php
@@ -32,25 +32,18 @@
$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);
diff --git a/src/applications/differential/customfield/DifferentialReviewersField.php b/src/applications/differential/customfield/DifferentialReviewersField.php
--- a/src/applications/differential/customfield/DifferentialReviewersField.php
+++ b/src/applications/differential/customfield/DifferentialReviewersField.php
@@ -62,19 +62,17 @@
$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());
}
diff --git a/src/applications/differential/customfield/DifferentialSubscribersField.php b/src/applications/differential/customfield/DifferentialSubscribersField.php
--- a/src/applications/differential/customfield/DifferentialSubscribersField.php
+++ b/src/applications/differential/customfield/DifferentialSubscribersField.php
@@ -37,15 +37,12 @@
$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());
}
diff --git a/src/applications/differential/query/DifferentialRevisionSearchEngine.php b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
--- a/src/applications/differential/query/DifferentialRevisionSearchEngine.php
+++ b/src/applications/differential/query/DifferentialRevisionSearchEngine.php
@@ -124,51 +124,37 @@
$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'))
diff --git a/src/applications/differential/view/DifferentialAddCommentView.php b/src/applications/differential/view/DifferentialAddCommentView.php
--- a/src/applications/differential/view/DifferentialAddCommentView.php
+++ b/src/applications/differential/view/DifferentialAddCommentView.php
@@ -80,7 +80,7 @@
->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 @@
->setControlStyle($enable_reviewers ? null : 'display: none')
->setID('add-reviewers-tokenizer')
->setDisableBehavior(true))
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Add Subscribers'))
->setName('ccs')
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -687,7 +687,7 @@
->setName('action')
->setID('audit-action')
->setOptions($actions))
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Add Auditors'))
->setName('auditors')
@@ -695,7 +695,7 @@
->setControlStyle('display: none')
->setID('add-auditors-tokenizer')
->setDisableBehavior(true))
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Add CCs'))
->setName('ccs')
diff --git a/src/applications/diffusion/controller/DiffusionCommitEditController.php b/src/applications/diffusion/controller/DiffusionCommitEditController.php
--- a/src/applications/diffusion/controller/DiffusionCommitEditController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitEditController.php
@@ -15,13 +15,11 @@
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 @@
->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(
diff --git a/src/applications/diffusion/controller/DiffusionLintController.php b/src/applications/diffusion/controller/DiffusionLintController.php
--- a/src/applications/diffusion/controller/DiffusionLintController.php
+++ b/src/applications/diffusion/controller/DiffusionLintController.php
@@ -24,7 +24,6 @@
} else {
$owners = array(head($request->getArr('owner')));
}
- $owner_handles = $this->loadViewerHandles($owners);
}
$codes = $this->loadLintCodes($owners);
@@ -108,13 +107,13 @@
$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'));
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
@@ -92,7 +92,6 @@
$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 @@
->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'))
diff --git a/src/applications/feed/query/PhabricatorFeedSearchEngine.php b/src/applications/feed/query/PhabricatorFeedSearchEngine.php
--- a/src/applications/feed/query/PhabricatorFeedSearchEngine.php
+++ b/src/applications/feed/query/PhabricatorFeedSearchEngine.php
@@ -68,30 +68,21 @@
$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(
diff --git a/src/applications/files/query/PhabricatorFileSearchEngine.php b/src/applications/files/query/PhabricatorFileSearchEngine.php
--- a/src/applications/files/query/PhabricatorFileSearchEngine.php
+++ b/src/applications/files/query/PhabricatorFileSearchEngine.php
@@ -54,21 +54,16 @@
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(
diff --git a/src/applications/fund/controller/FundInitiativeEditController.php b/src/applications/fund/controller/FundInitiativeEditController.php
--- a/src/applications/fund/controller/FundInitiativeEditController.php
+++ b/src/applications/fund/controller/FundInitiativeEditController.php
@@ -138,12 +138,6 @@
->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 @@
->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())
diff --git a/src/applications/fund/query/FundBackerSearchEngine.php b/src/applications/fund/query/FundBackerSearchEngine.php
--- a/src/applications/fund/query/FundBackerSearchEngine.php
+++ b/src/applications/fund/query/FundBackerSearchEngine.php
@@ -56,26 +56,15 @@
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) {
diff --git a/src/applications/fund/query/FundInitiativeSearchEngine.php b/src/applications/fund/query/FundInitiativeSearchEngine.php
--- a/src/applications/fund/query/FundInitiativeSearchEngine.php
+++ b/src/applications/fund/query/FundInitiativeSearchEngine.php
@@ -51,16 +51,6 @@
$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 @@
}
$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);
}
diff --git a/src/applications/harbormaster/controller/HarbormasterStepEditController.php b/src/applications/harbormaster/controller/HarbormasterStepEditController.php
--- a/src/applications/harbormaster/controller/HarbormasterStepEditController.php
+++ b/src/applications/harbormaster/controller/HarbormasterStepEditController.php
@@ -68,12 +68,7 @@
$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 @@
->setValue($v_name));
$form
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setDatasource(id(new HarbormasterBuildDependencyDatasource())
->setParameters(array(
diff --git a/src/applications/herald/query/HeraldRuleSearchEngine.php b/src/applications/herald/query/HeraldRuleSearchEngine.php
--- a/src/applications/herald/query/HeraldRuleSearchEngine.php
+++ b/src/applications/herald/query/HeraldRuleSearchEngine.php
@@ -58,22 +58,17 @@
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')
diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignatureAddController.php b/src/applications/legalpad/controller/LegalpadDocumentSignatureAddController.php
--- a/src/applications/legalpad/controller/LegalpadDocumentSignatureAddController.php
+++ b/src/applications/legalpad/controller/LegalpadDocumentSignatureAddController.php
@@ -117,15 +117,14 @@
->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
diff --git a/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php b/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
--- a/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
+++ b/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
@@ -73,11 +73,6 @@
$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 @@
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,
diff --git a/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php b/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
--- a/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
+++ b/src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
@@ -77,32 +77,26 @@
$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'))
diff --git a/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php b/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php
--- a/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php
+++ b/src/applications/macro/controller/PhabricatorMacroMemeDialogController.php
@@ -44,8 +44,9 @@
}
}
- $view = id(new PHUIFormLayoutView())
- ->appendChild(
+ $view = id(new AphrontFormView())
+ ->setUser($user)
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Macro'))
->setName('macro')
@@ -66,9 +67,9 @@
$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);
}
diff --git a/src/applications/macro/query/PhabricatorMacroSearchEngine.php b/src/applications/macro/query/PhabricatorMacroSearchEngine.php
--- a/src/applications/macro/query/PhabricatorMacroSearchEngine.php
+++ b/src/applications/macro/query/PhabricatorMacroSearchEngine.php
@@ -74,12 +74,7 @@
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 @@
->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')
diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php
--- a/src/applications/maniphest/controller/ManiphestReportController.php
+++ b/src/applications/maniphest/controller/ManiphestReportController.php
@@ -320,13 +320,14 @@
$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();
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -202,7 +202,7 @@
->setControlID('resolution')
->setControlStyle('display: none')
->setOptions($resolution_types))
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Assign To'))
->setName('assign_to')
@@ -210,7 +210,7 @@
->setControlStyle('display: none')
->setID('assign-tokenizer')
->setDisableBehavior(true))
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('CCs'))
->setName('ccs')
@@ -226,7 +226,7 @@
->setControlID('priority')
->setControlStyle('display: none')
->setValue($task->getPriority()))
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -506,20 +506,6 @@
}
}
- $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 @@
$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 @@
->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 @@
->execute();
if ($can_edit_assign) {
- $form->appendChild(
+ $form->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Assigned To'))
->setName('assigned_to')
@@ -631,7 +617,7 @@
}
$form
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('CC'))
->setName('cc')
@@ -680,7 +666,7 @@
pht('Create New Project'));
}
$form
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setLabel(pht('Projects'))
->setName('projects')
diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
--- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
+++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php
@@ -258,34 +258,6 @@
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 @@
->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 @@
->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 @@
$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 @@
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 @@
}
$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')
diff --git a/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php b/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php
--- a/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php
+++ b/src/applications/metamta/applicationpanel/PhabricatorMetaMTAApplicationEmailPanel.php
@@ -301,15 +301,13 @@
$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 @@
->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 @@
->setWidth(AphrontDialogView::WIDTH_FORM)
->setTitle($title)
->appendChild($errors)
- ->appendChild($form)
+ ->appendForm($form)
->addSubmitButton(pht('Save'))
->addCancelButton($uri);
diff --git a/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php b/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php
--- a/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php
+++ b/src/applications/oauthserver/query/PhabricatorOAuthServerClientSearchEngine.php
@@ -36,19 +36,15 @@
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) {
diff --git a/src/applications/owners/controller/PhabricatorOwnersEditController.php b/src/applications/owners/controller/PhabricatorOwnersEditController.php
--- a/src/applications/owners/controller/PhabricatorOwnersEditController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersEditController.php
@@ -114,17 +114,13 @@
}
}
- $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 @@
->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')
diff --git a/src/applications/owners/controller/PhabricatorOwnersListController.php b/src/applications/owners/controller/PhabricatorOwnersListController.php
--- a/src/applications/owners/controller/PhabricatorOwnersListController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersListController.php
@@ -148,13 +148,7 @@
$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 @@
->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')
diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php
--- a/src/applications/paste/controller/PhabricatorPasteEditController.php
+++ b/src/applications/paste/controller/PhabricatorPasteEditController.php
@@ -188,17 +188,11 @@
->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
diff --git a/src/applications/paste/query/PhabricatorPasteSearchEngine.php b/src/applications/paste/query/PhabricatorPasteSearchEngine.php
--- a/src/applications/paste/query/PhabricatorPasteSearchEngine.php
+++ b/src/applications/paste/query/PhabricatorPasteSearchEngine.php
@@ -52,11 +52,7 @@
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 @@
}
$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')
diff --git a/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php b/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
--- a/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
+++ b/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
@@ -89,22 +89,6 @@
$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 @@
}
$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())
diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -245,11 +245,6 @@
$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 @@
),
));
- 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 @@
}
$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(
diff --git a/src/applications/pholio/query/PholioMockSearchEngine.php b/src/applications/pholio/query/PholioMockSearchEngine.php
--- a/src/applications/pholio/query/PholioMockSearchEngine.php
+++ b/src/applications/pholio/query/PholioMockSearchEngine.php
@@ -37,11 +37,7 @@
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 @@
$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'))
diff --git a/src/applications/phortune/controller/PhortuneAccountEditController.php b/src/applications/phortune/controller/PhortuneAccountEditController.php
--- a/src/applications/phortune/controller/PhortuneAccountEditController.php
+++ b/src/applications/phortune/controller/PhortuneAccountEditController.php
@@ -97,8 +97,6 @@
$submit_button = pht('Save Changes');
}
- $member_handles = $this->loadViewerHandles($v_members);
-
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
@@ -107,12 +105,12 @@
->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())
diff --git a/src/applications/phortune/controller/PhortuneMerchantEditController.php b/src/applications/phortune/controller/PhortuneMerchantEditController.php
--- a/src/applications/phortune/controller/PhortuneMerchantEditController.php
+++ b/src/applications/phortune/controller/PhortuneMerchantEditController.php
@@ -119,8 +119,6 @@
->setObject($merchant)
->execute();
- $member_handles = $this->loadViewerHandles($v_members);
-
$form = id(new AphrontFormView())
->setUser($viewer)
->appendChild(
@@ -135,12 +133,12 @@
->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())
diff --git a/src/applications/phrequent/query/PhrequentSearchEngine.php b/src/applications/phrequent/query/PhrequentSearchEngine.php
--- a/src/applications/phrequent/query/PhrequentSearchEngine.php
+++ b/src/applications/phrequent/query/PhrequentSearchEngine.php
@@ -60,19 +60,13 @@
$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'))
diff --git a/src/applications/ponder/controller/PonderQuestionEditController.php b/src/applications/ponder/controller/PonderQuestionEditController.php
--- a/src/applications/ponder/controller/PonderQuestionEditController.php
+++ b/src/applications/ponder/controller/PonderQuestionEditController.php
@@ -105,17 +105,11 @@
->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(
diff --git a/src/applications/ponder/query/PonderQuestionSearchEngine.php b/src/applications/ponder/query/PonderQuestionSearchEngine.php
--- a/src/applications/ponder/query/PonderQuestionSearchEngine.php
+++ b/src/applications/ponder/query/PonderQuestionSearchEngine.php
@@ -64,25 +64,19 @@
$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'))
diff --git a/src/applications/project/controller/PhabricatorProjectBoardImportController.php b/src/applications/project/controller/PhabricatorProjectBoardImportController.php
--- a/src/applications/project/controller/PhabricatorProjectBoardImportController.php
+++ b/src/applications/project/controller/PhabricatorProjectBoardImportController.php
@@ -74,6 +74,7 @@
->setDatasource(id(new PhabricatorProjectDatasource())
->setParameters(array('mustHaveColumns' => true))
->setLimit(1));
+
return $this->newDialog()
->setTitle(pht('Import Columns'))
->setWidth(AphrontDialogView::WIDTH_FORM)
diff --git a/src/applications/project/controller/PhabricatorProjectMembersEditController.php b/src/applications/project/controller/PhabricatorProjectMembersEditController.php
--- a/src/applications/project/controller/PhabricatorProjectMembersEditController.php
+++ b/src/applications/project/controller/PhabricatorProjectMembersEditController.php
@@ -88,7 +88,7 @@
$form = new AphrontFormView();
$form
->setUser($user)
- ->appendChild(
+ ->appendControl(
id(new AphrontFormTokenizerControl())
->setName('phids')
->setLabel(pht('Add Members'))
diff --git a/src/applications/project/query/PhabricatorProjectSearchEngine.php b/src/applications/project/query/PhabricatorProjectSearchEngine.php
--- a/src/applications/project/query/PhabricatorProjectSearchEngine.php
+++ b/src/applications/project/query/PhabricatorProjectSearchEngine.php
@@ -77,11 +77,7 @@
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 @@
->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'))
diff --git a/src/applications/releeph/controller/product/ReleephProductEditController.php b/src/applications/releeph/controller/product/ReleephProductEditController.php
--- a/src/applications/releeph/controller/product/ReleephProductEditController.php
+++ b/src/applications/releeph/controller/product/ReleephProductEditController.php
@@ -120,13 +120,6 @@
'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 @@
->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());
diff --git a/src/applications/releeph/query/ReleephRequestSearchEngine.php b/src/applications/releeph/query/ReleephRequestSearchEngine.php
--- a/src/applications/releeph/query/ReleephRequestSearchEngine.php
+++ b/src/applications/releeph/query/ReleephRequestSearchEngine.php
@@ -67,11 +67,7 @@
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 @@
->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) {
diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
--- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
@@ -59,10 +59,7 @@
}
if ($project->getSymbolIndexProjects()) {
- $uses = id(new PhabricatorHandleQuery())
- ->setViewer($user)
- ->withPHIDs($project->getSymbolIndexProjects())
- ->execute();
+ $uses = $project->getSymbolIndexProjects();
} else {
$uses = array();
}
@@ -91,7 +88,7 @@
'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')
diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
@@ -55,35 +55,19 @@
$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) {
diff --git a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositorySearchEngine.php
@@ -84,15 +84,6 @@
$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 @@
->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')
diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
--- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
+++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
@@ -66,22 +66,6 @@
$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 @@
->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 @@
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) {
diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
--- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
@@ -145,12 +145,6 @@
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 @@
->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) {
diff --git a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
--- a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
+++ b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
@@ -47,22 +47,18 @@
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(
diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
--- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
+++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php
@@ -9,18 +9,14 @@
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 @@
->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) {
diff --git a/src/view/form/AphrontFormView.php b/src/view/form/AphrontFormView.php
--- a/src/view/form/AphrontFormView.php
+++ b/src/view/form/AphrontFormView.php
@@ -13,6 +13,7 @@
private $sigils = array();
private $metadata;
private $controls = array();
+ private $fullWidth = false;
public function setMetadata($metadata) {
$this->metadata = $metadata;
@@ -63,6 +64,15 @@
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 @@
public function buildLayoutView() {
return id(new PHUIFormLayoutView())
+ ->setFullWidth($this->getFullWidth())
->appendChild($this->renderDataInputs())
->appendChild($this->renderChildren());
}

File Metadata

Mime Type
text/plain
Expires
Mon, May 13, 3:50 AM (3 w, 3 d ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/a2/xx/gohotmao6aauqfnx
Default Alt Text
D12224.id29371.diff (78 KB)

Event Timeline