mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-02 23:49:19 +01:00
Summary: followup to D8544. This ends up creating an editor + transactions to get the job done. Test Plan: made a column - saw a nice created transaction. edited the name - saw a nice name edit. deleted the column - saw a deleted transaction, updated "deleted" ui, and hte action change to activate. "Activated" the column and saw a transaction and updated UI. Tried to delete a column with tasks in it and got an error. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D8620
52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
|
|
final class PhabricatorProjectColumnTransaction
|
|
extends PhabricatorApplicationTransaction {
|
|
|
|
const TYPE_NAME = 'project:col:name';
|
|
const TYPE_STATUS = 'project:col:status';
|
|
|
|
public function getApplicationName() {
|
|
return 'project';
|
|
}
|
|
|
|
public function getApplicationTransactionType() {
|
|
return PhabricatorProjectPHIDTypeColumn::TYPECONST;
|
|
}
|
|
|
|
public function getTitle() {
|
|
$old = $this->getOldValue();
|
|
$new = $this->getNewValue();
|
|
$author_handle = $this->renderHandleLink($this->getAuthorPHID());
|
|
|
|
switch ($this->getTransactionType()) {
|
|
case PhabricatorProjectColumnTransaction::TYPE_NAME:
|
|
if (!strlen($old)) {
|
|
return pht(
|
|
'%s created this column.',
|
|
$author_handle);
|
|
} else {
|
|
return pht(
|
|
'%s renamed this column from "%s" to "%s".',
|
|
$author_handle,
|
|
$old,
|
|
$new);
|
|
}
|
|
case PhabricatorProjectColumnTransaction::TYPE_STATUS:
|
|
switch ($new) {
|
|
case PhabricatorProjectColumn::STATUS_ACTIVE:
|
|
return pht(
|
|
'%s activated this column.',
|
|
$author_handle);
|
|
case PhabricatorProjectColumn::STATUS_DELETED:
|
|
return pht(
|
|
'%s deleted this column.',
|
|
$author_handle);
|
|
}
|
|
break;
|
|
}
|
|
|
|
return parent::getTitle();
|
|
}
|
|
|
|
}
|