Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/constants/DifferentialAction.php
| Show All 16 Lines | final class DifferentialAction { | ||||
| const ACTION_CREATE = 'create'; | const ACTION_CREATE = 'create'; | ||||
| const ACTION_ADDREVIEWERS = 'add_reviewers'; | const ACTION_ADDREVIEWERS = 'add_reviewers'; | ||||
| const ACTION_ADDCCS = 'add_ccs'; | const ACTION_ADDCCS = 'add_ccs'; | ||||
| const ACTION_CLAIM = 'claim'; | const ACTION_CLAIM = 'claim'; | ||||
| const ACTION_REOPEN = 'reopen'; | const ACTION_REOPEN = 'reopen'; | ||||
| public static function getBasicStoryText($action, $author_name) { | public static function getBasicStoryText($action, $author_name) { | ||||
| switch ($action) { | switch ($action) { | ||||
| case DifferentialAction::ACTION_COMMENT: | case self::ACTION_COMMENT: | ||||
| $title = pht('%s commented on this revision.', | $title = pht('%s commented on this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_ACCEPT: | case self::ACTION_ACCEPT: | ||||
| $title = pht('%s accepted this revision.', | $title = pht('%s accepted this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_REJECT: | case self::ACTION_REJECT: | ||||
| $title = pht('%s requested changes to this revision.', | $title = pht('%s requested changes to this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_RETHINK: | case self::ACTION_RETHINK: | ||||
| $title = pht('%s planned changes to this revision.', | $title = pht('%s planned changes to this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_ABANDON: | case self::ACTION_ABANDON: | ||||
| $title = pht('%s abandoned this revision.', | $title = pht('%s abandoned this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_CLOSE: | case self::ACTION_CLOSE: | ||||
| $title = pht('%s closed this revision.', | $title = pht('%s closed this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_REQUEST: | case self::ACTION_REQUEST: | ||||
| $title = pht('%s requested a review of this revision.', | $title = pht('%s requested a review of this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_RECLAIM: | case self::ACTION_RECLAIM: | ||||
| $title = pht('%s reclaimed this revision.', | $title = pht('%s reclaimed this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_UPDATE: | case self::ACTION_UPDATE: | ||||
| $title = pht('%s updated this revision.', | $title = pht('%s updated this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_RESIGN: | case self::ACTION_RESIGN: | ||||
| $title = pht('%s resigned from this revision.', | $title = pht('%s resigned from this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_SUMMARIZE: | case self::ACTION_SUMMARIZE: | ||||
| $title = pht('%s summarized this revision.', | $title = pht('%s summarized this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_TESTPLAN: | case self::ACTION_TESTPLAN: | ||||
| $title = pht('%s explained the test plan for this revision.', | $title = pht('%s explained the test plan for this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_CREATE: | case self::ACTION_CREATE: | ||||
| $title = pht('%s created this revision.', | $title = pht('%s created this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_ADDREVIEWERS: | case self::ACTION_ADDREVIEWERS: | ||||
| $title = pht('%s added reviewers to this revision.', | $title = pht('%s added reviewers to this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_ADDCCS: | case self::ACTION_ADDCCS: | ||||
| $title = pht('%s added CCs to this revision.', | $title = pht('%s added CCs to this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_CLAIM: | case self::ACTION_CLAIM: | ||||
| $title = pht('%s commandeered this revision.', | $title = pht('%s commandeered this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialAction::ACTION_REOPEN: | case self::ACTION_REOPEN: | ||||
| $title = pht('%s reopened this revision.', | $title = pht('%s reopened this revision.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| case DifferentialTransaction::TYPE_INLINE: | case DifferentialTransaction::TYPE_INLINE: | ||||
| $title = pht( | $title = pht( | ||||
| '%s added an inline comment.', | '%s added an inline comment.', | ||||
| $author_name); | $author_name); | ||||
| break; | break; | ||||
| Show All 24 Lines | public static function getActionVerb($action) { | ||||
| if (!empty($verbs[$action])) { | if (!empty($verbs[$action])) { | ||||
| return $verbs[$action]; | return $verbs[$action]; | ||||
| } else { | } else { | ||||
| return 'brazenly '.$action; | return 'brazenly '.$action; | ||||
| } | } | ||||
| } | } | ||||
| public static function allowReviewers($action) { | public static function allowReviewers($action) { | ||||
| if ($action == DifferentialAction::ACTION_ADDREVIEWERS || | if ($action == self::ACTION_ADDREVIEWERS || | ||||
| $action == DifferentialAction::ACTION_REQUEST || | $action == self::ACTION_REQUEST || | ||||
| $action == DifferentialAction::ACTION_RESIGN) { | $action == self::ACTION_RESIGN) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||