[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/audit/constants/ -> PhabricatorAuditCommitStatusConstants.php (source)

   1  <?php
   2  
   3  final class PhabricatorAuditCommitStatusConstants {
   4  
   5    const NONE                = 0;
   6    const NEEDS_AUDIT         = 1;
   7    const CONCERN_RAISED      = 2;
   8    const PARTIALLY_AUDITED   = 3;
   9    const FULLY_AUDITED       = 4;
  10  
  11    public static function getStatusNameMap() {
  12      $map = array(
  13        self::NONE                => pht('None'),
  14        self::NEEDS_AUDIT         => pht('Audit Required'),
  15        self::CONCERN_RAISED      => pht('Concern Raised'),
  16        self::PARTIALLY_AUDITED   => pht('Partially Audited'),
  17        self::FULLY_AUDITED       => pht('Audited'),
  18      );
  19  
  20      return $map;
  21    }
  22  
  23    public static function getStatusName($code) {
  24      return idx(self::getStatusNameMap(), $code, 'Unknown');
  25    }
  26  
  27    public static function getOpenStatusConstants() {
  28      return array(
  29        self::CONCERN_RAISED,
  30        self::NEEDS_AUDIT,
  31      );
  32    }
  33  
  34    public static function getStatusColor($code) {
  35      switch ($code) {
  36        case self::CONCERN_RAISED:
  37          $color = 'red';
  38          break;
  39        case self::NEEDS_AUDIT:
  40        case self::PARTIALLY_AUDITED:
  41          $color = 'orange';
  42          break;
  43        case self::FULLY_AUDITED:
  44          $color = 'green';
  45          break;
  46        default:
  47          $color = null;
  48          break;
  49      }
  50      return $color;
  51    }
  52  
  53  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1