forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorProjectColumnTransaction.php
52 lines (44 loc) · 1.37 KB
/
PhabricatorProjectColumnTransaction.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?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();
}
}