-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathProjectOpenTasksProfileMenuItem.php
57 lines (46 loc) · 1.32 KB
/
ProjectOpenTasksProfileMenuItem.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
<?php
// Source: https://raw.githubusercontent.com/wikimedia/phabricator-extensions/wmf/stable/src/panel/ProjectOpenTasksProfileMenuItem.php
final class ProjectOpenTasksProfileMenuItem extends PhabricatorProfileMenuItem {
public const MENUITEMKEY = 'custom.open-tasks';
public function getMenuItemTypeIcon() {
return 'fa-anchor';
}
public function getMenuItemTypeName() {
return pht( 'Link to Open Tasks' );
}
public function canAddToObject(
$object
) {
return ( $object instanceof PhabricatorProject );
}
public function getDisplayName(
PhabricatorProfileMenuItemConfiguration $config
) {
return pht( 'Open Tasks' );
}
protected function newMenuItemViewList(
PhabricatorProfileMenuItemConfiguration $config
) {
$object = $config->getProfileObject();
$uri = '/maniphest/?project=' . $object->getPHID() . '&statuses=open()&group=none&order=newest#R';
$item = $this->newItemView()
->setURI( $uri )
->setName( $this->getDisplayName( $config ) )
->setIcon( 'fa-anchor' );
return [
$item,
];
}
public function buildEditEngineFields(
PhabricatorProfileMenuItemConfiguration $config
) {
return [
id( new PhabricatorInstructionsEditField() )->setValue(
pht(
'This adds a link to search maniphest for open tasks which are ' .
"tagged with this project.\n\n"
)
),
];
}
}