Page MenuHomePhabricator

D18866.id45250.diff
No OneTemporary

D18866.id45250.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -223,6 +223,7 @@
'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php',
'AuthManageProvidersCapability' => 'applications/auth/capability/AuthManageProvidersCapability.php',
'BulkParameterType' => 'applications/transactions/bulk/type/BulkParameterType.php',
+ 'BulkSelectParameterType' => 'applications/transactions/bulk/type/BulkSelectParameterType.php',
'BulkStringParameterType' => 'applications/transactions/bulk/type/BulkStringParameterType.php',
'CalendarTimeUtil' => 'applications/calendar/util/CalendarTimeUtil.php',
'CalendarTimeUtilTestCase' => 'applications/calendar/__tests__/CalendarTimeUtilTestCase.php',
@@ -5244,6 +5245,7 @@
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
'AuthManageProvidersCapability' => 'PhabricatorPolicyCapability',
'BulkParameterType' => 'Phobject',
+ 'BulkSelectParameterType' => 'BulkParameterType',
'BulkStringParameterType' => 'BulkParameterType',
'CalendarTimeUtil' => 'Phobject',
'CalendarTimeUtilTestCase' => 'PhabricatorTestCase',
diff --git a/src/applications/maniphest/editor/ManiphestEditEngine.php b/src/applications/maniphest/editor/ManiphestEditEngine.php
--- a/src/applications/maniphest/editor/ManiphestEditEngine.php
+++ b/src/applications/maniphest/editor/ManiphestEditEngine.php
@@ -201,6 +201,7 @@
id(new PhabricatorSelectEditField())
->setKey('status')
->setLabel(pht('Status'))
+ ->setBulkEditLabel(pht('Set status to'))
->setDescription(pht('Status of the task.'))
->setConduitDescription(pht('Change the task status.'))
->setConduitTypeDescription(pht('New task status constant.'))
@@ -213,6 +214,7 @@
id(new PhabricatorSelectEditField())
->setKey('priority')
->setLabel(pht('Priority'))
+ ->setBulkEditLabel(pht('Set priority to'))
->setDescription(pht('Priority of the task.'))
->setConduitDescription(pht('Change the priority of the task.'))
->setConduitTypeDescription(pht('New task priority constant.'))
diff --git a/src/applications/transactions/bulk/type/BulkParameterType.php b/src/applications/transactions/bulk/type/BulkParameterType.php
--- a/src/applications/transactions/bulk/type/BulkParameterType.php
+++ b/src/applications/transactions/bulk/type/BulkParameterType.php
@@ -3,6 +3,7 @@
abstract class BulkParameterType extends Phobject {
private $viewer;
+ private $field;
final public function setViewer(PhabricatorUser $viewer) {
$this->viewer = $viewer;
@@ -13,6 +14,15 @@
return $this->viewer;
}
+ final public function setField(PhabricatorEditField $field) {
+ $this->field = $field;
+ return $this;
+ }
+
+ final public function getField() {
+ return $this->field;
+ }
+
abstract public function getPHUIXControlType();
public function getPHUIXControlSpecification() {
diff --git a/src/applications/transactions/bulk/type/BulkSelectParameterType.php b/src/applications/transactions/bulk/type/BulkSelectParameterType.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/bulk/type/BulkSelectParameterType.php
@@ -0,0 +1,22 @@
+<?php
+
+final class BulkSelectParameterType
+ extends BulkParameterType {
+
+ public function getOptions() {
+ return $this->getField()->getOptions();
+ }
+
+ public function getPHUIXControlType() {
+ return 'select';
+ }
+
+ public function getPHUIXControlSpecification() {
+ return array(
+ 'options' => $this->getOptions(),
+ 'order' => array_keys($this->getOptions()),
+ 'value' => null,
+ );
+ }
+
+}
diff --git a/src/applications/transactions/editfield/PhabricatorEditField.php b/src/applications/transactions/editfield/PhabricatorEditField.php
--- a/src/applications/transactions/editfield/PhabricatorEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorEditField.php
@@ -643,7 +643,9 @@
return null;
}
- $type->setViewer($this->getViewer());
+ $type
+ ->setField($this)
+ ->setViewer($this->getViewer());
return $type;
}
diff --git a/src/applications/transactions/editfield/PhabricatorSelectEditField.php b/src/applications/transactions/editfield/PhabricatorSelectEditField.php
--- a/src/applications/transactions/editfield/PhabricatorSelectEditField.php
+++ b/src/applications/transactions/editfield/PhabricatorSelectEditField.php
@@ -54,6 +54,10 @@
return new ConduitStringParameterType();
}
+ protected function newBulkParameterType() {
+ return new BulkSelectParameterType();
+ }
+
private function getCanonicalValue($value) {
$options = $this->getOptions();
if (!isset($options[$value])) {

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 30, 1:00 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6728106
Default Alt Text
D18866.id45250.diff (4 KB)

Event Timeline