Differential D17569 Diff 42273 src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionActionTransaction.php
| Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | if ($this->isActionAvailable($revision, $viewer)) { | ||||
| // technically permissible. For example, you could reasonably Reject | // technically permissible. For example, you could reasonably Reject | ||||
| // and Abandon a revision if "anyone can abandon anything" is enabled. | // and Abandon a revision if "anyone can abandon anything" is enabled. | ||||
| // It's not clear that these combinations are actually useful, so just | // It's not clear that these combinations are actually useful, so just | ||||
| // keep things simple for now. | // keep things simple for now. | ||||
| $field->setActionConflictKey('revision.action'); | $field->setActionConflictKey('revision.action'); | ||||
| list($options, $value) = $this->getActionOptions($viewer, $revision); | list($options, $value) = $this->getActionOptions($viewer, $revision); | ||||
| if (count($options) > 1) { | |||||
| // Show the options if the user can select on behalf of two or more | |||||
| // reviewers, or can force-accept on behalf of one or more reviewers. | |||||
| $can_multi = (count($options) > 1); | |||||
| $can_force = (count($value) < count($options)); | |||||
| if ($can_multi || $can_force) { | |||||
| $field->setOptions($options); | $field->setOptions($options); | ||||
| $field->setValue($value); | $field->setValue($value); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return $field; | return $field; | ||||
| } | } | ||||
| Show All 38 Lines | |||||