[Rt-commit] rt branch, 4.0/skip-reminders-on-ticket-clone, created. rt-4.0.3-41-g96351e7
Jason May
jasonmay at bestpractical.com
Wed Nov 9 16:54:44 EST 2011
The branch, 4.0/skip-reminders-on-ticket-clone has been created
at 96351e7583bae1353b632c2921ebe8752c1c3df9 (commit)
- Log -----------------------------------------------------------------
commit 96351e7583bae1353b632c2921ebe8752c1c3df9
Author: Jason May <jasonmay at bestpractical.com>
Date: Wed Nov 9 12:40:56 2011 -0500
Do not copy reminder pointers when creating a linked ticket
Linking to the same reminder in a new ticket is deceiving. Since both
links will point to the same reminder, it will disappear from both
tickets when one is marked as completed.
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 6ddbdd0..6d00955 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -306,6 +306,10 @@ if ($CloneTicket) {
my $refers_by = $CloneTicketObj->ReferredToBy;
while ( my $refer_by = $refers_by->Next ) {
+ my $base_ticket = RT::Ticket->new($session{CurrentUser});
+ my ($ok) = $base_ticket->Load($refer_by->LocalBase);
+ next if !$ok || $base_ticket->Type eq 'reminder';
+
push @refers_by, $refer_by->LocalBase;
}
$clone->{'RefersTo-new'} = join ' ', @refers_by;
diff --git a/t/web/ticket_links.t b/t/web/ticket_links.t
index cb30e92..ab0645e 100644
--- a/t/web/ticket_links.t
+++ b/t/web/ticket_links.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use RT::Test tests => 106;
+use RT::Test tests => 142;
my ( $baseurl, $m ) = RT::Test->started_ok;
ok( $m->login, "Logged in" );
@@ -105,6 +105,38 @@ for my $type ( "DependsOn", "MemberOf", "RefersTo" ) {
);
$m->content_unlike( qr{$deleted_id.*?\[deleted\]}, "no deleted ticket",
);
+
+ diag "[$type]: Testing that reminders don't get copied for $c tickets";
+ {
+ my $ticket = RT::Test->create_ticket(
+ Subject => 'test ticket',
+ Queue => 1,
+ );
+
+ $m->goto_ticket($ticket->Id);
+ $m->form_name('UpdateReminders');
+ $m->field('NewReminder-Subject' => 'hello test reminder subject');
+ $m->click_button(value => 'Save');
+ $m->text_contains('hello test reminder subject');
+
+ my $id = $ticket->Id;
+ my $type_value = $type;
+ if ($c eq 'base') {
+ $type_value = "new-$type_value";
+ }
+ else {
+ $type_value = "$type_value-new";
+ }
+
+ my $depends_on_url = sprintf(
+ '%s/Ticket/Create.html?Queue=%s&CloneTicket=%s&%s=%s',
+ $baseurl, '1', $id, $type_value, $id,
+ );
+ $m->get_ok($depends_on_url);
+ $m->form_name('TicketCreate');
+ $m->click_button(value => 'Create');
+ $m->content_lacks('hello test reminder subject');
+ }
}
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list