blob: 00547ebe8da5ec97526ec9fdfead96b53942ae1e (
plain)
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
|
# This Action will resolve all members of a resolved group ticket
package RT::Action::ResolveMembers;
require RT::Action::Generic;
require RT::Links;
@ISA=qw(RT::Action::Generic);
#Do what we need to do and send it out.
#What does this type of Action does
# {{{ sub Describe
sub Describe {
my $self = shift;
return (ref $self . " will resolve all members of a resolved group ticket.");
}
# }}}
# {{{ sub Prepare
sub Prepare {
# nothing to prepare
return 1;
}
# }}}
sub Commit {
my $self = shift;
my $Links=RT::Links->new($RT::SystemUser);
$Links->Limit(FIELD => 'Type', VALUE => 'MemberOf');
$Links->Limit(FIELD => 'Target', VALUE => $self->TicketObj->id);
while (my $Link=$Links->Next()) {
# Todo: Try to deal with remote URIs as well
next unless $Link->BaseIsLocal;
my $base=RT::Ticket->new($self->TicketObj->CurrentUser);
# Todo: Only work if Base is a plain ticket num:
$base->Load($Link->Base);
# I'm afraid this might be a major bottleneck if ResolveGroupTicket is on.
$base->Resolve;
}
}
# Applicability checked in Commit.
# {{{ sub IsApplicable
sub IsApplicable {
my $self = shift;
1;
return 1;
}
# }}}
1;
|