Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14003812
D13188.id31893.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
93 KB
Referenced Files
None
Subscribers
None
D13188.id31893.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -264,7 +264,6 @@
'ConpherenceTransactionComment' => 'applications/conpherence/storage/ConpherenceTransactionComment.php',
'ConpherenceTransactionQuery' => 'applications/conpherence/query/ConpherenceTransactionQuery.php',
'ConpherenceTransactionRenderer' => 'applications/conpherence/ConpherenceTransactionRenderer.php',
- 'ConpherenceTransactionType' => 'applications/conpherence/constants/ConpherenceTransactionType.php',
'ConpherenceTransactionView' => 'applications/conpherence/view/ConpherenceTransactionView.php',
'ConpherenceUpdateActions' => 'applications/conpherence/constants/ConpherenceUpdateActions.php',
'ConpherenceUpdateController' => 'applications/conpherence/controller/ConpherenceUpdateController.php',
@@ -956,7 +955,6 @@
'JavelinUIExample' => 'applications/uiexample/examples/JavelinUIExample.php',
'JavelinViewExampleServerView' => 'applications/uiexample/examples/JavelinViewExampleServerView.php',
'JavelinViewUIExample' => 'applications/uiexample/examples/JavelinViewUIExample.php',
- 'LegalpadConstants' => 'applications/legalpad/constants/LegalpadConstants.php',
'LegalpadController' => 'applications/legalpad/controller/LegalpadController.php',
'LegalpadCreateDocumentsCapability' => 'applications/legalpad/capability/LegalpadCreateDocumentsCapability.php',
'LegalpadDAO' => 'applications/legalpad/storage/LegalpadDAO.php',
@@ -990,7 +988,6 @@
'LegalpadTransaction' => 'applications/legalpad/storage/LegalpadTransaction.php',
'LegalpadTransactionComment' => 'applications/legalpad/storage/LegalpadTransactionComment.php',
'LegalpadTransactionQuery' => 'applications/legalpad/query/LegalpadTransactionQuery.php',
- 'LegalpadTransactionType' => 'applications/legalpad/constants/LegalpadTransactionType.php',
'LegalpadTransactionView' => 'applications/legalpad/view/LegalpadTransactionView.php',
'LiskChunkTestCase' => 'infrastructure/storage/lisk/__tests__/LiskChunkTestCase.php',
'LiskDAO' => 'infrastructure/storage/lisk/LiskDAO.php',
@@ -1088,7 +1085,6 @@
'MetaMTAEmailTransactionCommand' => 'applications/metamta/command/MetaMTAEmailTransactionCommand.php',
'MetaMTAMailReceivedGarbageCollector' => 'applications/metamta/garbagecollector/MetaMTAMailReceivedGarbageCollector.php',
'MetaMTAMailSentGarbageCollector' => 'applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php',
- 'MetaMTANotificationType' => 'applications/metamta/constants/MetaMTANotificationType.php',
'MetaMTAReceivedMailStatus' => 'applications/metamta/constants/MetaMTAReceivedMailStatus.php',
'MultimeterContext' => 'applications/multimeter/storage/MultimeterContext.php',
'MultimeterControl' => 'applications/multimeter/data/MultimeterControl.php',
@@ -2012,7 +2008,6 @@
'PhabricatorMacroTransaction' => 'applications/macro/storage/PhabricatorMacroTransaction.php',
'PhabricatorMacroTransactionComment' => 'applications/macro/storage/PhabricatorMacroTransactionComment.php',
'PhabricatorMacroTransactionQuery' => 'applications/macro/query/PhabricatorMacroTransactionQuery.php',
- 'PhabricatorMacroTransactionType' => 'applications/macro/constants/PhabricatorMacroTransactionType.php',
'PhabricatorMacroViewController' => 'applications/macro/controller/PhabricatorMacroViewController.php',
'PhabricatorMailImplementationAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationAdapter.php',
'PhabricatorMailImplementationAmazonSESAdapter' => 'applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php',
@@ -2850,7 +2845,6 @@
'PhluxVariableQuery' => 'applications/phlux/query/PhluxVariableQuery.php',
'PhluxViewController' => 'applications/phlux/controller/PhluxViewController.php',
'PholioActionMenuEventListener' => 'applications/pholio/event/PholioActionMenuEventListener.php',
- 'PholioConstants' => 'applications/pholio/constants/PholioConstants.php',
'PholioController' => 'applications/pholio/controller/PholioController.php',
'PholioDAO' => 'applications/pholio/storage/PholioDAO.php',
'PholioDefaultEditCapability' => 'applications/pholio/capability/PholioDefaultEditCapability.php',
@@ -2882,7 +2876,6 @@
'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php',
'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php',
'PholioTransactionQuery' => 'applications/pholio/query/PholioTransactionQuery.php',
- 'PholioTransactionType' => 'applications/pholio/constants/PholioTransactionType.php',
'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php',
'PholioUploadedImageView' => 'applications/pholio/view/PholioUploadedImageView.php',
'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php',
@@ -3542,7 +3535,6 @@
'ConpherenceTransaction' => 'PhabricatorApplicationTransaction',
'ConpherenceTransactionComment' => 'PhabricatorApplicationTransactionComment',
'ConpherenceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'ConpherenceTransactionType' => 'ConpherenceConstants',
'ConpherenceTransactionView' => 'AphrontView',
'ConpherenceUpdateActions' => 'ConpherenceConstants',
'ConpherenceUpdateController' => 'ConpherenceController',
@@ -4331,7 +4323,6 @@
'LegalpadTransaction' => 'PhabricatorApplicationTransaction',
'LegalpadTransactionComment' => 'PhabricatorApplicationTransactionComment',
'LegalpadTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'LegalpadTransactionType' => 'LegalpadConstants',
'LegalpadTransactionView' => 'PhabricatorApplicationTransactionView',
'LiskChunkTestCase' => 'PhabricatorTestCase',
'LiskDAOTestCase' => 'PhabricatorTestCase',
@@ -4440,7 +4431,6 @@
'MetaMTAEmailTransactionCommand' => 'Phobject',
'MetaMTAMailReceivedGarbageCollector' => 'PhabricatorGarbageCollector',
'MetaMTAMailSentGarbageCollector' => 'PhabricatorGarbageCollector',
- 'MetaMTANotificationType' => 'MetaMTAConstants',
'MetaMTAReceivedMailStatus' => 'MetaMTAConstants',
'MultimeterContext' => 'MultimeterDimension',
'MultimeterController' => 'PhabricatorController',
@@ -6430,7 +6420,6 @@
'PholioTransaction' => 'PhabricatorApplicationTransaction',
'PholioTransactionComment' => 'PhabricatorApplicationTransactionComment',
'PholioTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
- 'PholioTransactionType' => 'PholioConstants',
'PholioTransactionView' => 'PhabricatorApplicationTransactionView',
'PholioUploadedImageView' => 'AphrontView',
'PhortuneAccount' => array(
diff --git a/src/applications/conpherence/ConpherenceTransactionRenderer.php b/src/applications/conpherence/ConpherenceTransactionRenderer.php
--- a/src/applications/conpherence/ConpherenceTransactionRenderer.php
+++ b/src/applications/conpherence/ConpherenceTransactionRenderer.php
@@ -61,7 +61,7 @@
// between days. some setup required!
$previous_transaction = null;
$date_marker_transaction = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_DATE_MARKER)
+ ->setTransactionType(ConpherenceTransaction::TYPE_DATE_MARKER)
->makeEphemeral();
$date_marker_transaction_view = id(new ConpherenceTransactionView())
->setUser($user)
diff --git a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
--- a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
@@ -157,10 +157,10 @@
$xactions = array();
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participant_phids));
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue('Test');
id(new ConpherenceEditor())
diff --git a/src/applications/conpherence/__tests__/ConpherenceTestCase.php b/src/applications/conpherence/__tests__/ConpherenceTestCase.php
--- a/src/applications/conpherence/__tests__/ConpherenceTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceTestCase.php
@@ -8,7 +8,7 @@
array $participant_phids) {
$xactions = array(id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participant_phids)),
);
$editor = id(new ConpherenceEditor())
@@ -24,7 +24,7 @@
array $participant_phids) {
$xactions = array(id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('-' => $participant_phids)),
);
$editor = id(new ConpherenceEditor())
diff --git a/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php
--- a/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php
+++ b/src/applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php
@@ -71,7 +71,7 @@
if ($add_participant_phids) {
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $add_participant_phids));
}
if ($remove_participant_phid) {
@@ -80,12 +80,12 @@
}
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('-' => array($remove_participant_phid)));
}
if ($title) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue($title);
}
if ($message) {
diff --git a/src/applications/conpherence/constants/ConpherenceTransactionType.php b/src/applications/conpherence/constants/ConpherenceTransactionType.php
deleted file mode 100644
--- a/src/applications/conpherence/constants/ConpherenceTransactionType.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-final class ConpherenceTransactionType extends ConpherenceConstants {
-
- const TYPE_FILES = 'files';
- const TYPE_TITLE = 'title';
- const TYPE_PARTICIPANTS = 'participants';
- const TYPE_DATE_MARKER = 'date-marker';
- const TYPE_PICTURE = 'picture';
- const TYPE_PICTURE_CROP = 'picture-crop';
-
-}
diff --git a/src/applications/conpherence/controller/ConpherenceNewRoomController.php b/src/applications/conpherence/controller/ConpherenceNewRoomController.php
--- a/src/applications/conpherence/controller/ConpherenceNewRoomController.php
+++ b/src/applications/conpherence/controller/ConpherenceNewRoomController.php
@@ -14,10 +14,10 @@
$xactions = array();
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => array($user->getPHID())));
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue($request->getStr('title'));
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
@@ -41,7 +41,7 @@
} catch (PhabricatorApplicationTransactionValidationException $ex) {
$validation_exception = $ex;
- $e_title = $ex->getShortMessage(ConpherenceTransactionType::TYPE_TITLE);
+ $e_title = $ex->getShortMessage(ConpherenceTransaction::TYPE_TITLE);
$conpherence->setViewPolicy($request->getStr('viewPolicy'));
$conpherence->setEditPolicy($request->getStr('editPolicy'));
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -67,7 +67,7 @@
case ConpherenceUpdateActions::JOIN_ROOM:
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => array($user->getPHID())));
$delete_draft = true;
$message = $request->getStr('text');
@@ -101,7 +101,7 @@
if (!empty($person_phids)) {
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $person_phids));
}
break;
@@ -114,7 +114,7 @@
if ($person_phid && $person_phid == $user->getPHID()) {
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('-' => array($person_phid)));
$response_mode = 'go-home';
}
@@ -144,7 +144,7 @@
->withIDs(array($file_id))
->executeOne();
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PICTURE)
->setNewValue($orig_file);
$okay = $orig_file->isTransformableImage();
if ($okay) {
@@ -157,7 +157,7 @@
ConpherenceImageData::CROP_HEIGHT);
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PICTURE_CROP)
+ ConpherenceTransaction::TYPE_PICTURE_CROP)
->setNewValue($crop_file->getPHID());
}
$response_mode = 'redirect';
@@ -181,12 +181,12 @@
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(
- ConpherenceTransactionType::TYPE_PICTURE_CROP)
+ ConpherenceTransaction::TYPE_PICTURE_CROP)
->setNewValue($image_phid);
}
$title = $request->getStr('title');
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue($title);
if ($conpherence->getIsRoom()) {
$xactions[] = id(new ConpherenceTransaction())
diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -47,16 +47,16 @@
if (!$errors) {
$xactions = array();
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $participant_phids));
if ($files) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_FILES)
+ ->setTransactionType(ConpherenceTransaction::TYPE_FILES)
->setNewValue(array('+' => mpull($files, 'getPHID')));
}
if ($title) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue($title);
}
@@ -100,7 +100,7 @@
$xactions = array();
if ($files) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_FILES)
+ ->setTransactionType(ConpherenceTransaction::TYPE_FILES)
->setNewValue(array('+' => mpull($files, 'getPHID')));
}
$xactions[] = id(new ConpherenceTransaction())
@@ -117,11 +117,11 @@
$types[] = PhabricatorTransactions::TYPE_COMMENT;
- $types[] = ConpherenceTransactionType::TYPE_TITLE;
- $types[] = ConpherenceTransactionType::TYPE_PARTICIPANTS;
- $types[] = ConpherenceTransactionType::TYPE_FILES;
- $types[] = ConpherenceTransactionType::TYPE_PICTURE;
- $types[] = ConpherenceTransactionType::TYPE_PICTURE_CROP;
+ $types[] = ConpherenceTransaction::TYPE_TITLE;
+ $types[] = ConpherenceTransaction::TYPE_PARTICIPANTS;
+ $types[] = ConpherenceTransaction::TYPE_FILES;
+ $types[] = ConpherenceTransaction::TYPE_PICTURE;
+ $types[] = ConpherenceTransaction::TYPE_PICTURE_CROP;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
$types[] = PhabricatorTransactions::TYPE_JOIN_POLICY;
@@ -134,18 +134,18 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_TITLE:
return $object->getTitle();
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case ConpherenceTransaction::TYPE_PICTURE:
return $object->getImagePHID(ConpherenceImageData::SIZE_ORIG);
- case ConpherenceTransactionType::TYPE_PICTURE_CROP:
+ case ConpherenceTransaction::TYPE_PICTURE_CROP:
return $object->getImagePHID(ConpherenceImageData::SIZE_CROP);
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
if ($this->getIsNewObject()) {
return array();
}
return $object->getParticipantPHIDs();
- case ConpherenceTransactionType::TYPE_FILES:
+ case ConpherenceTransaction::TYPE_FILES:
return $object->getFilePHIDs();
}
}
@@ -155,14 +155,14 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
- case ConpherenceTransactionType::TYPE_PICTURE_CROP:
+ case ConpherenceTransaction::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_PICTURE_CROP:
return $xaction->getNewValue();
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case ConpherenceTransaction::TYPE_PICTURE:
$file = $xaction->getNewValue();
return $file->getPHID();
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
- case ConpherenceTransactionType::TYPE_FILES:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_FILES:
return $this->getPHIDTransactionNewValue($xaction);
}
}
@@ -207,7 +207,7 @@
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
// Since this is a new ConpherenceThread, we have to create the
// participation data asap to pass policy checks. For existing
// ConpherenceThreads, the existing participation is correct
@@ -247,20 +247,20 @@
$make_author_recent_participant = true;
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_TITLE:
$object->setTitle($xaction->getNewValue());
break;
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case ConpherenceTransaction::TYPE_PICTURE:
$object->setImagePHID(
$xaction->getNewValue(),
ConpherenceImageData::SIZE_ORIG);
break;
- case ConpherenceTransactionType::TYPE_PICTURE_CROP:
+ case ConpherenceTransaction::TYPE_PICTURE_CROP:
$object->setImagePHID(
$xaction->getNewValue(),
ConpherenceImageData::SIZE_CROP);
break;
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
if (!$this->getIsNewObject()) {
$old_map = array_fuse($xaction->getOldValue());
$new_map = array_fuse($xaction->getNewValue());
@@ -322,7 +322,7 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_FILES:
+ case ConpherenceTransaction::TYPE_FILES:
$editor = new PhabricatorEdgeEditor();
$edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST;
$old = array_fill_keys($xaction->getOldValue(), true);
@@ -343,7 +343,7 @@
}
$editor->save();
break;
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
if ($this->getIsNewObject()) {
continue;
}
@@ -443,7 +443,7 @@
parent::requireCapabilities($object, $xaction);
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
$old_map = array_fuse($xaction->getOldValue());
$new_map = array_fuse($xaction->getNewValue());
@@ -473,13 +473,13 @@
break;
// This is similar to PhabricatorTransactions::TYPE_COMMENT so
// use CAN_VIEW
- case ConpherenceTransactionType::TYPE_FILES:
+ case ConpherenceTransaction::TYPE_FILES:
PhabricatorPolicyFilter::requireCapability(
$this->requireActor(),
$object,
PhabricatorPolicyCapability::CAN_VIEW);
break;
- case ConpherenceTransactionType::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_TITLE:
PhabricatorPolicyFilter::requireCapability(
$this->requireActor(),
$object,
@@ -494,10 +494,10 @@
$type = $u->getTransactionType();
switch ($type) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_TITLE:
return $v;
- case ConpherenceTransactionType::TYPE_FILES:
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_FILES:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
return $this->mergePHIDOrEdgeTransactions($u, $v);
}
@@ -626,9 +626,9 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case ConpherenceTransaction::TYPE_PICTURE:
return array($xaction->getNewValue()->getPHID());
- case ConpherenceTransactionType::TYPE_PICTURE_CROP:
+ case ConpherenceTransaction::TYPE_PICTURE_CROP:
return array($xaction->getNewValue());
}
@@ -643,7 +643,7 @@
$errors = parent::validateTransaction($object, $type, $xactions);
switch ($type) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_TITLE:
if (!$object->getIsRoom()) {
continue;
}
@@ -667,7 +667,7 @@
$errors[] = $error;
}
break;
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case ConpherenceTransaction::TYPE_PICTURE:
foreach ($xactions as $xaction) {
$file = $xaction->getNewValue();
if (!$file->isTransformableImage()) {
@@ -682,7 +682,7 @@
}
}
break;
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
foreach ($xactions as $xaction) {
$new_phids = $this->getPHIDTransactionNewValue($xaction, array());
$old_phids = nonempty($object->getParticipantPHIDs(), array());
diff --git a/src/applications/conpherence/mail/ConpherenceReplyHandler.php b/src/applications/conpherence/mail/ConpherenceReplyHandler.php
--- a/src/applications/conpherence/mail/ConpherenceReplyHandler.php
+++ b/src/applications/conpherence/mail/ConpherenceReplyHandler.php
@@ -65,7 +65,7 @@
$xactions = array();
if ($this->getMailAddedParticipantPHIDs()) {
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_PARTICIPANTS)
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
->setNewValue(array('+' => $this->getMailAddedParticipantPHIDs()));
}
diff --git a/src/applications/conpherence/storage/ConpherenceTransaction.php b/src/applications/conpherence/storage/ConpherenceTransaction.php
--- a/src/applications/conpherence/storage/ConpherenceTransaction.php
+++ b/src/applications/conpherence/storage/ConpherenceTransaction.php
@@ -2,6 +2,13 @@
final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
+ const TYPE_FILES = 'files';
+ const TYPE_TITLE = 'title';
+ const TYPE_PARTICIPANTS = 'participants';
+ const TYPE_DATE_MARKER = 'date-marker';
+ const TYPE_PICTURE = 'picture';
+ const TYPE_PICTURE_CROP = 'picture-crop';
+
public function getApplicationName() {
return 'conpherence';
}
@@ -16,7 +23,7 @@
public function getNoEffectDescription() {
switch ($this->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case self::TYPE_PARTICIPANTS:
return pht(
'You can not add a participant who has already been added.');
break;
@@ -29,15 +36,15 @@
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case self::TYPE_PARTICIPANTS:
return ($old === null);
- case ConpherenceTransactionType::TYPE_TITLE:
- case ConpherenceTransactionType::TYPE_PICTURE:
- case ConpherenceTransactionType::TYPE_DATE_MARKER:
+ case self::TYPE_TITLE:
+ case self::TYPE_PICTURE:
+ case self::TYPE_DATE_MARKER:
return false;
- case ConpherenceTransactionType::TYPE_FILES:
+ case self::TYPE_FILES:
return true;
- case ConpherenceTransactionType::TYPE_PICTURE_CROP:
+ case self::TYPE_PICTURE_CROP:
return true;
}
@@ -51,18 +58,18 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case self::TYPE_TITLE:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case self::TYPE_PICTURE:
if ($this->getObject()->getIsRoom()) {
return $this->getRoomTitle();
} else {
return $this->getThreadTitle();
}
break;
- case ConpherenceTransactionType::TYPE_FILES:
+ case self::TYPE_FILES:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
@@ -85,7 +92,7 @@
}
return $title;
break;
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case self::TYPE_PARTICIPANTS:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
@@ -124,7 +131,7 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case self::TYPE_TITLE:
if ($old && $new) {
$title = pht(
'%s renamed this room from "%s" to "%s".',
@@ -144,7 +151,7 @@
}
return $title;
break;
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case self::TYPE_PICTURE:
return pht(
'%s updated the room image.',
$this->renderHandleLink($author_phid));
@@ -180,7 +187,7 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
+ case self::TYPE_TITLE:
if ($old && $new) {
$title = pht(
'%s renamed this thread from "%s" to "%s".',
@@ -200,7 +207,7 @@
}
return $title;
break;
- case ConpherenceTransactionType::TYPE_PICTURE:
+ case self::TYPE_PICTURE:
return pht(
'%s updated the room image.',
$this->renderHandleLink($author_phid));
@@ -237,12 +244,12 @@
$phids[] = $this->getAuthorPHID();
switch ($this->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_TITLE:
- case ConpherenceTransactionType::TYPE_PICTURE:
- case ConpherenceTransactionType::TYPE_FILES:
- case ConpherenceTransactionType::TYPE_DATE_MARKER:
+ case self::TYPE_TITLE:
+ case self::TYPE_PICTURE:
+ case self::TYPE_FILES:
+ case self::TYPE_DATE_MARKER:
break;
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case self::TYPE_PARTICIPANTS:
$phids = array_merge($phids, $this->getOldValue());
$phids = array_merge($phids, $this->getNewValue());
break;
diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php
--- a/src/applications/conpherence/view/ConpherenceTransactionView.php
+++ b/src/applications/conpherence/view/ConpherenceTransactionView.php
@@ -71,7 +71,7 @@
$transaction = $this->getConpherenceTransaction();
switch ($transaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_DATE_MARKER:
+ case ConpherenceTransaction::TYPE_DATE_MARKER:
return javelin_tag(
'div',
array(
@@ -239,13 +239,13 @@
$content = null;
$handles = $this->getHandles();
switch ($transaction->getTransactionType()) {
- case ConpherenceTransactionType::TYPE_FILES:
+ case ConpherenceTransaction::TYPE_FILES:
$content = $transaction->getTitle();
break;
- case ConpherenceTransactionType::TYPE_TITLE:
- case ConpherenceTransactionType::TYPE_PICTURE:
- case ConpherenceTransactionType::TYPE_PICTURE_CROP:
- case ConpherenceTransactionType::TYPE_PARTICIPANTS:
+ case ConpherenceTransaction::TYPE_TITLE:
+ case ConpherenceTransaction::TYPE_PICTURE:
+ case ConpherenceTransaction::TYPE_PICTURE_CROP:
+ case ConpherenceTransaction::TYPE_PARTICIPANTS:
case PhabricatorTransactions::TYPE_VIEW_POLICY:
case PhabricatorTransactions::TYPE_EDIT_POLICY:
case PhabricatorTransactions::TYPE_JOIN_POLICY:
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -1258,19 +1258,19 @@
public function getMailTagsMap() {
return array(
- MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEW_REQUEST =>
+ DifferentialTransaction::MAILTAG_REVIEW_REQUEST =>
pht('A revision is created.'),
- MetaMTANotificationType::TYPE_DIFFERENTIAL_UPDATED =>
+ DifferentialTransaction::MAILTAG_UPDATED =>
pht('A revision is updated.'),
- MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT =>
+ DifferentialTransaction::MAILTAG_COMMENT =>
pht('Someone comments on a revision.'),
- MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED =>
+ DifferentialTransaction::MAILTAG_CLOSED =>
pht('A revision is closed.'),
- MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS =>
+ DifferentialTransaction::MAILTAG_REVIEWERS =>
pht("A revision's reviewers change."),
- MetaMTANotificationType::TYPE_DIFFERENTIAL_CC =>
+ DifferentialTransaction::MAILTAG_CC =>
pht("A revision's CCs change."),
- MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER =>
+ DifferentialTransaction::MAILTAG_OTHER =>
pht('Other revision activity not listed above occurs.'),
);
}
diff --git a/src/applications/differential/storage/DifferentialTransaction.php b/src/applications/differential/storage/DifferentialTransaction.php
--- a/src/applications/differential/storage/DifferentialTransaction.php
+++ b/src/applications/differential/storage/DifferentialTransaction.php
@@ -4,6 +4,19 @@
private $isCommandeerSideEffect;
+ const TYPE_INLINE = 'differential:inline';
+ const TYPE_UPDATE = 'differential:update';
+ const TYPE_ACTION = 'differential:action';
+ const TYPE_STATUS = 'differential:status';
+
+ const MAILTAG_REVIEWERS = 'differential-reviewers';
+ const MAILTAG_CLOSED = 'differential-committed';
+ const MAILTAG_CC = 'differential-cc';
+ const MAILTAG_COMMENT = 'differential-comment';
+ const MAILTAG_UPDATED = 'differential-updated';
+ const MAILTAG_REVIEW_REQUEST = 'differential-review-request';
+ const MAILTAG_OTHER = 'differential-other';
+
public function setIsCommandeerSideEffect($is_side_effect) {
$this->isCommandeerSideEffect = $is_side_effect;
@@ -14,11 +27,6 @@
return $this->isCommandeerSideEffect;
}
- const TYPE_INLINE = 'differential:inline';
- const TYPE_UPDATE = 'differential:update';
- const TYPE_ACTION = 'differential:action';
- const TYPE_STATUS = 'differential:status';
-
public function getApplicationName() {
return 'differential';
}
@@ -109,7 +117,6 @@
}
public function getActionStrength() {
-
switch ($this->getTransactionType()) {
case self::TYPE_ACTION:
return 3;
@@ -160,38 +167,38 @@
switch ($this->getTransactionType()) {
case PhabricatorTransactions::TYPE_SUBSCRIBERS;
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CC;
+ $tags[] = self::MAILTAG_CC;
break;
case self::TYPE_ACTION:
switch ($this->getNewValue()) {
case DifferentialAction::ACTION_CLOSE:
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_CLOSED;
+ $tags[] = self::MAILTAG_CLOSED;
break;
}
break;
case self::TYPE_UPDATE:
$old = $this->getOldValue();
if ($old === null) {
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEW_REQUEST;
+ $tags[] = self::MAILTAG_REVIEW_REQUEST;
} else {
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_UPDATED;
+ $tags[] = self::MAILTAG_UPDATED;
}
break;
case PhabricatorTransactions::TYPE_EDGE:
switch ($this->getMetadataValue('edge:type')) {
case DifferentialRevisionHasReviewerEdgeType::EDGECONST:
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS;
+ $tags[] = self::MAILTAG_REVIEWERS;
break;
}
break;
case PhabricatorTransactions::TYPE_COMMENT:
case self::TYPE_INLINE:
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_COMMENT;
+ $tags[] = self::MAILTAG_COMMENT;
break;
}
if (!$tags) {
- $tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER;
+ $tags[] = self::MAILTAG_OTHER;
}
return $tags;
@@ -280,7 +287,7 @@
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
return pht('This revision now requires review to proceed.');
}
- }
+ }
return parent::getTitle();
}
@@ -438,7 +445,7 @@
'%s now requires review to proceed.',
$object_link);
}
- }
+ }
return parent::getTitleForFeed();
}
diff --git a/src/applications/legalpad/constants/LegalpadConstants.php b/src/applications/legalpad/constants/LegalpadConstants.php
deleted file mode 100644
--- a/src/applications/legalpad/constants/LegalpadConstants.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-abstract class LegalpadConstants {}
diff --git a/src/applications/legalpad/constants/LegalpadTransactionType.php b/src/applications/legalpad/constants/LegalpadTransactionType.php
deleted file mode 100644
--- a/src/applications/legalpad/constants/LegalpadTransactionType.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-final class LegalpadTransactionType extends LegalpadConstants {
-
- const TYPE_TITLE = 'title';
- const TYPE_TEXT = 'text';
- const TYPE_SIGNATURE_TYPE = 'legalpad:signature-type';
- const TYPE_PREAMBLE = 'legalpad:premable';
- const TYPE_REQUIRE_SIGNATURE = 'legalpad:require-signature';
-
-}
diff --git a/src/applications/legalpad/controller/LegalpadDocumentEditController.php b/src/applications/legalpad/controller/LegalpadDocumentEditController.php
--- a/src/applications/legalpad/controller/LegalpadDocumentEditController.php
+++ b/src/applications/legalpad/controller/LegalpadDocumentEditController.php
@@ -57,7 +57,7 @@
$errors[] = pht('The document title may not be blank.');
} else {
$xactions[] = id(new LegalpadTransaction())
- ->setTransactionType(LegalpadTransactionType::TYPE_TITLE)
+ ->setTransactionType(LegalpadTransaction::TYPE_TITLE)
->setNewValue($title);
}
@@ -67,7 +67,7 @@
$errors[] = pht('The document may not be blank.');
} else {
$xactions[] = id(new LegalpadTransaction())
- ->setTransactionType(LegalpadTransactionType::TYPE_TEXT)
+ ->setTransactionType(LegalpadTransaction::TYPE_TEXT)
->setNewValue($text);
}
@@ -83,13 +83,13 @@
if ($is_create) {
$v_signature_type = $request->getStr('signatureType');
$xactions[] = id(new LegalpadTransaction())
- ->setTransactionType(LegalpadTransactionType::TYPE_SIGNATURE_TYPE)
+ ->setTransactionType(LegalpadTransaction::TYPE_SIGNATURE_TYPE)
->setNewValue($v_signature_type);
}
$v_preamble = $request->getStr('preamble');
$xactions[] = id(new LegalpadTransaction())
- ->setTransactionType(LegalpadTransactionType::TYPE_PREAMBLE)
+ ->setTransactionType(LegalpadTransaction::TYPE_PREAMBLE)
->setNewValue($v_preamble);
$v_require_signature = $request->getBool('requireSignature', 0);
@@ -106,7 +106,7 @@
}
if ($user->getIsAdmin()) {
$xactions[] = id(new LegalpadTransaction())
- ->setTransactionType(LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE)
+ ->setTransactionType(LegalpadTransaction::TYPE_REQUIRE_SIGNATURE)
->setNewValue($v_require_signature);
}
diff --git a/src/applications/legalpad/editor/LegalpadDocumentEditor.php b/src/applications/legalpad/editor/LegalpadDocumentEditor.php
--- a/src/applications/legalpad/editor/LegalpadDocumentEditor.php
+++ b/src/applications/legalpad/editor/LegalpadDocumentEditor.php
@@ -28,11 +28,11 @@
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
- $types[] = LegalpadTransactionType::TYPE_TITLE;
- $types[] = LegalpadTransactionType::TYPE_TEXT;
- $types[] = LegalpadTransactionType::TYPE_SIGNATURE_TYPE;
- $types[] = LegalpadTransactionType::TYPE_PREAMBLE;
- $types[] = LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE;
+ $types[] = LegalpadTransaction::TYPE_TITLE;
+ $types[] = LegalpadTransaction::TYPE_TEXT;
+ $types[] = LegalpadTransaction::TYPE_SIGNATURE_TYPE;
+ $types[] = LegalpadTransaction::TYPE_PREAMBLE;
+ $types[] = LegalpadTransaction::TYPE_REQUIRE_SIGNATURE;
return $types;
}
@@ -42,15 +42,15 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case LegalpadTransactionType::TYPE_TITLE:
+ case LegalpadTransaction::TYPE_TITLE:
return $object->getDocumentBody()->getTitle();
- case LegalpadTransactionType::TYPE_TEXT:
+ case LegalpadTransaction::TYPE_TEXT:
return $object->getDocumentBody()->getText();
- case LegalpadTransactionType::TYPE_SIGNATURE_TYPE:
+ case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
return $object->getSignatureType();
- case LegalpadTransactionType::TYPE_PREAMBLE:
+ case LegalpadTransaction::TYPE_PREAMBLE:
return $object->getPreamble();
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
return (bool)$object->getRequireSignature();
}
}
@@ -60,12 +60,12 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case LegalpadTransactionType::TYPE_TITLE:
- case LegalpadTransactionType::TYPE_TEXT:
- case LegalpadTransactionType::TYPE_SIGNATURE_TYPE:
- case LegalpadTransactionType::TYPE_PREAMBLE:
+ case LegalpadTransaction::TYPE_TITLE:
+ case LegalpadTransaction::TYPE_TEXT:
+ case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
+ case LegalpadTransaction::TYPE_PREAMBLE:
return $xaction->getNewValue();
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
return (bool)$xaction->getNewValue();
}
}
@@ -75,24 +75,24 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case LegalpadTransactionType::TYPE_TITLE:
+ case LegalpadTransaction::TYPE_TITLE:
$object->setTitle($xaction->getNewValue());
$body = $object->getDocumentBody();
$body->setTitle($xaction->getNewValue());
$this->setIsContribution(true);
break;
- case LegalpadTransactionType::TYPE_TEXT:
+ case LegalpadTransaction::TYPE_TEXT:
$body = $object->getDocumentBody();
$body->setText($xaction->getNewValue());
$this->setIsContribution(true);
break;
- case LegalpadTransactionType::TYPE_SIGNATURE_TYPE:
+ case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
$object->setSignatureType($xaction->getNewValue());
break;
- case LegalpadTransactionType::TYPE_PREAMBLE:
+ case LegalpadTransaction::TYPE_PREAMBLE:
$object->setPreamble($xaction->getNewValue());
break;
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
$object->setRequireSignature((int)$xaction->getNewValue());
break;
}
@@ -103,7 +103,7 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
if ($xaction->getNewValue()) {
$session = new PhabricatorAuthSession();
queryfx(
@@ -154,11 +154,11 @@
$type = $u->getTransactionType();
switch ($type) {
- case LegalpadTransactionType::TYPE_TITLE:
- case LegalpadTransactionType::TYPE_TEXT:
- case LegalpadTransactionType::TYPE_SIGNATURE_TYPE:
- case LegalpadTransactionType::TYPE_PREAMBLE:
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case LegalpadTransaction::TYPE_TITLE:
+ case LegalpadTransaction::TYPE_TEXT:
+ case LegalpadTransaction::TYPE_SIGNATURE_TYPE:
+ case LegalpadTransaction::TYPE_PREAMBLE:
+ case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
return $v;
}
@@ -200,10 +200,10 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case LegalpadTransactionType::TYPE_TEXT:
- case LegalpadTransactionType::TYPE_TITLE:
- case LegalpadTransactionType::TYPE_PREAMBLE:
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case LegalpadTransaction::TYPE_TEXT:
+ case LegalpadTransaction::TYPE_TITLE:
+ case LegalpadTransaction::TYPE_PREAMBLE:
+ case LegalpadTransaction::TYPE_REQUIRE_SIGNATURE:
return true;
}
diff --git a/src/applications/legalpad/storage/LegalpadTransaction.php b/src/applications/legalpad/storage/LegalpadTransaction.php
--- a/src/applications/legalpad/storage/LegalpadTransaction.php
+++ b/src/applications/legalpad/storage/LegalpadTransaction.php
@@ -2,6 +2,12 @@
final class LegalpadTransaction extends PhabricatorApplicationTransaction {
+ const TYPE_TITLE = 'title';
+ const TYPE_TEXT = 'text';
+ const TYPE_SIGNATURE_TYPE = 'legalpad:signature-type';
+ const TYPE_PREAMBLE = 'legalpad:premable';
+ const TYPE_REQUIRE_SIGNATURE = 'legalpad:require-signature';
+
public function getApplicationName() {
return 'legalpad';
}
@@ -22,10 +28,10 @@
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
- case LegalpadTransactionType::TYPE_TITLE:
- case LegalpadTransactionType::TYPE_TEXT:
+ case self::TYPE_TITLE:
+ case self::TYPE_TEXT:
return ($old === null);
- case LegalpadTransactionType::TYPE_SIGNATURE_TYPE:
+ case self::TYPE_SIGNATURE_TYPE:
return true;
}
@@ -40,21 +46,21 @@
$type = $this->getTransactionType();
switch ($type) {
- case LegalpadTransactionType::TYPE_TITLE:
+ case self::TYPE_TITLE:
return pht(
'%s renamed this document from "%s" to "%s".',
$this->renderHandleLink($author_phid),
$old,
$new);
- case LegalpadTransactionType::TYPE_TEXT:
+ case self::TYPE_TEXT:
return pht(
"%s updated the document's text.",
$this->renderHandleLink($author_phid));
- case LegalpadTransactionType::TYPE_PREAMBLE:
+ case self::TYPE_PREAMBLE:
return pht(
'%s updated the preamble.',
$this->renderHandleLink($author_phid));
- case LegalpadTransactionType::TYPE_REQUIRE_SIGNATURE:
+ case self::TYPE_REQUIRE_SIGNATURE:
if ($new) {
$text = pht(
'%s set the document to require signatures.',
@@ -72,9 +78,9 @@
public function hasChangeDetails() {
switch ($this->getTransactionType()) {
- case LegalpadTransactionType::TYPE_TITLE:
- case LegalpadTransactionType::TYPE_TEXT:
- case LegalpadTransactionType::TYPE_PREAMBLE:
+ case self::TYPE_TITLE:
+ case self::TYPE_TEXT:
+ case self::TYPE_PREAMBLE:
return true;
}
return parent::hasChangeDetails();
diff --git a/src/applications/macro/constants/PhabricatorMacroTransactionType.php b/src/applications/macro/constants/PhabricatorMacroTransactionType.php
deleted file mode 100644
--- a/src/applications/macro/constants/PhabricatorMacroTransactionType.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-final class PhabricatorMacroTransactionType {
-
- const TYPE_NAME = 'macro:name';
- const TYPE_DISABLED = 'macro:disabled';
- const TYPE_FILE = 'macro:file';
-
- const TYPE_AUDIO = 'macro:audio';
- const TYPE_AUDIO_BEHAVIOR = 'macro:audiobehavior';
-
-}
diff --git a/src/applications/macro/controller/PhabricatorMacroAudioController.php b/src/applications/macro/controller/PhabricatorMacroAudioController.php
--- a/src/applications/macro/controller/PhabricatorMacroAudioController.php
+++ b/src/applications/macro/controller/PhabricatorMacroAudioController.php
@@ -40,7 +40,7 @@
if ($request->getBool('behaviorForm')) {
$xactions[] = id(new PhabricatorMacroTransaction())
->setTransactionType(
- PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR)
+ PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR)
->setNewValue($request->getStr('audioBehavior'));
} else {
$file = null;
@@ -60,7 +60,7 @@
$e_file = pht('Invalid');
} else {
$xactions[] = id(new PhabricatorMacroTransaction())
- ->setTransactionType(PhabricatorMacroTransactionType::TYPE_AUDIO)
+ ->setTransactionType(PhabricatorMacroTransaction::TYPE_AUDIO)
->setNewValue($file->getPHID());
}
} else {
diff --git a/src/applications/macro/controller/PhabricatorMacroDisableController.php b/src/applications/macro/controller/PhabricatorMacroDisableController.php
--- a/src/applications/macro/controller/PhabricatorMacroDisableController.php
+++ b/src/applications/macro/controller/PhabricatorMacroDisableController.php
@@ -28,7 +28,7 @@
if ($request->isDialogFormPost() || $macro->getIsDisabled()) {
$xaction = id(new PhabricatorMacroTransaction())
- ->setTransactionType(PhabricatorMacroTransactionType::TYPE_DISABLED)
+ ->setTransactionType(PhabricatorMacroTransaction::TYPE_DISABLED)
->setNewValue($macro->getIsDisabled() ? 0 : 1);
$editor = id(new PhabricatorMacroEditor())
diff --git a/src/applications/macro/controller/PhabricatorMacroEditController.php b/src/applications/macro/controller/PhabricatorMacroEditController.php
--- a/src/applications/macro/controller/PhabricatorMacroEditController.php
+++ b/src/applications/macro/controller/PhabricatorMacroEditController.php
@@ -141,13 +141,13 @@
if ($new_name !== null) {
$xactions[] = id(new PhabricatorMacroTransaction())
- ->setTransactionType(PhabricatorMacroTransactionType::TYPE_NAME)
+ ->setTransactionType(PhabricatorMacroTransaction::TYPE_NAME)
->setNewValue($new_name);
}
if ($file) {
$xactions[] = id(new PhabricatorMacroTransaction())
- ->setTransactionType(PhabricatorMacroTransactionType::TYPE_FILE)
+ ->setTransactionType(PhabricatorMacroTransaction::TYPE_FILE)
->setNewValue($file->getPHID());
}
diff --git a/src/applications/macro/editor/PhabricatorMacroEditor.php b/src/applications/macro/editor/PhabricatorMacroEditor.php
--- a/src/applications/macro/editor/PhabricatorMacroEditor.php
+++ b/src/applications/macro/editor/PhabricatorMacroEditor.php
@@ -15,11 +15,11 @@
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_COMMENT;
- $types[] = PhabricatorMacroTransactionType::TYPE_NAME;
- $types[] = PhabricatorMacroTransactionType::TYPE_DISABLED;
- $types[] = PhabricatorMacroTransactionType::TYPE_FILE;
- $types[] = PhabricatorMacroTransactionType::TYPE_AUDIO;
- $types[] = PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR;
+ $types[] = PhabricatorMacroTransaction::TYPE_NAME;
+ $types[] = PhabricatorMacroTransaction::TYPE_DISABLED;
+ $types[] = PhabricatorMacroTransaction::TYPE_FILE;
+ $types[] = PhabricatorMacroTransaction::TYPE_AUDIO;
+ $types[] = PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR;
return $types;
}
@@ -29,15 +29,15 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case PhabricatorMacroTransaction::TYPE_NAME:
return $object->getName();
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case PhabricatorMacroTransaction::TYPE_DISABLED:
return $object->getIsDisabled();
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case PhabricatorMacroTransaction::TYPE_FILE:
return $object->getFilePHID();
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case PhabricatorMacroTransaction::TYPE_AUDIO:
return $object->getAudioPHID();
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
return $object->getAudioBehavior();
}
}
@@ -47,11 +47,11 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
- case PhabricatorMacroTransactionType::TYPE_FILE:
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case PhabricatorMacroTransaction::TYPE_NAME:
+ case PhabricatorMacroTransaction::TYPE_DISABLED:
+ case PhabricatorMacroTransaction::TYPE_FILE:
+ case PhabricatorMacroTransaction::TYPE_AUDIO:
+ case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
return $xaction->getNewValue();
}
}
@@ -61,19 +61,19 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case PhabricatorMacroTransaction::TYPE_NAME:
$object->setName($xaction->getNewValue());
break;
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case PhabricatorMacroTransaction::TYPE_DISABLED:
$object->setIsDisabled($xaction->getNewValue());
break;
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case PhabricatorMacroTransaction::TYPE_FILE:
$object->setFilePHID($xaction->getNewValue());
break;
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case PhabricatorMacroTransaction::TYPE_AUDIO:
$object->setAudioPHID($xaction->getNewValue());
break;
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
$object->setAudioBehavior($xaction->getNewValue());
break;
}
@@ -84,8 +84,8 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_FILE:
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case PhabricatorMacroTransaction::TYPE_FILE:
+ case PhabricatorMacroTransaction::TYPE_AUDIO:
// When changing a macro's image or audio, attach the underlying files
// to the macro (and detach the old files).
$old = $xaction->getOldValue();
@@ -123,11 +123,11 @@
$type = $u->getTransactionType();
switch ($type) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
- case PhabricatorMacroTransactionType::TYPE_FILE:
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case PhabricatorMacroTransaction::TYPE_NAME:
+ case PhabricatorMacroTransaction::TYPE_DISABLED:
+ case PhabricatorMacroTransaction::TYPE_FILE:
+ case PhabricatorMacroTransaction::TYPE_AUDIO:
+ case PhabricatorMacroTransaction::TYPE_AUDIO_BEHAVIOR:
return $v;
}
@@ -139,7 +139,7 @@
array $xactions) {
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME;
+ case PhabricatorMacroTransaction::TYPE_NAME;
return ($xaction->getOldValue() !== null);
default:
break;
diff --git a/src/applications/macro/storage/PhabricatorMacroTransaction.php b/src/applications/macro/storage/PhabricatorMacroTransaction.php
--- a/src/applications/macro/storage/PhabricatorMacroTransaction.php
+++ b/src/applications/macro/storage/PhabricatorMacroTransaction.php
@@ -3,6 +3,13 @@
final class PhabricatorMacroTransaction
extends PhabricatorApplicationTransaction {
+ const TYPE_NAME = 'macro:name';
+ const TYPE_DISABLED = 'macro:disabled';
+ const TYPE_FILE = 'macro:file';
+
+ const TYPE_AUDIO = 'macro:audio';
+ const TYPE_AUDIO_BEHAVIOR = 'macro:audiobehavior';
+
public function getApplicationName() {
return 'file';
}
@@ -26,8 +33,8 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_FILE:
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case self::TYPE_FILE:
+ case self::TYPE_AUDIO:
if ($old !== null) {
$phids[] = $old;
}
@@ -43,7 +50,7 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
return ($old === null);
}
@@ -57,14 +64,14 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
return pht(
'%s renamed this macro from "%s" to "%s".',
$this->renderHandleLink($author_phid),
$old,
$new);
break;
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case self::TYPE_DISABLED:
if ($new) {
return pht(
'%s disabled this macro.',
@@ -76,7 +83,7 @@
}
break;
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case self::TYPE_AUDIO:
if (!$old) {
return pht(
'%s attached audio: %s.',
@@ -90,7 +97,7 @@
$this->renderHandleLink($new));
}
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case self::TYPE_AUDIO_BEHAVIOR:
switch ($new) {
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
return pht(
@@ -106,7 +113,7 @@
$this->renderHandleLink($author_phid));
}
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case self::TYPE_FILE:
if ($old === null) {
return pht(
'%s created this macro.',
@@ -132,14 +139,14 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
return pht(
'%s renamed %s from "%s" to "%s".',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid),
$old,
$new);
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case self::TYPE_DISABLED:
if ($new) {
return pht(
'%s disabled %s.',
@@ -151,7 +158,7 @@
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
}
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case self::TYPE_FILE:
if ($old === null) {
return pht(
'%s created %s.',
@@ -164,7 +171,7 @@
$this->renderHandleLink($object_phid));
}
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case self::TYPE_AUDIO:
if (!$old) {
return pht(
'%s attached audio to %s: %s.',
@@ -180,7 +187,7 @@
$this->renderHandleLink($new));
}
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case self::TYPE_AUDIO_BEHAVIOR:
switch ($new) {
case PhabricatorFileImageMacro::AUDIO_BEHAVIOR_ONCE:
return pht(
@@ -209,29 +216,29 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht('Created');
} else {
return pht('Renamed');
}
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case self::TYPE_DISABLED:
if ($new) {
return pht('Disabled');
} else {
return pht('Restored');
}
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case self::TYPE_FILE:
if ($old === null) {
return pht('Created');
} else {
return pht('Edited Image');
}
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case self::TYPE_AUDIO:
return pht('Audio');
- case PhabricatorMacroTransactionType::TYPE_AUDIO_BEHAVIOR:
+ case self::TYPE_AUDIO_BEHAVIOR:
return pht('Audio Behavior');
}
@@ -241,9 +248,9 @@
public function getActionStrength() {
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case self::TYPE_DISABLED:
return 2.0;
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case self::TYPE_FILE:
return 1.5;
}
return parent::getActionStrength();
@@ -254,21 +261,21 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
return 'fa-pencil';
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case self::TYPE_FILE:
if ($old === null) {
return 'fa-plus';
} else {
return 'fa-pencil';
}
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case self::TYPE_DISABLED:
if ($new) {
return 'fa-times';
} else {
return 'fa-undo';
}
- case PhabricatorMacroTransactionType::TYPE_AUDIO:
+ case self::TYPE_AUDIO:
return 'fa-headphones';
}
@@ -280,15 +287,15 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PhabricatorMacroTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
return PhabricatorTransactions::COLOR_BLUE;
- case PhabricatorMacroTransactionType::TYPE_FILE:
+ case self::TYPE_FILE:
if ($old === null) {
return PhabricatorTransactions::COLOR_GREEN;
} else {
return PhabricatorTransactions::COLOR_BLUE;
}
- case PhabricatorMacroTransactionType::TYPE_DISABLED:
+ case self::TYPE_DISABLED:
if ($new) {
return PhabricatorTransactions::COLOR_RED;
} else {
diff --git a/src/applications/metamta/constants/MetaMTANotificationType.php b/src/applications/metamta/constants/MetaMTANotificationType.php
deleted file mode 100644
--- a/src/applications/metamta/constants/MetaMTANotificationType.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-final class MetaMTANotificationType
- extends MetaMTAConstants {
-
- const TYPE_DIFFERENTIAL_REVIEWERS = 'differential-reviewers';
- const TYPE_DIFFERENTIAL_CLOSED = 'differential-committed';
- const TYPE_DIFFERENTIAL_CC = 'differential-cc';
- const TYPE_DIFFERENTIAL_COMMENT = 'differential-comment';
- const TYPE_DIFFERENTIAL_UPDATED = 'differential-updated';
- const TYPE_DIFFERENTIAL_REVIEW_REQUEST = 'differential-review-request';
- const TYPE_DIFFERENTIAL_OTHER = 'differential-other';
-
- const TYPE_PHOLIO_STATUS = 'pholio-status';
- const TYPE_PHOLIO_COMMENT = 'pholio-comment';
- const TYPE_PHOLIO_UPDATED = 'pholio-updated';
- const TYPE_PHOLIO_OTHER = 'pholio-other';
-
-}
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
@@ -64,12 +64,10 @@
}
/**
- * Set tags (@{class:MetaMTANotificationType} constants) which identify the
- * content of this mail in a general way. These tags are used to allow users
- * to opt out of receiving certain types of mail, like updates when a task's
- * projects change.
+ * These tags are used to allow users to opt out of receiving certain types
+ * of mail, like updates when a task's projects change.
*
- * @param list<const> List of @{class:MetaMTANotificationType} constants.
+ * @param list<const>
* @return this
*/
public function setMailTags(array $tags) {
diff --git a/src/applications/pholio/constants/PholioConstants.php b/src/applications/pholio/constants/PholioConstants.php
deleted file mode 100644
--- a/src/applications/pholio/constants/PholioConstants.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-
-abstract class PholioConstants {}
diff --git a/src/applications/pholio/constants/PholioTransactionType.php b/src/applications/pholio/constants/PholioTransactionType.php
deleted file mode 100644
--- a/src/applications/pholio/constants/PholioTransactionType.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-final class PholioTransactionType extends PholioConstants {
-
- /* edits to the high level mock */
- const TYPE_NAME = 'name';
- const TYPE_DESCRIPTION = 'description';
- const TYPE_STATUS = 'status';
-
- /* edits to images within the mock */
- const TYPE_IMAGE_FILE = 'image-file';
- const TYPE_IMAGE_NAME= 'image-name';
- const TYPE_IMAGE_DESCRIPTION = 'image-description';
- const TYPE_IMAGE_REPLACE = 'image-replace';
- const TYPE_IMAGE_SEQUENCE = 'image-sequence';
-
- /* your witty commentary at the mock : image : x,y level */
- const TYPE_INLINE = 'inline';
-
-}
diff --git a/src/applications/pholio/controller/PholioMockCommentController.php b/src/applications/pholio/controller/PholioMockCommentController.php
--- a/src/applications/pholio/controller/PholioMockCommentController.php
+++ b/src/applications/pholio/controller/PholioMockCommentController.php
@@ -51,7 +51,7 @@
foreach ($inline_comments as $inline_comment) {
$xactions[] = id(new PholioTransaction())
- ->setTransactionType(PholioTransactionType::TYPE_INLINE)
+ ->setTransactionType(PholioTransaction::TYPE_INLINE)
->attachComment($inline_comment);
}
diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -69,9 +69,9 @@
if ($request->isFormPost()) {
$xactions = array();
- $type_name = PholioTransactionType::TYPE_NAME;
- $type_desc = PholioTransactionType::TYPE_DESCRIPTION;
- $type_status = PholioTransactionType::TYPE_STATUS;
+ $type_name = PholioTransaction::TYPE_NAME;
+ $type_desc = PholioTransaction::TYPE_DESCRIPTION;
+ $type_status = PholioTransaction::TYPE_STATUS;
$type_view = PhabricatorTransactions::TYPE_VIEW_POLICY;
$type_edit = PhabricatorTransactions::TYPE_EDIT_POLICY;
$type_cc = PhabricatorTransactions::TYPE_SUBSCRIBERS;
@@ -160,7 +160,7 @@
->setSequence($sequence);
$xactions[] = id(new PholioTransaction())
->setTransactionType(
- PholioTransactionType::TYPE_IMAGE_REPLACE)
+ PholioTransaction::TYPE_IMAGE_REPLACE)
->setNewValue($replace_image);
$posted_mock_images[] = $replace_image;
} else if (!$existing_image) { // this is an add
@@ -171,23 +171,23 @@
->setDescription($description)
->setSequence($sequence);
$xactions[] = id(new PholioTransaction())
- ->setTransactionType(PholioTransactionType::TYPE_IMAGE_FILE)
+ ->setTransactionType(PholioTransaction::TYPE_IMAGE_FILE)
->setNewValue(
array('+' => array($add_image)));
$posted_mock_images[] = $add_image;
} else {
$xactions[] = id(new PholioTransaction())
- ->setTransactionType(PholioTransactionType::TYPE_IMAGE_NAME)
+ ->setTransactionType(PholioTransaction::TYPE_IMAGE_NAME)
->setNewValue(
array($existing_image->getPHID() => $title));
$xactions[] = id(new PholioTransaction())
->setTransactionType(
- PholioTransactionType::TYPE_IMAGE_DESCRIPTION)
+ PholioTransaction::TYPE_IMAGE_DESCRIPTION)
->setNewValue(
array($existing_image->getPHID() => $description));
$xactions[] = id(new PholioTransaction())
->setTransactionType(
- PholioTransactionType::TYPE_IMAGE_SEQUENCE)
+ PholioTransaction::TYPE_IMAGE_SEQUENCE)
->setNewValue(
array($existing_image->getPHID() => $sequence));
@@ -198,7 +198,7 @@
if (!isset($files[$file_phid]) && !isset($replaces[$file_phid])) {
// this is an outright delete
$xactions[] = id(new PholioTransaction())
- ->setTransactionType(PholioTransactionType::TYPE_IMAGE_FILE)
+ ->setTransactionType(PholioTransaction::TYPE_IMAGE_FILE)
->setNewValue(
array('-' => array($mock_image)));
}
diff --git a/src/applications/pholio/editor/PholioMockEditor.php b/src/applications/pholio/editor/PholioMockEditor.php
--- a/src/applications/pholio/editor/PholioMockEditor.php
+++ b/src/applications/pholio/editor/PholioMockEditor.php
@@ -29,16 +29,16 @@
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
- $types[] = PholioTransactionType::TYPE_NAME;
- $types[] = PholioTransactionType::TYPE_DESCRIPTION;
- $types[] = PholioTransactionType::TYPE_STATUS;
- $types[] = PholioTransactionType::TYPE_INLINE;
+ $types[] = PholioTransaction::TYPE_NAME;
+ $types[] = PholioTransaction::TYPE_DESCRIPTION;
+ $types[] = PholioTransaction::TYPE_STATUS;
+ $types[] = PholioTransaction::TYPE_INLINE;
- $types[] = PholioTransactionType::TYPE_IMAGE_FILE;
- $types[] = PholioTransactionType::TYPE_IMAGE_NAME;
- $types[] = PholioTransactionType::TYPE_IMAGE_DESCRIPTION;
- $types[] = PholioTransactionType::TYPE_IMAGE_REPLACE;
- $types[] = PholioTransactionType::TYPE_IMAGE_SEQUENCE;
+ $types[] = PholioTransaction::TYPE_IMAGE_FILE;
+ $types[] = PholioTransaction::TYPE_IMAGE_NAME;
+ $types[] = PholioTransaction::TYPE_IMAGE_DESCRIPTION;
+ $types[] = PholioTransaction::TYPE_IMAGE_REPLACE;
+ $types[] = PholioTransaction::TYPE_IMAGE_SEQUENCE;
return $types;
}
@@ -48,16 +48,16 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_NAME:
+ case PholioTransaction::TYPE_NAME:
return $object->getName();
- case PholioTransactionType::TYPE_DESCRIPTION:
+ case PholioTransaction::TYPE_DESCRIPTION:
return $object->getDescription();
- case PholioTransactionType::TYPE_STATUS:
+ case PholioTransaction::TYPE_STATUS:
return $object->getStatus();
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
$images = $object->getImages();
return mpull($images, 'getPHID');
- case PholioTransactionType::TYPE_IMAGE_NAME:
+ case PholioTransaction::TYPE_IMAGE_NAME:
$name = null;
$phid = null;
$image = $this->getImageForXaction($object, $xaction);
@@ -66,7 +66,7 @@
$phid = $image->getPHID();
}
return array($phid => $name);
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case PholioTransaction::TYPE_IMAGE_DESCRIPTION:
$description = null;
$phid = null;
$image = $this->getImageForXaction($object, $xaction);
@@ -75,10 +75,10 @@
$phid = $image->getPHID();
}
return array($phid => $description);
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
$raw = $xaction->getNewValue();
return $raw->getReplacesImagePHID();
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case PholioTransaction::TYPE_IMAGE_SEQUENCE:
$sequence = null;
$phid = null;
$image = $this->getImageForXaction($object, $xaction);
@@ -95,17 +95,17 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_NAME:
- case PholioTransactionType::TYPE_DESCRIPTION:
- case PholioTransactionType::TYPE_STATUS:
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case PholioTransaction::TYPE_NAME:
+ case PholioTransaction::TYPE_DESCRIPTION:
+ case PholioTransaction::TYPE_STATUS:
+ case PholioTransaction::TYPE_IMAGE_NAME:
+ case PholioTransaction::TYPE_IMAGE_DESCRIPTION:
+ case PholioTransaction::TYPE_IMAGE_SEQUENCE:
return $xaction->getNewValue();
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
$raw = $xaction->getNewValue();
return $raw->getPHID();
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
$raw_new_value = $xaction->getNewValue();
$new_value = array();
foreach ($raw_new_value as $key => $images) {
@@ -121,14 +121,14 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
$new = $xaction->getNewValue();
$phids = array();
foreach ($new as $key => $images) {
$phids[] = mpull($images, 'getFilePHID');
}
return array_mergev($phids);
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
return array($xaction->getNewValue()->getFilePHID());
}
@@ -141,7 +141,7 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case PholioTransaction::TYPE_INLINE:
return true;
}
@@ -154,8 +154,8 @@
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_IMAGE_FILE:
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
return true;
break;
}
@@ -170,7 +170,7 @@
$new_images = array();
foreach ($xactions as $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
$new_value = $xaction->getNewValue();
foreach ($new_value as $key => $txn_images) {
if ($key != '+') {
@@ -182,7 +182,7 @@
}
}
break;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
$image = $xaction->getNewValue();
$image->save();
$new_images[] = $image;
@@ -197,16 +197,16 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_NAME:
+ case PholioTransaction::TYPE_NAME:
$object->setName($xaction->getNewValue());
if ($object->getOriginalName() === null) {
$object->setOriginalName($xaction->getNewValue());
}
break;
- case PholioTransactionType::TYPE_DESCRIPTION:
+ case PholioTransaction::TYPE_DESCRIPTION:
$object->setDescription($xaction->getNewValue());
break;
- case PholioTransactionType::TYPE_STATUS:
+ case PholioTransaction::TYPE_STATUS:
$object->setStatus($xaction->getNewValue());
break;
}
@@ -231,7 +231,7 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
$old_map = array_fuse($xaction->getOldValue());
$new_map = array_fuse($xaction->getNewValue());
@@ -246,7 +246,7 @@
}
$object->attachImages($images);
break;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
$old = $xaction->getOldValue();
$images = $object->getImages();
foreach ($images as $seq => $image) {
@@ -258,19 +258,19 @@
}
$object->attachImages($images);
break;
- case PholioTransactionType::TYPE_IMAGE_NAME:
+ case PholioTransaction::TYPE_IMAGE_NAME:
$image = $this->getImageForXaction($object, $xaction);
$value = (string)head($xaction->getNewValue());
$image->setName($value);
$image->save();
break;
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case PholioTransaction::TYPE_IMAGE_DESCRIPTION:
$image = $this->getImageForXaction($object, $xaction);
$value = (string)head($xaction->getNewValue());
$image->setDescription($value);
$image->save();
break;
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case PholioTransaction::TYPE_IMAGE_SEQUENCE:
$image = $this->getImageForXaction($object, $xaction);
$value = (int)head($xaction->getNewValue());
$image->setSequence($value);
@@ -298,22 +298,22 @@
$type = $u->getTransactionType();
switch ($type) {
- case PholioTransactionType::TYPE_NAME:
- case PholioTransactionType::TYPE_DESCRIPTION:
- case PholioTransactionType::TYPE_STATUS:
+ case PholioTransaction::TYPE_NAME:
+ case PholioTransaction::TYPE_DESCRIPTION:
+ case PholioTransaction::TYPE_STATUS:
return $v;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case PholioTransaction::TYPE_IMAGE_REPLACE:
$u_img = $u->getNewValue();
$v_img = $v->getNewValue();
if ($u_img->getReplacesImagePHID() == $v_img->getReplacesImagePHID()) {
return $v;
}
break;
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case PholioTransaction::TYPE_IMAGE_FILE:
return $this->mergePHIDOrEdgeTransactions($u, $v);
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case PholioTransaction::TYPE_IMAGE_NAME:
+ case PholioTransaction::TYPE_IMAGE_DESCRIPTION:
+ case PholioTransaction::TYPE_IMAGE_SEQUENCE:
$raw_new_value_u = $u->getNewValue();
$raw_new_value_v = $v->getNewValue();
$phid_u = key($raw_new_value_u);
@@ -370,7 +370,7 @@
}
$comment = $xaction->getComment();
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case PholioTransaction::TYPE_INLINE:
if ($comment && strlen($comment->getContent())) {
$inline_comments[] = $comment;
}
@@ -418,13 +418,13 @@
public function getMailTagsMap() {
return array(
- MetaMTANotificationType::TYPE_PHOLIO_STATUS =>
+ PholioTransaction::MAILTAG_STATUS =>
pht("A mock's status changes."),
- MetaMTANotificationType::TYPE_PHOLIO_COMMENT =>
+ PholioTransaction::MAILTAG_COMMENT =>
pht('Someone comments on a mock.'),
- MetaMTANotificationType::TYPE_PHOLIO_UPDATED =>
+ PholioTransaction::MAILTAG_UPDATED =>
pht('Mock images or descriptions change.'),
- MetaMTANotificationType::TYPE_PHOLIO_OTHER =>
+ PholioTransaction::MAILTAG_OTHER =>
pht('Other mock activity not listed above occurs.'),
);
}
@@ -478,7 +478,7 @@
// Move inline comments to the end, so the comments precede them.
foreach ($xactions as $xaction) {
$type = $xaction->getTransactionType();
- if ($type == PholioTransactionType::TYPE_INLINE) {
+ if ($type == PholioTransaction::TYPE_INLINE) {
$tail[] = $xaction;
} else {
$head[] = $xaction;
@@ -493,7 +493,7 @@
PhabricatorApplicationTransaction $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case PholioTransaction::TYPE_INLINE:
return true;
}
diff --git a/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php b/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php
--- a/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php
+++ b/src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php
@@ -17,9 +17,9 @@
// Accumulate Transactions
$changes = array();
- $changes[PholioTransactionType::TYPE_NAME] =
+ $changes[PholioTransaction::TYPE_NAME] =
$this->generateTitle();
- $changes[PholioTransactionType::TYPE_DESCRIPTION] =
+ $changes[PholioTransaction::TYPE_DESCRIPTION] =
$this->generateDescription();
$changes[PhabricatorTransactions::TYPE_VIEW_POLICY] =
PhabricatorPolicies::POLICY_PUBLIC;
diff --git a/src/applications/pholio/storage/PholioTransaction.php b/src/applications/pholio/storage/PholioTransaction.php
--- a/src/applications/pholio/storage/PholioTransaction.php
+++ b/src/applications/pholio/storage/PholioTransaction.php
@@ -2,6 +2,26 @@
final class PholioTransaction extends PhabricatorApplicationTransaction {
+ // Edits to the high level mock
+ const TYPE_NAME = 'name';
+ const TYPE_DESCRIPTION = 'description';
+ const TYPE_STATUS = 'status';
+
+ // Edits to images within the mock
+ const TYPE_IMAGE_FILE = 'image-file';
+ const TYPE_IMAGE_NAME= 'image-name';
+ const TYPE_IMAGE_DESCRIPTION = 'image-description';
+ const TYPE_IMAGE_REPLACE = 'image-replace';
+ const TYPE_IMAGE_SEQUENCE = 'image-sequence';
+
+ // Your witty commentary at the mock : image : x,y level
+ const TYPE_INLINE = 'inline';
+
+ const MAILTAG_STATUS = 'pholio-status';
+ const MAILTAG_COMMENT = 'pholio-comment';
+ const MAILTAG_UPDATED = 'pholio-updated';
+ const MAILTAG_OTHER = 'pholio-other';
+
public function getApplicationName() {
return 'pholio';
}
@@ -26,16 +46,16 @@
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case self::TYPE_IMAGE_FILE:
$phids = array_merge($phids, $new, $old);
break;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case self::TYPE_IMAGE_REPLACE:
$phids[] = $new;
$phids[] = $old;
break;
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_SEQUENCE:
$phids[] = key($new);
break;
}
@@ -47,13 +67,13 @@
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return ($old === null);
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_DESCRIPTION:
return ($old === array(null => null));
// this is boring / silly to surface; changing sequence is NBD
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_IMAGE_SEQUENCE:
return true;
}
@@ -62,17 +82,17 @@
public function getIcon() {
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case self::TYPE_INLINE:
return 'fa-comment';
- case PholioTransactionType::TYPE_NAME:
- case PholioTransactionType::TYPE_DESCRIPTION:
- case PholioTransactionType::TYPE_STATUS:
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_NAME:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_STATUS:
+ case self::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_SEQUENCE:
return 'fa-pencil';
- case PholioTransactionType::TYPE_IMAGE_FILE:
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case self::TYPE_IMAGE_FILE:
+ case self::TYPE_IMAGE_REPLACE:
return 'fa-picture-o';
}
@@ -82,24 +102,24 @@
public function getMailTags() {
$tags = array();
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case self::TYPE_INLINE:
case PhabricatorTransactions::TYPE_COMMENT:
- $tags[] = MetaMTANotificationType::TYPE_PHOLIO_COMMENT;
+ $tags[] = self::MAILTAG_COMMENT;
break;
- case PholioTransactionType::TYPE_STATUS:
- $tags[] = MetaMTANotificationType::TYPE_PHOLIO_STATUS;
+ case self::TYPE_STATUS:
+ $tags[] = self::MAILTAG_STATUS;
break;
- case PholioTransactionType::TYPE_NAME:
- case PholioTransactionType::TYPE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
- case PholioTransactionType::TYPE_IMAGE_FILE:
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
- $tags[] = MetaMTANotificationType::TYPE_PHOLIO_UPDATED;
+ case self::TYPE_NAME:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_IMAGE_FILE:
+ case self::TYPE_IMAGE_REPLACE:
+ $tags[] = self::MAILTAG_UPDATED;
break;
default:
- $tags[] = MetaMTANotificationType::TYPE_PHOLIO_OTHER;
+ $tags[] = self::MAILTAG_OTHER;
break;
}
return $tags;
@@ -113,7 +133,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case PholioTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht(
'%s created "%s".',
@@ -127,17 +147,17 @@
$new);
}
break;
- case PholioTransactionType::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return pht(
"%s updated the mock's description.",
$this->renderHandleLink($author_phid));
break;
- case PholioTransactionType::TYPE_STATUS:
+ case self::TYPE_STATUS:
return pht(
"%s updated the mock's status.",
$this->renderHandleLink($author_phid));
break;
- case PholioTransactionType::TYPE_INLINE:
+ case self::TYPE_INLINE:
$count = 1;
foreach ($this->getTransactionGroup() as $xaction) {
if ($xaction->getTransactionType() == $type) {
@@ -150,14 +170,14 @@
$this->renderHandleLink($author_phid),
$count);
break;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case self::TYPE_IMAGE_REPLACE:
return pht(
'%s replaced %s with %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($old),
$this->renderHandleLink($new));
break;
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case self::TYPE_IMAGE_FILE:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
@@ -184,7 +204,7 @@
}
break;
- case PholioTransactionType::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_NAME:
return pht(
'%s renamed an image (%s) from "%s" to "%s".',
$this->renderHandleLink($author_phid),
@@ -192,13 +212,13 @@
reset($old),
reset($new));
break;
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_DESCRIPTION:
return pht(
'%s updated an image\'s (%s) description.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink(key($new)));
break;
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_IMAGE_SEQUENCE:
return pht(
'%s updated an image\'s (%s) sequence.',
$this->renderHandleLink($author_phid),
@@ -218,7 +238,7 @@
$type = $this->getTransactionType();
switch ($type) {
- case PholioTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return pht(
'%s created %s.',
@@ -233,44 +253,44 @@
$new);
}
break;
- case PholioTransactionType::TYPE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
return pht(
'%s updated the description for %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PholioTransactionType::TYPE_STATUS:
+ case self::TYPE_STATUS:
return pht(
'%s updated the status for %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PholioTransactionType::TYPE_INLINE:
+ case self::TYPE_INLINE:
return pht(
'%s added an inline comment to %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case self::TYPE_IMAGE_REPLACE:
+ case self::TYPE_IMAGE_FILE:
return pht(
'%s updated images of %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PholioTransactionType::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_NAME:
return pht(
'%s updated the image names of %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_DESCRIPTION:
return pht(
'%s updated image descriptions of %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_IMAGE_SEQUENCE:
return pht(
'%s updated image sequence of %s.',
$this->renderHandleLink($author_phid),
@@ -284,13 +304,13 @@
public function getBodyForFeed(PhabricatorFeedStory $story) {
$text = null;
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
if ($this->getOldValue() === null) {
$mock = $story->getPrimaryObject();
$text = $mock->getDescription();
}
break;
- case PholioTransactionType::TYPE_INLINE:
+ case self::TYPE_INLINE:
$text = $this->getComment()->getContent();
break;
}
@@ -307,8 +327,8 @@
public function hasChangeDetails() {
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_IMAGE_DESCRIPTION:
return true;
}
return parent::hasChangeDetails();
@@ -318,7 +338,7 @@
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($this->getTransactionType() ==
- PholioTransactionType::TYPE_IMAGE_DESCRIPTION) {
+ self::TYPE_IMAGE_DESCRIPTION) {
$old = reset($old);
$new = reset($new);
}
@@ -334,19 +354,19 @@
$new = $this->getNewValue();
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_NAME:
+ case self::TYPE_NAME:
if ($old === null) {
return PhabricatorTransactions::COLOR_GREEN;
}
- case PholioTransactionType::TYPE_DESCRIPTION:
- case PholioTransactionType::TYPE_STATUS:
- case PholioTransactionType::TYPE_IMAGE_NAME:
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_DESCRIPTION:
+ case self::TYPE_STATUS:
+ case self::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_SEQUENCE:
return PhabricatorTransactions::COLOR_BLUE;
- case PholioTransactionType::TYPE_IMAGE_REPLACE:
+ case self::TYPE_IMAGE_REPLACE:
return PhabricatorTransactions::COLOR_YELLOW;
- case PholioTransactionType::TYPE_IMAGE_FILE:
+ case self::TYPE_IMAGE_FILE:
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
if ($add && $rem) {
@@ -363,11 +383,11 @@
public function getNoEffectDescription() {
switch ($this->getTransactionType()) {
- case PholioTransactionType::TYPE_IMAGE_NAME:
+ case self::TYPE_IMAGE_NAME:
return pht('The image title was not updated.');
- case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
+ case self::TYPE_IMAGE_DESCRIPTION:
return pht('The image description was not updated.');
- case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
+ case self::TYPE_IMAGE_SEQUENCE:
return pht('The image sequence was not updated.');
}
diff --git a/src/applications/pholio/view/PholioTransactionView.php b/src/applications/pholio/view/PholioTransactionView.php
--- a/src/applications/pholio/view/PholioTransactionView.php
+++ b/src/applications/pholio/view/PholioTransactionView.php
@@ -30,14 +30,14 @@
switch ($u->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT:
- case PholioTransactionType::TYPE_INLINE:
+ case PholioTransaction::TYPE_INLINE:
break;
default:
return false;
}
switch ($v->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case PholioTransaction::TYPE_INLINE:
return true;
}
@@ -50,7 +50,7 @@
$out = array();
$group = $xaction->getTransactionGroup();
- if ($xaction->getTransactionType() == PholioTransactionType::TYPE_INLINE) {
+ if ($xaction->getTransactionType() == PholioTransaction::TYPE_INLINE) {
array_unshift($group, $xaction);
} else {
$out[] = parent::renderTransactionContent($xaction);
@@ -63,7 +63,7 @@
$inlines = array();
foreach ($group as $xaction) {
switch ($xaction->getTransactionType()) {
- case PholioTransactionType::TYPE_INLINE:
+ case PholioTransaction::TYPE_INLINE:
$inlines[] = $xaction;
break;
default:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 27, 11:08 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710512
Default Alt Text
D13188.id31893.diff (93 KB)
Attached To
Mode
D13188: Remove `*TransactionType` classes
Attached
Detach File
Event Timeline
Log In to Comment