/
redmine.anixe.pl.js
65 lines (54 loc) · 1.91 KB
/
redmine.anixe.pl.js
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
if ($('#content h2:first').text() == 'Roadmap') {
// Reload to show defects and stories
function getParameters(paramName) {
var searchString = window.location.search.substring(1),
i, val, params = searchString.split("&");
var values = [];
for (i=0;i<params.length;i++) {
val = params[i].split("=");
if (val[0] == paramName) {
values.push(unescape(val[1]));
}
}
return values;
}
var ids = getParameters('tracker_ids[]');
if (ids.indexOf('1') == -1 || ids.indexOf('2') == -1 || ids.indexOf('4') == -1) {
window.location.href = window.location.pathname + '?tracker_ids[]=1&tracker_ids[]=2&tracker_ids[]=4'
}
// Show Priority
$('table.related-issues').find('tr.hascontextmenu').each(function() {
var task = $(this).find('td:nth(1) a');
var status = '';
if(task.hasClass('priority-2')) {
status = 'High';
} else if(task.hasClass('priority-3')) {
status = 'Normal';
} else if(task.hasClass('priority-4')) {
status = 'Low';
} else if(task.hasClass('priority-5')) {
status = 'Very Low';
}
$(this).append('<td>' + status + '</td>');
});
// Show Status
$('table.related-issues').find('tr.hascontextmenu').each(function() {
var $row = $(this);
var task = $row.find('td:nth(1) a');
var status = '';
if(task.hasClass('status-1')) {
status = 'New';
} else if(task.hasClass('status-2')) {
status = 'In Progress'
// status = "In Progress: " + $('#context-menu').find('a.submenu:contains("Assignee")').next('ul').find('a.icon-checked').text();
$row.css('color', '#0A992C');
} else if(task.hasClass('status-3')) {
status = 'Resolved';
$row.css('color', '#839FB4');
} else if(task.hasClass('status-5')) {
status = 'Closed';
$row.css('color', '#999').css('text-decoration', 'line-through');
}
$row.append('<td>' + status + '</td>');
});
}