Differential D17652 Diff 42455 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 118 Lines • ▼ Show 20 Lines | if ($this->isActionAvailable($revision, $viewer)) { | ||||
// 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); | ||||
// Show the options if the user can select on behalf of two or more | // 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. | // reviewers, or can force-accept on behalf of one or more reviewers, | ||||
// or can accept on behalf of a reviewer other than themselves (see | |||||
// T12533). | |||||
$can_multi = (count($options) > 1); | $can_multi = (count($options) > 1); | ||||
$can_force = (count($value) < count($options)); | $can_force = (count($value) < count($options)); | ||||
if ($can_multi || $can_force) { | $not_self = (head_key($options) != $viewer->getPHID()); | ||||
if ($can_multi || $can_force || $not_self) { | |||||
$field->setOptions($options); | $field->setOptions($options); | ||||
$field->setValue($value); | $field->setValue($value); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return $field; | return $field; | ||||
} | } | ||||
Show All 38 Lines |