Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15344298
D17860.id42953.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D17860.id42953.diff
View Options
diff --git a/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php b/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
--- a/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
+++ b/src/applications/legalpad/xaction/LegalpadDocumentRequireSignatureTransaction.php
@@ -6,7 +6,7 @@
const TRANSACTIONTYPE = 'legalpad:require-signature';
public function generateOldValue($object) {
- return $object->getRequireSignature();
+ return (int)$object->getRequireSignature();
}
public function applyInternalEffects($object, $value) {
diff --git a/src/applications/legalpad/xaction/LegalpadDocumentSignatureTypeTransaction.php b/src/applications/legalpad/xaction/LegalpadDocumentSignatureTypeTransaction.php
--- a/src/applications/legalpad/xaction/LegalpadDocumentSignatureTypeTransaction.php
+++ b/src/applications/legalpad/xaction/LegalpadDocumentSignatureTypeTransaction.php
@@ -15,13 +15,13 @@
public function getTitle() {
return pht(
- '%s set the document signature type.',
+ '%s updated the document signature type.',
$this->renderAuthor());
}
public function getTitleForFeed() {
return pht(
- '%s set the document signature type for %s.',
+ '%s updated the document signature type for %s.',
$this->renderAuthor(),
$this->renderObject());
}
diff --git a/src/applications/legalpad/xaction/LegalpadDocumentTextTransaction.php b/src/applications/legalpad/xaction/LegalpadDocumentTextTransaction.php
--- a/src/applications/legalpad/xaction/LegalpadDocumentTextTransaction.php
+++ b/src/applications/legalpad/xaction/LegalpadDocumentTextTransaction.php
@@ -17,9 +17,17 @@
}
public function getTitle() {
- return pht(
- '%s updated the document text.',
- $this->renderAuthor());
+ $old = $this->getOldValue();
+
+ if (!strlen($old)) {
+ return pht(
+ '%s set the document text.',
+ $this->renderAuthor());
+ } else {
+ return pht(
+ '%s updated the document text.',
+ $this->renderAuthor());
+ }
}
public function getTitleForFeed() {
diff --git a/src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php b/src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php
--- a/src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php
+++ b/src/applications/legalpad/xaction/LegalpadDocumentTitleTransaction.php
@@ -17,20 +17,37 @@
}
public function getTitle() {
- return pht(
- '%s renamed this document from %s to %s.',
- $this->renderAuthor(),
- $this->renderOldValue(),
- $this->renderNewValue());
+ $old = $this->getOldValue();
+
+ if (!strlen($old)) {
+ return pht(
+ '%s created this document.',
+ $this->renderAuthor());
+ } else {
+ return pht(
+ '%s renamed this document from %s to %s.',
+ $this->renderAuthor(),
+ $this->renderOldValue(),
+ $this->renderNewValue());
+ }
}
public function getTitleForFeed() {
- return pht(
- '%s renamed document %s from %s to %s.',
- $this->renderAuthor(),
- $this->renderObject(),
- $this->renderOldValue(),
- $this->renderNewValue());
+ $old = $this->getOldValue();
+
+ if (!strlen($old)) {
+ return pht(
+ '%s created %s.',
+ $this->renderAuthor(),
+ $this->renderObject());
+ } else {
+ return pht(
+ '%s renamed %s from %s to %s.',
+ $this->renderAuthor(),
+ $this->renderObject(),
+ $this->renderOldValue(),
+ $this->renderNewValue());
+ }
}
public function validateTransactions($object, array $xactions) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 11, 3:42 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7479472
Default Alt Text
D17860.id42953.diff (3 KB)
Attached To
Mode
D17860: Clean up legalpad transaction copy
Attached
Detach File
Event Timeline
Log In to Comment