Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -137,14 +137,27 @@ |
138 | 138 | return $this->mCommonPath; |
139 | 139 | } |
140 | 140 | |
| 141 | + /* |
| 142 | + * List of all possible states a CodeRevision can be in |
| 143 | + * return Array |
| 144 | + */ |
141 | 145 | public static function getPossibleStates() { |
142 | 146 | return array( 'new', 'fixme', 'reverted', 'resolved', 'ok', 'verified', 'deferred', 'old' ); |
143 | 147 | } |
144 | | - |
| 148 | + |
| 149 | + /* |
| 150 | + * List of all flags a user can mark themself as having done to a revision |
| 151 | + * Return Array |
| 152 | + */ |
145 | 153 | public static function getPossibleFlags() { |
146 | 154 | return array( 'inspected', 'tested' ); |
147 | 155 | } |
148 | 156 | |
| 157 | + /** |
| 158 | + * Returns whether the provided status is valid |
| 159 | + * @param String $status |
| 160 | + * @return bool |
| 161 | + */ |
149 | 162 | public function isValidStatus( $status ) { |
150 | 163 | return in_array( $status, self::getPossibleStates(), true ); |
151 | 164 | } |
Index: trunk/extensions/CodeReview/api/ApiRevisionUpdate.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $params['status'], |
51 | 51 | $params['addtags'], |
52 | 52 | $params['removeTags'], |
53 | | - array(), //Signoff Flags to be done/exposed at later date |
| 53 | + $params['flags'], |
54 | 54 | $params['comment'] |
55 | 55 | ); |
56 | 56 | |
— | — | @@ -88,6 +88,11 @@ |
89 | 89 | ApiBase::PARAM_TYPE => 'string', |
90 | 90 | ApiBase::PARAM_ISMULTI => true, |
91 | 91 | ), |
| 92 | + 'flags' => array( |
| 93 | + ApiBase::PARAM_TYPE => 'string', |
| 94 | + ApiBase::PARAM_ISMULTI => true, |
| 95 | + ApiBase::PARAM_TYPE => CodeRevision::getPossibleFlags() |
| 96 | + ) |
92 | 97 | ); |
93 | 98 | } |
94 | 99 | |
— | — | @@ -99,6 +104,7 @@ |
100 | 105 | 'status' => 'Status to set the revision to', |
101 | 106 | 'addtags' => 'Tags to be added to the revision', |
102 | 107 | 'removetags' => 'Tags to be removed from the revision', |
| 108 | + 'flags' => 'Code Signoff flags to assign to the revision by the current user', |
103 | 109 | ); |
104 | 110 | } |
105 | 111 | |