mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 12:42:43 +01:00
28941b3105
Summary: Modernize PhortuneMerchant for Modular Transactions. Also changed the language of "Members" to "Managers", which I think fits better given the power/capability. Test Plan: - Create a new Merchant - Test not filling in a name, see error - Test removing myself, see error - Edit an existing Merchant - Add new managers - Test removing myself, see error - Replace Picture - Update various fields, contact info, email, footer - Verify transactions are now nice and pretty Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17584
56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?php
|
|
|
|
final class PhortuneMerchantDescriptionTransaction
|
|
extends PhortuneMerchantTransactionType {
|
|
|
|
const TRANSACTIONTYPE = 'merchant:description';
|
|
|
|
public function generateOldValue($object) {
|
|
return $object->getDescription();
|
|
}
|
|
|
|
public function applyInternalEffects($object, $value) {
|
|
$object->setDescription($value);
|
|
}
|
|
|
|
public function getTitle() {
|
|
return pht(
|
|
'%s updated the merchant description.',
|
|
$this->renderAuthor());
|
|
}
|
|
|
|
public function getTitleForFeed() {
|
|
return pht(
|
|
'%s updated the merchant description for %s.',
|
|
$this->renderAuthor(),
|
|
$this->renderObject());
|
|
}
|
|
|
|
public function hasChangeDetailView() {
|
|
return true;
|
|
}
|
|
|
|
public function getMailDiffSectionHeader() {
|
|
return pht('CHANGES TO MERCHANT DESCRIPTION');
|
|
}
|
|
|
|
public function newChangeDetailView() {
|
|
$viewer = $this->getViewer();
|
|
|
|
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
|
->setViewer($viewer)
|
|
->setOldText($this->getOldValue())
|
|
->setNewText($this->getNewValue());
|
|
}
|
|
|
|
public function newRemarkupChanges() {
|
|
$changes = array();
|
|
|
|
$changes[] = $this->newRemarkupChange()
|
|
->setOldValue($this->getOldValue())
|
|
->setNewValue($this->getNewValue());
|
|
|
|
return $changes;
|
|
}
|
|
|
|
}
|