Differential D17070 Diff 41086 src/applications/differential/customfield/DifferentialAuditorsField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/customfield/DifferentialAuditorsField.php
| Show All 10 Lines | public function getFieldName() { | ||||
| return pht('Auditors'); | return pht('Auditors'); | ||||
| } | } | ||||
| public function getFieldDescription() { | public function getFieldDescription() { | ||||
| return pht('Allows commits to trigger audits explicitly.'); | return pht('Allows commits to trigger audits explicitly.'); | ||||
| } | } | ||||
| public function getValueForStorage() { | public function getValueForStorage() { | ||||
| return json_encode($this->getValue()); | return phutil_json_encode($this->getValue()); | ||||
| } | } | ||||
| public function setValueFromStorage($value) { | public function setValueFromStorage($value) { | ||||
| try { | try { | ||||
| $this->setValue(phutil_json_decode($value)); | $this->setValue(phutil_json_decode($value)); | ||||
| } catch (PhutilJSONParserException $ex) { | } catch (PhutilJSONParserException $ex) { | ||||
| $this->setValue(array()); | $this->setValue(array()); | ||||
| } | } | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function shouldAppearInCommitMessage() { | |||||
| return true; | |||||
| } | |||||
| public function shouldAllowEditInCommitMessage() { | |||||
| return true; | |||||
| } | |||||
| public function canDisableField() { | public function canDisableField() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function getRequiredHandlePHIDsForCommitMessage() { | public function shouldAppearInEditEngine() { | ||||
| return nonempty($this->getValue(), array()); | return true; | ||||
| } | |||||
| public function parseCommitMessageValue($value) { | |||||
| return $this->parseObjectList( | |||||
| $value, | |||||
| array( | |||||
| PhabricatorPeopleUserPHIDType::TYPECONST, | |||||
| PhabricatorProjectProjectPHIDType::TYPECONST, | |||||
| )); | |||||
| } | } | ||||
| public function renderCommitMessageValue(array $handles) { | public function shouldAppearInCommitMessage() { | ||||
| return $this->renderObjectList($handles); | return true; | ||||
| } | } | ||||
| public function shouldAppearInConduitTransactions() { | public function shouldAppearInConduitTransactions() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| protected function newConduitEditParameterType() { | protected function newConduitEditParameterType() { | ||||
| return new ConduitPHIDListParameterType(); | return new ConduitPHIDListParameterType(); | ||||
| } | } | ||||
| public function shouldAppearInApplicationTransactions() { | |||||
| return true; | |||||
| } | |||||
| } | } | ||||