[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class DifferentialBlameRevisionField 4 extends DifferentialStoredCustomField { 5 6 public function getFieldKey() { 7 return 'phabricator:blame-revision'; 8 } 9 10 public function getFieldKeyForConduit() { 11 return 'blameRevision'; 12 } 13 14 public function getFieldName() { 15 return pht('Blame Revision'); 16 } 17 18 public function getFieldDescription() { 19 return pht('Stores a reference to what this fixes.'); 20 } 21 22 public function shouldDisableByDefault() { 23 return true; 24 } 25 26 public function shouldAppearInPropertyView() { 27 return true; 28 } 29 30 public function renderPropertyViewLabel() { 31 return $this->getFieldName(); 32 } 33 34 public function renderPropertyViewValue(array $handles) { 35 return $this->getValue(); 36 } 37 38 public function shouldAppearInEditView() { 39 return true; 40 } 41 42 public function shouldAppearInApplicationTransactions() { 43 return true; 44 } 45 46 public function getOldValueForApplicationTransactions() { 47 return $this->getValue(); 48 } 49 50 public function getNewValueForApplicationTransactions() { 51 return $this->getValue(); 52 } 53 54 public function readValueFromRequest(AphrontRequest $request) { 55 $this->setValue($request->getStr($this->getFieldKey())); 56 } 57 58 public function renderEditControl(array $handles) { 59 return id(new AphrontFormTextControl()) 60 ->setName($this->getFieldKey()) 61 ->setValue($this->getValue()) 62 ->setLabel($this->getFieldName()); 63 } 64 65 public function getApplicationTransactionTitle( 66 PhabricatorApplicationTransaction $xaction) { 67 $author_phid = $xaction->getAuthorPHID(); 68 $old = $xaction->getOldValue(); 69 $new = $xaction->getNewValue(); 70 71 return pht( 72 '%s updated the blame revision for this revision.', 73 $xaction->renderHandleLink($author_phid)); 74 } 75 76 public function getApplicationTransactionTitleForFeed( 77 PhabricatorApplicationTransaction $xaction, 78 PhabricatorFeedStory $story) { 79 80 $object_phid = $xaction->getObjectPHID(); 81 $author_phid = $xaction->getAuthorPHID(); 82 $old = $xaction->getOldValue(); 83 $new = $xaction->getNewValue(); 84 85 return pht( 86 '%s updated the blame revision for %s.', 87 $xaction->renderHandleLink($author_phid), 88 $xaction->renderHandleLink($object_phid)); 89 } 90 91 public function shouldAppearInCommitMessage() { 92 return true; 93 } 94 95 public function shouldAllowEditInCommitMessage() { 96 return true; 97 } 98 99 public function shouldOverwriteWhenCommitMessageIsEdited() { 100 return true; 101 } 102 103 public function getCommitMessageLabels() { 104 return array( 105 'Blame Revision', 106 'Blame Rev', 107 ); 108 } 109 110 public function renderCommitMessageValue(array $handles) { 111 return $this->getValue(); 112 } 113 114 public function shouldAppearInConduitDictionary() { 115 return true; 116 } 117 118 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |