-
Notifications
You must be signed in to change notification settings - Fork 2
/
tpl.issueheader.php
66 lines (60 loc) · 3.32 KB
/
tpl.issueheader.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
<?php
$fields = $issue->fields;
$actionPath = 'transition.php?key=' . $key . '&summary=' . urlencode(trim($fields->summary)) . '&transition=';
$actions = array();
$actions['Edit'] = 'issue.php?key=' . $key . '&edit';
foreach ( $issue->transitions AS $transition ) {
$actions[$transition->name] = $actionPath . $transition->id;
}
$actions['Labels'] = 'labels.php?key=' . $key;
$actions['Log work'] = 'logwork.php?key=' . $key . '&summary=' . urlencode(trim($fields->summary));
$actions['Upload'] = 'upload.php?key=' . $key . '&summary=' . urlencode(trim($fields->summary));
$actions['Link'] = 'link.php?key=' . $key . '&summary=' . urlencode(trim($fields->summary));
if ( !$fields->issuetype->subtask ) {
$actions['+Subtask'] = 'new.php?project=' . $fields->project->id . '&parent=' . $key . '&parentsummary=' . urlencode(trim($fields->summary));
}
$actions['Changelog'] = 'changelog.php?key=' . $key;
$actions['➔ View in Jira'] = JIRA_ORIGIN . '/browse/' . $key;
$resolution = '';
if ( $fields->resolution ) {
$resolution = ': ' . html($fields->resolution->name);
}
$h1Class = $issue->parent || $issue->parent_epic_key ? ' class="with-parent-issue"' : '';
if ( $issue->parent_epic_key ) {
if ( $issue->parent_epic ) {
echo '<p class="parent-epic">> <span class="epic ' . html($issue->parent_epic->self_epic->color) . '"><a href="issue.php?key=' . $issue->parent_epic_key . '">' . html(trim($issue->parent_epic->self_epic->name)) . '</a></span> ' . html(trim($issue->parent_epic->fields->summary)) . '</p>';
}
else {
echo '<p class="parent-epic">> <span class="epic"><a href="issue.php?key=' . $issue->parent_epic_key . '">EPIC</a></span> ' . html($issue->parent_epic_key) . '</p>';
}
}
else if ( $issue->parent ) {
echo '<p class="parent-issue">> <a href="issue.php?key=' . $issue->parent->key . '">' . $issue->parent->key . '</a> ' . html(trim($issue->parent->fields->summary)) . '</p>';
}
$storypoints = $issue->story_points ? ' (' . $issue->story_points . ' pt)' : '';
echo '<h1' . $h1Class . '><a href="issue.php?key=' . $issue->key . '">' . $issue->key . '</a> ' . html(trim($fields->summary)) . $storypoints . '</h1>';
echo '<p class="menu">' . html_links($actions) . '</p>' . "\n";
$meta = array();
echo '<p class="meta">';
$meta[] = html_icon($fields->issuetype, 'issuetype') . ' ' . html($fields->issuetype->name) . ' ' . $issue->self_epic_label;
if ($fields->priority) {
$meta[] = html_icon($fields->priority, 'priority') . ' ' . html($fields->priority->name);
}
$meta[] = html($fields->reporter->displayName) . ' (' . date(FORMAT_DATETIME, $issue->created) . ')';
$meta[] = html_icon($fields->status, 'status') . ' <strong>' . html($fields->status->name) . $resolution . '</strong>';
$meta[] = '<em>' . html($fields->assignee->displayName ?? 'No assignee') . '</em>';
if ( $fields->labels ) {
$meta[] = html_labels($fields->labels);
}
if ( !empty($fields->watches->watchCount) ) {
$meta[] = $fields->watches->watchCount . ' watchers';
}
if ( !empty($fields->votes) ) {
$voted = $fields->votes->hasVoted ? 'active' : '';
$meta[] = '<a href="issue.php?key=' . $key . '&vote=' . (int)!$voted . '&token=' . XSRF_TOKEN . '" class="ajax active-state ' . $voted. '">♥</a> (vote)';
}
if ( $issue->updated && $issue->updated > $issue->created ) {
$meta[] = 'Updated on ' . date(FORMAT_DATETIME, $issue->updated);
}
echo implode(' | ', $meta);
echo '</p>' . "\n";