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) {