1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 17:30:59 +01:00

Enable "Resign as Reviewer" from Differential Revision View UI

Summary:
Enable "Resign as Reviewer" from Differential Revision View UI

Test Plan:
Look at revision that I am a reviewer on and that I am not.

Reviewed By: epriestley
Reviewers: epriestley
CC: epriestley
Differential Revision: 120
This commit is contained in:
adonohue 2011-04-11 10:38:10 -07:00
parent a2a6509dc8
commit f9a59c9f49

View file

@ -428,6 +428,7 @@ class DifferentialRevisionViewController extends DifferentialController {
$viewer_phid = $this->getRequest()->getUser()->getPHID();
$viewer_is_owner = ($viewer_phid == $revision->getAuthorPHID());
$viewer_is_reviewer = in_array($viewer_phid, $revision->getReviewers());
if ($viewer_is_owner) {
switch ($revision->getStatus()) {
@ -450,9 +451,11 @@ class DifferentialRevisionViewController extends DifferentialController {
case DifferentialRevisionStatus::NEEDS_REVIEW:
$actions[DifferentialAction::ACTION_ACCEPT] = true;
$actions[DifferentialAction::ACTION_REJECT] = true;
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
break;
case DifferentialRevisionStatus::NEEDS_REVISION:
$actions[DifferentialAction::ACTION_ACCEPT] = true;
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
break;
case DifferentialRevisionStatus::ACCEPTED:
$actions[DifferentialAction::ACTION_REJECT] = true;