Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
index ce437f1a5d..1706b0a644 100644
--- a/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
+++ b/src/applications/badges/controller/PhabricatorBadgesEditRecipientsController.php
@@ -1,83 +1,72 @@
<?php
final class PhabricatorBadgesEditRecipientsController
extends PhabricatorBadgesController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$id = $request->getURIData('id');
$xactions = array();
$badge = id(new PhabricatorBadgesQuery())
->setViewer($viewer)
->withIDs(array($id))
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_EDIT,
PhabricatorPolicyCapability::CAN_VIEW,
))
->executeOne();
if (!$badge) {
return new Aphront404Response();
}
$view_uri = $this->getApplicationURI('recipients/'.$badge->getID().'/');
if ($request->isFormPost()) {
$award_phids = array();
$add_recipients = $request->getArr('phids');
if ($add_recipients) {
foreach ($add_recipients as $phid) {
$award_phids[] = $phid;
}
}
$xactions[] = id(new PhabricatorBadgesTransaction())
->setTransactionType(
PhabricatorBadgesBadgeAwardTransaction::TRANSACTIONTYPE)
->setNewValue($award_phids);
$editor = id(new PhabricatorBadgesEditor())
->setActor($viewer)
->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true)
->setContinueOnMissingFields(true)
->applyTransactions($badge, $xactions);
return id(new AphrontRedirectResponse())
->setURI($view_uri);
}
- $can_edit = PhabricatorPolicyFilter::hasCapability(
- $viewer,
- $badge,
- PhabricatorPolicyCapability::CAN_EDIT);
-
- $form_box = null;
- $title = pht('Add Recipient');
- if ($can_edit) {
- $header_name = pht('Edit Recipients');
-
- $form = new AphrontFormView();
- $form
- ->setUser($viewer)
- ->setFullWidth(true)
- ->appendControl(
- id(new AphrontFormTokenizerControl())
- ->setName('phids')
- ->setLabel(pht('Recipients'))
- ->setDatasource(new PhabricatorPeopleDatasource()));
- }
+ $form = new AphrontFormView();
+ $form
+ ->setUser($viewer)
+ ->setFullWidth(true)
+ ->appendControl(
+ id(new AphrontFormTokenizerControl())
+ ->setName('phids')
+ ->setLabel(pht('Recipients'))
+ ->setDatasource(new PhabricatorPeopleDatasource()));
$dialog = id(new AphrontDialogView())
->setUser($viewer)
->setTitle(pht('Add Recipients'))
->appendForm($form)
->addCancelButton($view_uri)
->addSubmitButton(pht('Add Recipients'));
return $dialog;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 1:12 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1144
Default Alt Text
(3 KB)

Event Timeline