#first find any requestors with emails but *without* customer targets
my @NoCust_Requestors =
grep { $_->EmailAddress && ! $_->Customers->Count }
- @{ $self->Requestors->UserMembersObj->ItemsArrayRef };
+ @{ $self->_Requestors->UserMembersObj->ItemsArrayRef };
for my $Requestor (@NoCust_Requestors) {
my @Requestors =
grep { $_->Customers->Count }
- @{ $self->Requestors->UserMembersObj->ItemsArrayRef };
+ @{ $self->_Requestors->UserMembersObj->ItemsArrayRef };
foreach my $Requestor ( @Requestors ) {
foreach my $cust_link ( @{ $Requestor->Customers->ItemsArrayRef } ) {
# }}}
+# {{{ sub _Requestors
+
+=head2 _Requestors
+
+Private non-ACLed variant of Reqeustors so that we can look them up for the
+purposes of customer auto-association during create.
+
+=cut
+
+sub _Requestors {
+ my $self = shift:
+
+ my $group = RT::Group->new($RT::SystemUser);
+ $group->LoadTicketRoleGroup(Type => 'Requestor', Ticket => $self->Id);
+ return ($group);
+}
+
+% }}}
+
# {{{ sub Cc
=head2 Cc
unless ( $self->{"$field$type"} ) {
$self->{"$field$type"} = new RT::Links( $self->CurrentUser );
- if ( $self->CurrentUserHasRight('ShowTicket') ) {
+
+ #not sure what this ACL was supposed to do... but returning the
+ # bare (unlimited) RT::Links certainly seems wrong, it causes the
+ # $Ticket->Customers method during creation to return results for every
+ # ticket...
+ #if ( $self->CurrentUserHasRight('ShowTicket') ) {
+
# Maybe this ticket is a merged ticket
my $Tickets = new RT::Tickets( $self->CurrentUser );
# at least to myself
$self->{"$field$type"}->Limit( FIELD => 'Type',
VALUE => $type )
if ($type);
- }
+ #}
}
return ( $self->{"$field$type"} );
}