2016-12-14 17:14:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialJIRAIssuesCommitMessageField
|
2016-12-15 19:11:58 +01:00
|
|
|
extends DifferentialCommitMessageCustomField {
|
2016-12-14 17:14:52 +01:00
|
|
|
|
|
|
|
const FIELDKEY = 'jira.issues';
|
|
|
|
|
|
|
|
public function getFieldName() {
|
|
|
|
return pht('JIRA Issues');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFieldAliases() {
|
|
|
|
return array(
|
|
|
|
'JIRA',
|
|
|
|
'JIRA Issue',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-12-15 19:11:58 +01:00
|
|
|
public function getCustomFieldKey() {
|
|
|
|
return 'phabricator:jira-issues';
|
|
|
|
}
|
|
|
|
|
2016-12-14 17:14:52 +01:00
|
|
|
public function parseFieldValue($value) {
|
|
|
|
return preg_split('/[\s,]+/', $value, $limit = -1, PREG_SPLIT_NO_EMPTY);
|
|
|
|
}
|
|
|
|
|
2016-12-15 19:11:58 +01:00
|
|
|
protected function readFieldValueFromCustomFieldStorage($value) {
|
|
|
|
return $this->readJSONFieldValueFromCustomFieldStorage($value, array());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function readFieldValueFromConduit($value) {
|
|
|
|
return $this->readStringListFieldValueFromConduit($value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderFieldValue($value) {
|
|
|
|
if (!$value) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return implode(', ', $value);
|
2016-12-14 17:14:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|