Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892420
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/ponder/phid/PonderAnswerPHIDType.php b/src/applications/ponder/phid/PonderAnswerPHIDType.php
index 24564f6a6f..c8747007d3 100644
--- a/src/applications/ponder/phid/PonderAnswerPHIDType.php
+++ b/src/applications/ponder/phid/PonderAnswerPHIDType.php
@@ -1,38 +1,40 @@
<?php
final class PonderAnswerPHIDType extends PhabricatorPHIDType {
const TYPECONST = 'ANSW';
public function getTypeName() {
return pht('Answer');
}
public function newObject() {
return new PonderAnswer();
}
protected function buildQueryForObjects(
PhabricatorObjectQuery $query,
array $phids) {
return id(new PonderAnswerQuery())
->withPHIDs($phids);
}
public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects) {
foreach ($handles as $phid => $handle) {
$answer = $objects[$phid];
$id = $answer->getID();
+ $question = $answer->getQuestion();
+ $question_title = $question->getFullTitle();
- $handle->setName("Answer {$id}");
+ $handle->setName("{$question_title} (Answer {$id})");
$handle->setURI($answer->getURI());
}
}
}
diff --git a/src/applications/ponder/storage/PonderAnswerTransaction.php b/src/applications/ponder/storage/PonderAnswerTransaction.php
index 7b70dcadc1..ced8a08fe9 100644
--- a/src/applications/ponder/storage/PonderAnswerTransaction.php
+++ b/src/applications/ponder/storage/PonderAnswerTransaction.php
@@ -1,104 +1,98 @@
<?php
final class PonderAnswerTransaction
extends PhabricatorApplicationTransaction {
const TYPE_CONTENT = 'ponder.answer:content';
public function getApplicationName() {
return 'ponder';
}
public function getTableName() {
return 'ponder_answertransaction';
}
public function getApplicationTransactionType() {
return PonderAnswerPHIDType::TYPECONST;
}
public function getApplicationTransactionCommentObject() {
return new PonderAnswerTransactionComment();
}
public function getRequiredHandlePHIDs() {
$phids = parent::getRequiredHandlePHIDs();
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
$phids[] = $this->getObjectPHID();
break;
}
return $phids;
}
public function getTitle() {
$author_phid = $this->getAuthorPHID();
$object_phid = $this->getObjectPHID();
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
return pht(
'%s edited %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
}
return parent::getTitle();
}
public function getTitleForFeed(PhabricatorFeedStory $story) {
$author_phid = $this->getAuthorPHID();
$object_phid = $this->getObjectPHID();
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
- $answer = $story->getObject($object_phid);
- $question = $answer->getQuestion();
- $answer_handle = $this->getHandle($object_phid);
- $link = $answer_handle->renderLink(
- $question->getFullTitle());
-
return pht(
- '%s updated their answer to %s',
+ '%s updated %s.',
$this->renderHandleLink($author_phid),
- $link);
+ $this->renderHandleLink($object_phid));
}
return parent::getTitleForFeed($story);
}
public function getBodyForFeed(PhabricatorFeedStory $story) {
$new = $this->getNewValue();
$body = null;
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
return phutil_escape_html_newlines(
phutil_utf8_shorten($new, 128));
break;
}
return parent::getBodyForFeed($story);
}
public function hasChangeDetails() {
$old = $this->getOldValue();
switch ($this->getTransactionType()) {
case self::TYPE_CONTENT:
return $old !== null;
}
return parent::hasChangeDetails();
}
public function renderChangeDetails(PhabricatorUser $viewer) {
return $this->renderTextCorpusChangeDetails(
$viewer,
$this->getOldValue(),
$this->getNewValue());
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 16:48 (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126628
Default Alt Text
(4 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment