Skip to content

Commit c999de4

Browse files
Merge branch '5.0/exclude-owner-from-one-time-inputs' into 5.0-trunk
2 parents 0cc22cc + 259f7a5 commit c999de4

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

share/html/Ticket/Elements/UpdateCc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ my %txn_addresses = %{$TicketObj->TransactionAddresses};
177177
my @people_addresses = Email::Address->parse( $TicketObj->RequestorAddresses );
178178
push @people_addresses, Email::Address->parse( $TicketObj->CcAddresses );
179179
push @people_addresses, Email::Address->parse( $TicketObj->AdminCcAddresses );
180+
if ( my $owner_email = $TicketObj->OwnerObj->EmailAddress ) {
181+
push @people_addresses, Email::Address->parse( $owner_email );
182+
}
180183

181184
my @one_time_Ccs;
182185

t/web/ticket_role_input.t

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ok( $root->Load( 'root' ), 'load root user' );
1818

1919
my $alice = RT::Test->load_or_create_user( Name => 'alice', EmailAddress => 'alice@example.com' );
2020
ok( $alice->id, 'created user alice' );
21+
ok( $alice->PrincipalObj->GrantRight( Object => RT->System, Right => 'OwnTicket' ) );
2122

2223
my $bob = RT::Test->load_or_create_user( Name => 'bob', EmailAddress => 'bob@example.com' );
2324
ok( $bob->id, 'created user bob' );
@@ -129,6 +130,47 @@ diag "Test ticket update page";
129130
$m->content_contains( 'BCC: richard@example.com' );
130131
}
131132

133+
diag "Test checkboxes for One-time Cc/Bcc on ticket update page";
134+
{
135+
136+
my $ticket = RT::Test->create_ticket(
137+
Queue => $queue,
138+
Subject => 'test inputs on update',
139+
Content => 'test content',
140+
Requestor => 'foo@example.com',
141+
Cc => 'richard@example.com',
142+
AdminCc => 'bob',
143+
);
144+
$m->goto_ticket( $ticket->id, 'Update' );
145+
is( $m->dom->find('.ticket-update-suggested-cc input')->size, 0, 'No one-time checkboxes' );
146+
147+
$m->submit_form_ok(
148+
{
149+
form_name => 'TicketUpdate',
150+
fields => {
151+
UpdateContent => 'test content',
152+
UpdateCc => 'alice@example.com, foo@example.com',
153+
UpdateBcc => 'richard@example.com, bob@example.com',
154+
},
155+
button => 'SubmitTicket',
156+
},
157+
'submit form TicketUpdate'
158+
);
159+
$m->content_contains('Comments added');
160+
161+
$m->goto_ticket( $ticket->id, 'Update' );
162+
163+
is( $m->dom->find('.ticket-update-suggested-cc input')->size, 2, 'Two one-time checkboxes' );
164+
ok( $m->dom->at('.ticket-update-suggested-cc input[name="UpdateCc-alice@example.com"]'),
165+
'One-time Cc checkbox for alice@example.com' );
166+
ok( $m->dom->at('.ticket-update-suggested-cc input[name="UpdateBcc-alice@example.com"]'),
167+
'One-time Bcc checkbox for alice@example.com' );
168+
169+
ok( $ticket->SetOwner( $alice->Id ) );
170+
$m->goto_ticket( $ticket->id, 'Update' );
171+
is( $m->dom->find('.ticket-update-suggested-cc input')->size, 0, 'No one-time checkboxes' );
172+
}
173+
132174
diag "Test ticket bulk update page";
133175
{
134176

0 commit comments

Comments
 (0)