line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::bif::log::task; |
2
|
1
|
|
|
1
|
|
4492
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
4
|
1
|
|
|
1
|
|
6
|
use feature 'state'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
5
|
1
|
|
|
1
|
|
5
|
use Bif::Mo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.1.5_5'; |
8
|
|
|
|
|
|
|
extends 'App::bif::log'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub run { |
11
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
12
|
1
|
|
|
|
|
4
|
my $opts = $self->opts; |
13
|
1
|
|
|
|
|
7
|
my $db = $self->db; |
14
|
0
|
|
|
|
|
|
my $info = $self->get_node( $opts->{id}, 'task' ); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
state $have_dbix = DBIx::ThinSQL->import(qw/ qv concat coalesce/); |
17
|
0
|
|
|
|
|
|
my $now = $self->now; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $sth = $db->xprepare( |
20
|
|
|
|
|
|
|
select => [ |
21
|
|
|
|
|
|
|
'task_deltas.task_id AS id', |
22
|
|
|
|
|
|
|
'n.uuid AS uuid', |
23
|
|
|
|
|
|
|
concat( qv('c'), 'task_deltas.change_id' )->as('change_id'), |
24
|
|
|
|
|
|
|
'changes.uuid AS change_uuid', |
25
|
|
|
|
|
|
|
'task_deltas.title', |
26
|
|
|
|
|
|
|
'changes.mtime AS mtime', |
27
|
|
|
|
|
|
|
"changes.mtimetz AS mtimetz", |
28
|
|
|
|
|
|
|
'changes.mtimetzhm AS mtimetzhm', |
29
|
|
|
|
|
|
|
"$now - changes.mtime AS mtime_age", |
30
|
|
|
|
|
|
|
'changes.action', |
31
|
|
|
|
|
|
|
'COALESCE(changes.author,e.name) AS author', |
32
|
|
|
|
|
|
|
"COALESCE(changes.author_contact_method || ': ' || " |
33
|
|
|
|
|
|
|
. "changes.author_contact, ecm.method || ': ' || " |
34
|
|
|
|
|
|
|
. "ecm.mvalue) AS contact", |
35
|
|
|
|
|
|
|
'task_status.status', |
36
|
|
|
|
|
|
|
'task_status.status', |
37
|
|
|
|
|
|
|
'projects.title AS project_title', |
38
|
|
|
|
|
|
|
'changes_tree.depth', |
39
|
|
|
|
|
|
|
'changes.message', |
40
|
|
|
|
|
|
|
], |
41
|
|
|
|
|
|
|
from => 'task_deltas', |
42
|
|
|
|
|
|
|
inner_join => 'changes', |
43
|
|
|
|
|
|
|
on => 'changes.id = task_deltas.change_id', |
44
|
|
|
|
|
|
|
inner_join => 'entities e', |
45
|
|
|
|
|
|
|
on => 'e.id = changes.identity_id', |
46
|
|
|
|
|
|
|
inner_join => 'entity_contact_methods ecm', |
47
|
|
|
|
|
|
|
on => 'ecm.id = e.default_contact_method_id', |
48
|
|
|
|
|
|
|
inner_join => 'nodes n', |
49
|
|
|
|
|
|
|
on => 'n.id = task_deltas.task_id', |
50
|
|
|
|
|
|
|
left_join => 'task_status', |
51
|
|
|
|
|
|
|
on => 'task_status.id = task_deltas.task_status_id', |
52
|
|
|
|
|
|
|
left_join => 'projects', |
53
|
|
|
|
|
|
|
on => 'projects.id = task_status.project_id', |
54
|
|
|
|
|
|
|
left_join => 'hubs h', |
55
|
|
|
|
|
|
|
on => 'h.id = projects.default_hub_id', |
56
|
|
|
|
|
|
|
inner_join => 'changes_tree', |
57
|
|
|
|
|
|
|
on => { |
58
|
|
|
|
|
|
|
'changes_tree.parent' => $info->{first_change_id}, |
59
|
|
|
|
|
|
|
'changes_tree.child' => \'task_deltas.change_id' |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
where => { 'task_deltas.task_id' => $info->{id} }, |
62
|
0
|
|
|
|
|
|
order_by => 'changes.path ASC', |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
$sth->execute; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
$self->start_pager; |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $first = $sth->hashref; |
70
|
0
|
|
|
|
|
|
$first->{ctime} = $first->{mtime}; |
71
|
0
|
|
|
|
|
|
$first->{ctimetz} = $first->{mtimetz}; |
72
|
0
|
|
|
|
|
|
$first->{ctimetzhm} = $first->{mtimetzhm}; |
73
|
0
|
|
|
|
|
|
$first->{ctime_age} = $first->{mtime_age}; |
74
|
0
|
|
|
|
|
|
$self->log_item( $first, 'task' ); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
$self->log_comment($_) for $sth->hashrefs; |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
return $self->ok('LogTask'); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
__END__ |