mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +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 PhortuneMerchantContactInfoTransaction
|
|
extends PhortuneMerchantTransactionType {
|
|
|
|
const TRANSACTIONTYPE = 'merchant:contactinfo';
|
|
|
|
public function generateOldValue($object) {
|
|
return $object->getContactInfo();
|
|
}
|
|
|
|
public function applyInternalEffects($object, $value) {
|
|
$object->setContactInfo($value);
|
|
}
|
|
|
|
public function getTitle() {
|
|
return pht(
|
|
'%s updated the merchant contact info.',
|
|
$this->renderAuthor());
|
|
}
|
|
|
|
public function getTitleForFeed() {
|
|
return pht(
|
|
'%s updated the merchant contact info for %s.',
|
|
$this->renderAuthor(),
|
|
$this->renderObject());
|
|
}
|
|
|
|
public function hasChangeDetailView() {
|
|
return true;
|
|
}
|
|
|
|
public function getMailDiffSectionHeader() {
|
|
return pht('CHANGES TO MERCHANT CONTACT INFO');
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
}
|