Page MenuHomePhabricator

D14820.diff
No OneTemporary

D14820.diff

diff --git a/src/applications/maniphest/storage/ManiphestTransaction.php b/src/applications/maniphest/storage/ManiphestTransaction.php
--- a/src/applications/maniphest/storage/ManiphestTransaction.php
+++ b/src/applications/maniphest/storage/ManiphestTransaction.php
@@ -381,6 +381,11 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created this task.',
+ $this->renderHandleLink($author_phid));
+
case self::TYPE_TITLE:
if ($old === null) {
return pht(
diff --git a/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php b/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
--- a/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
+++ b/src/applications/owners/storage/PhabricatorOwnersPackageTransaction.php
@@ -47,11 +47,16 @@
switch ($this->getTransactionType()) {
case self::TYPE_DESCRIPTION:
- return ($old === null);
+ if ($old === null) {
+ return true;
+ }
+ break;
case self::TYPE_PRIMARY:
// TODO: Eventually, remove these transactions entirely.
return true;
}
+
+ return parent::shouldHide();
}
public function getTitle() {
@@ -60,6 +65,10 @@
$author_phid = $this->getAuthorPHID();
switch ($this->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created this package.',
+ $this->renderHandleLink($author_phid));
case self::TYPE_NAME:
if ($old === null) {
return pht(
diff --git a/src/applications/paste/storage/PhabricatorPasteTransaction.php b/src/applications/paste/storage/PhabricatorPasteTransaction.php
--- a/src/applications/paste/storage/PhabricatorPasteTransaction.php
+++ b/src/applications/paste/storage/PhabricatorPasteTransaction.php
@@ -41,7 +41,10 @@
switch ($this->getTransactionType()) {
case self::TYPE_TITLE:
case self::TYPE_LANGUAGE:
- return ($old === null);
+ if ($old === null) {
+ return true;
+ }
+ break;
}
return parent::shouldHide();
}
@@ -77,6 +80,10 @@
$type = $this->getTransactionType();
switch ($type) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created this paste.',
+ $this->renderHandleLink($author_phid));
case self::TYPE_CONTENT:
if ($old === null) {
return pht(
diff --git a/src/applications/phame/storage/PhameBlogTransaction.php b/src/applications/phame/storage/PhameBlogTransaction.php
--- a/src/applications/phame/storage/PhameBlogTransaction.php
+++ b/src/applications/phame/storage/PhameBlogTransaction.php
@@ -24,7 +24,9 @@
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
case self::TYPE_DESCRIPTION:
- return ($old === null);
+ if ($old === null) {
+ return true;
+ }
}
return parent::shouldHide();
}
@@ -98,6 +100,10 @@
$type = $this->getTransactionType();
switch ($type) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created this blog.',
+ $this->renderHandleLink($author_phid));
case self::TYPE_NAME:
if ($old === null) {
return pht(
diff --git a/src/applications/transactions/constants/PhabricatorTransactions.php b/src/applications/transactions/constants/PhabricatorTransactions.php
--- a/src/applications/transactions/constants/PhabricatorTransactions.php
+++ b/src/applications/transactions/constants/PhabricatorTransactions.php
@@ -13,6 +13,7 @@
const TYPE_TOKEN = 'token:give';
const TYPE_INLINESTATE = 'core:inlinestate';
const TYPE_SPACE = 'core:space';
+ const TYPE_CREATE = 'core:create';
const COLOR_RED = 'red';
const COLOR_ORANGE = 'orange';
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -857,6 +857,12 @@
}
$xactions = array();
+
+ if ($this->getIsCreate()) {
+ $xactions[] = id(clone $template)
+ ->setTransactionType(PhabricatorTransactions::TYPE_CREATE);
+ }
+
foreach ($submit_fields as $key => $field) {
$field_value = $field->getValueForTransaction();
@@ -1647,6 +1653,12 @@
}
$results = array();
+
+ if ($this->getIsCreate()) {
+ $results[] = id(clone $template)
+ ->setTransactionType(PhabricatorTransactions::TYPE_CREATE);
+ }
+
foreach ($xactions as $xaction) {
$type = $types[$xaction['type']];
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -258,6 +258,8 @@
public function getTransactionTypes() {
$types = array();
+ $types[] = PhabricatorTransactions::TYPE_CREATE;
+
if ($this->object instanceof PhabricatorSubscribableInterface) {
$types[] = PhabricatorTransactions::TYPE_SUBSCRIBERS;
}
@@ -303,6 +305,8 @@
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return null;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
return array_values($this->subscribers);
case PhabricatorTransactions::TYPE_VIEW_POLICY:
@@ -371,6 +375,8 @@
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return null;
case PhabricatorTransactions::TYPE_SUBSCRIBERS:
return $this->getPHIDTransactionNewValue($xaction);
case PhabricatorTransactions::TYPE_VIEW_POLICY:
@@ -422,6 +428,8 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return true;
case PhabricatorTransactions::TYPE_COMMENT:
return $xaction->hasComment();
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
@@ -484,6 +492,7 @@
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
$field = $this->getCustomFieldForTransaction($object, $xaction);
return $field->applyApplicationTransactionInternalEffects($xaction);
+ case PhabricatorTransactions::TYPE_CREATE:
case PhabricatorTransactions::TYPE_BUILDABLE:
case PhabricatorTransactions::TYPE_TOKEN:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
@@ -534,6 +543,7 @@
case PhabricatorTransactions::TYPE_CUSTOMFIELD:
$field = $this->getCustomFieldForTransaction($object, $xaction);
return $field->applyApplicationTransactionExternalEffects($xaction);
+ case PhabricatorTransactions::TYPE_CREATE:
case PhabricatorTransactions::TYPE_EDGE:
case PhabricatorTransactions::TYPE_BUILDABLE:
case PhabricatorTransactions::TYPE_TOKEN:
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -482,6 +482,7 @@
// essentially never interesting.
if ($this->getIsCreateTransaction()) {
switch ($this->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
@@ -497,6 +498,7 @@
if (!strlen($old)) {
return true;
}
+ break;
}
}
@@ -702,6 +704,10 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created this object.',
+ $this->renderHandleLink($author_phid));
case PhabricatorTransactions::TYPE_COMMENT:
return pht(
'%s added a comment.',
@@ -918,6 +924,11 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created %s.',
+ $this->renderHandleLink($author_phid),
+ $this->renderHandleLink($object_phid));
case PhabricatorTransactions::TYPE_COMMENT:
return pht(
'%s added a comment to %s.',
@@ -1119,6 +1130,7 @@
// Make this weaker than TYPE_COMMENT.
return 0.25;
}
+
return 1.0;
}
diff --git a/src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php b/src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorEditEngineConfigurationTransaction.php
@@ -34,6 +34,10 @@
$type = $this->getTransactionType();
switch ($type) {
+ case PhabricatorTransactions::TYPE_CREATE:
+ return pht(
+ '%s created this form configuration.',
+ $this->renderHandleLink($author_phid));
case self::TYPE_NAME:
if (strlen($old)) {
return pht(

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 4, 7:11 PM (9 h, 44 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7222567
Default Alt Text
D14820.diff (9 KB)

Event Timeline