forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorProjectColumnTransaction.php
82 lines (73 loc) · 2.28 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
final class PhabricatorProjectColumnTransaction
extends PhabricatorApplicationTransaction {
const TYPE_NAME = 'project:col:name';
const TYPE_STATUS = 'project:col:status';
const TYPE_LIMIT = 'project:col:limit';
public function getApplicationName() {
return 'project';
}
public function getApplicationTransactionType() {
return PhabricatorProjectColumnPHIDType::TYPECONST;
}
public function getTitle() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$author_handle = $this->renderHandleLink($this->getAuthorPHID());
switch ($this->getTransactionType()) {
case PhabricatorProjectColumnTransaction::TYPE_NAME:
if ($old === null) {
return pht(
'%s created this column.',
$author_handle);
} else {
if (!strlen($old)) {
return pht(
'%s named this column "%s".',
$author_handle,
$new);
} else if (strlen($new)) {
return pht(
'%s renamed this column from "%s" to "%s".',
$author_handle,
$old,
$new);
} else {
return pht(
'%s removed the custom name of this column.',
$author_handle);
}
}
case PhabricatorProjectColumnTransaction::TYPE_LIMIT:
if (!$old) {
return pht(
'%s set the point limit for this column to %s.',
$author_handle,
$new);
} else if (!$new) {
return pht(
'%s removed the point limit for this column.',
$author_handle);
} else {
return pht(
'%s changed point limit for this column from %s to %s.',
$author_handle,
$old,
$new);
}
case PhabricatorProjectColumnTransaction::TYPE_STATUS:
switch ($new) {
case PhabricatorProjectColumn::STATUS_ACTIVE:
return pht(
'%s marked this column visible.',
$author_handle);
case PhabricatorProjectColumn::STATUS_HIDDEN:
return pht(
'%s marked this column hidden.',
$author_handle);
}
break;
}
return parent::getTitle();
}
}