@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean up legalpad transaction copy

Summary: Ref T12685, adds more informative transaction copy, fixes bugs.

Test Plan: Create various documents and edit them.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12685

Differential Revision: https://secure.phabricator.com/D17860

+42 -17
+1 -1
src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
··· 6 6 const TRANSACTIONTYPE = 'legalpad:require-signature'; 7 7 8 8 public function generateOldValue($object) { 9 - return $object->getRequireSignature(); 9 + return (int)$object->getRequireSignature(); 10 10 } 11 11 12 12 public function applyInternalEffects($object, $value) {
+2 -2
src/applications/legalpad/xaction/LegalpadDocumentSignatureTypeTransaction.php
··· 15 15 16 16 public function getTitle() { 17 17 return pht( 18 - '%s set the document signature type.', 18 + '%s updated the document signature type.', 19 19 $this->renderAuthor()); 20 20 } 21 21 22 22 public function getTitleForFeed() { 23 23 return pht( 24 - '%s set the document signature type for %s.', 24 + '%s updated the document signature type for %s.', 25 25 $this->renderAuthor(), 26 26 $this->renderObject()); 27 27 }
+11 -3
src/applications/legalpad/xaction/LegalpadDocumentTextTransaction.php
··· 17 17 } 18 18 19 19 public function getTitle() { 20 - return pht( 21 - '%s updated the document text.', 22 - $this->renderAuthor()); 20 + $old = $this->getOldValue(); 21 + 22 + if (!strlen($old)) { 23 + return pht( 24 + '%s set the document text.', 25 + $this->renderAuthor()); 26 + } else { 27 + return pht( 28 + '%s updated the document text.', 29 + $this->renderAuthor()); 30 + } 23 31 } 24 32 25 33 public function getTitleForFeed() {
+28 -11
src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php
··· 17 17 } 18 18 19 19 public function getTitle() { 20 - return pht( 21 - '%s renamed this document from %s to %s.', 22 - $this->renderAuthor(), 23 - $this->renderOldValue(), 24 - $this->renderNewValue()); 20 + $old = $this->getOldValue(); 21 + 22 + if (!strlen($old)) { 23 + return pht( 24 + '%s created this document.', 25 + $this->renderAuthor()); 26 + } else { 27 + return pht( 28 + '%s renamed this document from %s to %s.', 29 + $this->renderAuthor(), 30 + $this->renderOldValue(), 31 + $this->renderNewValue()); 32 + } 25 33 } 26 34 27 35 public function getTitleForFeed() { 28 - return pht( 29 - '%s renamed document %s from %s to %s.', 30 - $this->renderAuthor(), 31 - $this->renderObject(), 32 - $this->renderOldValue(), 33 - $this->renderNewValue()); 36 + $old = $this->getOldValue(); 37 + 38 + if (!strlen($old)) { 39 + return pht( 40 + '%s created %s.', 41 + $this->renderAuthor(), 42 + $this->renderObject()); 43 + } else { 44 + return pht( 45 + '%s renamed %s from %s to %s.', 46 + $this->renderAuthor(), 47 + $this->renderObject(), 48 + $this->renderOldValue(), 49 + $this->renderNewValue()); 50 + } 34 51 } 35 52 36 53 public function validateTransactions($object, array $xactions) {