| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::bif::show::issue; |
|
2
|
1
|
|
|
1
|
|
3131
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
25
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
23
|
|
|
4
|
1
|
|
|
1
|
|
11
|
use Bif::Mo; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
7
|
|
|
5
|
1
|
|
|
1
|
|
459
|
use DBIx::ThinSQL qw/bv sum case coalesce concat qv sq/; |
|
|
1
|
|
|
|
|
19549
|
|
|
|
1
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.1.5_5'; |
|
8
|
|
|
|
|
|
|
extends 'App::bif::show'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub run { |
|
11
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
|
12
|
1
|
|
|
|
|
3
|
my $opts = $self->opts; |
|
13
|
1
|
|
|
|
|
6
|
my $db = $self->db; |
|
14
|
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
$opts->{id} = $self->uuid2id( $opts->{id} ); |
|
16
|
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $info = $self->get_node( $opts->{id}, 'issue' ); |
|
18
|
0
|
|
|
|
|
|
my $now = $self->now; |
|
19
|
0
|
|
|
|
|
|
my @data; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $ref = $db->xhashref( |
|
22
|
|
|
|
|
|
|
select => [ |
|
23
|
|
|
|
|
|
|
'SUBSTR(n.uuid,1,8) as uuid', |
|
24
|
|
|
|
|
|
|
'i.title', |
|
25
|
|
|
|
|
|
|
'n.ctime', |
|
26
|
|
|
|
|
|
|
'n.ctimetz', |
|
27
|
|
|
|
|
|
|
'n.ctimetzhm AS ctimetzhm', |
|
28
|
|
|
|
|
|
|
"$now - n.ctime AS ctime_age", |
|
29
|
|
|
|
|
|
|
'n.mtime', |
|
30
|
|
|
|
|
|
|
'n.mtimetz', |
|
31
|
|
|
|
|
|
|
'n.mtimetzhm AS mtimetzhm', |
|
32
|
|
|
|
|
|
|
"$now - n.mtime AS mtime_age", |
|
33
|
|
|
|
|
|
|
'e1.name as creator', |
|
34
|
|
|
|
|
|
|
'e2.name as updator', |
|
35
|
|
|
|
|
|
|
], |
|
36
|
|
|
|
|
|
|
from => 'nodes n', |
|
37
|
|
|
|
|
|
|
inner_join => 'changes c1', |
|
38
|
|
|
|
|
|
|
on => 'c1.id = n.first_change_id', |
|
39
|
|
|
|
|
|
|
inner_join => 'entities e1', |
|
40
|
|
|
|
|
|
|
on => 'e2.id = c2.identity_id', |
|
41
|
|
|
|
|
|
|
inner_join => 'changes c2', |
|
42
|
|
|
|
|
|
|
on => 'c2.id = n.last_change_id', |
|
43
|
|
|
|
|
|
|
inner_join => 'entities e2', |
|
44
|
|
|
|
|
|
|
on => 'e1.id = c1.identity_id', |
|
45
|
|
|
|
|
|
|
inner_join => 'issues i', |
|
46
|
|
|
|
|
|
|
on => 'i.id = n.id', |
|
47
|
|
|
|
|
|
|
where => { 'n.id' => $info->{id} }, |
|
48
|
0
|
|
|
|
|
|
); |
|
49
|
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
push( @data, $self->header( ' UUID', $ref->{uuid} ), ); |
|
51
|
|
|
|
|
|
|
push( @data, |
|
52
|
|
|
|
|
|
|
$self->header( ' Created', $self->ctime_ago($ref) ), |
|
53
|
0
|
|
|
|
|
|
$self->header( ' Created-By', $ref->{creator} ), |
|
54
|
|
|
|
|
|
|
); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my @refs = $db->xhashrefs( |
|
57
|
|
|
|
|
|
|
with => 'ids', |
|
58
|
|
|
|
|
|
|
as => sq( |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# self |
|
61
|
|
|
|
|
|
|
select => bv( $info->{id}, DBI::SQL_INTEGER )->as('id'), |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# parent |
|
64
|
|
|
|
|
|
|
union_select => 'i.src_id', |
|
65
|
|
|
|
|
|
|
from => 'issues i', |
|
66
|
|
|
|
|
|
|
where => { 'i.id' => $info->{id} }, |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# siblings |
|
69
|
|
|
|
|
|
|
union_select => 'i2.id', |
|
70
|
|
|
|
|
|
|
from => 'issues i', |
|
71
|
|
|
|
|
|
|
inner_join => 'issues i2', |
|
72
|
|
|
|
|
|
|
on => 'i2.src_id = i.src_id', |
|
73
|
|
|
|
|
|
|
where => { 'i.id' => $info->{id} }, |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# children |
|
76
|
|
|
|
|
|
|
union_select => 'i.id', |
|
77
|
|
|
|
|
|
|
from => 'issues i', |
|
78
|
|
|
|
|
|
|
where => { 'i.src_id' => $info->{id} }, |
|
79
|
0
|
|
|
|
|
|
), |
|
80
|
|
|
|
|
|
|
select => [ |
|
81
|
|
|
|
|
|
|
'i.id AS id', |
|
82
|
|
|
|
|
|
|
'pn.path', |
|
83
|
|
|
|
|
|
|
'ist.status', |
|
84
|
|
|
|
|
|
|
'c.mtime AS mtime', |
|
85
|
|
|
|
|
|
|
'c.mtimetz AS mtimetz', |
|
86
|
|
|
|
|
|
|
'c.mtimetzhm AS mtimetzhm', |
|
87
|
|
|
|
|
|
|
"$now - c.mtime AS mtime_age", |
|
88
|
|
|
|
|
|
|
'p.default_hub_id', |
|
89
|
|
|
|
|
|
|
], |
|
90
|
|
|
|
|
|
|
from => 'ids', |
|
91
|
|
|
|
|
|
|
inner_join => 'issues i', |
|
92
|
|
|
|
|
|
|
on => 'i.id = ids.id', |
|
93
|
|
|
|
|
|
|
inner_join => 'projects p', |
|
94
|
|
|
|
|
|
|
on => 'p.id = i.project_id', |
|
95
|
|
|
|
|
|
|
inner_join => 'nodes pn', |
|
96
|
|
|
|
|
|
|
on => 'pn.id = i.project_id', |
|
97
|
|
|
|
|
|
|
inner_join => 'issue_status ist', |
|
98
|
|
|
|
|
|
|
on => 'ist.id = i.issue_status_id', |
|
99
|
|
|
|
|
|
|
inner_join => 'nodes n', |
|
100
|
|
|
|
|
|
|
on => 'n.id = i.id', |
|
101
|
|
|
|
|
|
|
inner_join => 'changes c', |
|
102
|
|
|
|
|
|
|
on => 'c.id = n.first_change_id', |
|
103
|
|
|
|
|
|
|
order_by => 'pn.path', |
|
104
|
|
|
|
|
|
|
); |
|
105
|
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my %seen; |
|
107
|
0
|
|
|
|
|
|
my $count = @refs; |
|
108
|
0
|
|
|
|
|
|
my $i = 1; |
|
109
|
0
|
|
|
|
|
|
foreach my $ref (@refs) { |
|
110
|
0
|
|
|
|
|
|
my @ago = $self->mtime_ago($ref); |
|
111
|
|
|
|
|
|
|
|
|
112
|
0
|
|
|
|
|
|
push( |
|
113
|
|
|
|
|
|
|
@data, |
|
114
|
|
|
|
|
|
|
$self->header( |
|
115
|
|
|
|
|
|
|
' Status', |
|
116
|
|
|
|
|
|
|
"$ref->{path}/$ref->{id}: $ref->{status} (" . $ago[0] . ')', |
|
117
|
|
|
|
|
|
|
$ago[1] |
|
118
|
|
|
|
|
|
|
), |
|
119
|
|
|
|
|
|
|
); |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
push( @data, |
|
123
|
|
|
|
|
|
|
$self->header( ' Updated', $self->mtime_ago($ref) ), |
|
124
|
|
|
|
|
|
|
$self->header( ' Updated-By', $ref->{updator} ), |
|
125
|
0
|
0
|
|
|
|
|
) unless $ref->{mtime} == $ref->{ctime}; |
|
126
|
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
$self->start_pager; |
|
128
|
0
|
|
|
|
|
|
print $self->render_table( 'l l', [ 'Issue', $ref->{title} ], \@data, 1 ); |
|
129
|
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
print "\n"; |
|
131
|
|
|
|
|
|
|
$self->dispatch( 'App::bif::log::issue', |
|
132
|
0
|
|
|
|
|
|
{ opts => { id => $opts->{id} } } ); |
|
133
|
|
|
|
|
|
|
|
|
134
|
0
|
|
|
|
|
|
$self->ok( 'ShowIssue', \@data ); |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
1; |
|
138
|
|
|
|
|
|
|
__END__ |