1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-13 09:06:14 +01:00
phorge-phorge/src/applications/audit/constants/PhabricatorAuditActionConstants.php
Chad Little 84f21c8a20 Modernize Audit
Summary: Adds mobile support to Audit, converts tables to object item views. I also colored 'concerns' and 'audit required' in the list, but nothing else. We can add more if needed but I'm assuming these are the two most important cases.

Test Plan: Tested as much as I could, a little unsure of a few things since my local repo isn't super filled. Will let epriestley run through.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5962
2013-05-18 10:49:37 -07:00

45 lines
1.2 KiB
PHP

<?php
final class PhabricatorAuditActionConstants {
const CONCERN = 'concern';
const ACCEPT = 'accept';
const COMMENT = 'comment';
const RESIGN = 'resign';
const CLOSE = 'close';
const ADD_CCS = 'add_ccs';
const ADD_AUDITORS = 'add_auditors';
public static function getActionNameMap() {
$map = array(
self::COMMENT => pht('Comment'),
self::CONCERN => pht("Raise Concern \xE2\x9C\x98"),
self::ACCEPT => pht("Accept Commit \xE2\x9C\x94"),
self::RESIGN => pht('Resign from Audit'),
self::CLOSE => pht('Close Audit'),
self::ADD_CCS => pht('Add CCs'),
self::ADD_AUDITORS => pht('Add Auditors'),
);
return $map;
}
public static function getActionName($constant) {
$map = self::getActionNameMap();
return idx($map, $constant, 'Unknown');
}
public static function getActionPastTenseVerb($action) {
static $map = array(
self::COMMENT => 'commented on',
self::CONCERN => 'raised a concern with',
self::ACCEPT => 'accepted',
self::RESIGN => 'resigned from',
self::CLOSE => 'closed',
self::ADD_CCS => 'added CCs to',
self::ADD_AUDITORS => 'added auditors to',
);
return idx($map, $action, 'updated');
}
}