[Rt-commit] rt branch, 4.0/skip-reminders-on-ticket-clone, updated. rt-4.0.3-46-g779d5d3
Alex Vandiver
alexmv at bestpractical.com
Wed Jan 25 17:32:05 EST 2012
The branch, 4.0/skip-reminders-on-ticket-clone has been updated
via 779d5d3634df71cf4f4faa3f40ce392197c4b7e9 (commit)
from 0236a29c9fca48b7729d7fd6155e9e1ddb36c0d0 (commit)
Summary of changes:
share/html/m/ticket/create | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 779d5d3634df71cf4f4faa3f40ce392197c4b7e9
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jan 25 17:20:19 2012 -0500
Apply the code changes from this branch to the mobile version as well
Even though the mobile interface does not currently provide a UI for
cloning tickets (the only interface is through Elements/ShowLinks, which
hardcodes /Ticket/Display.html), this keeps the two copies of the code
in synch. This is so when we collapse these two codepaths back together
later, they will be more obviously the same code.
diff --git a/share/html/m/ticket/create b/share/html/m/ticket/create
index 3bf402d..b89dec7 100644
--- a/share/html/m/ticket/create
+++ b/share/html/m/ticket/create
@@ -92,14 +92,28 @@ if ($CloneTicket) {
my $members = $CloneTicketObj->Members;
my ( @members, @members_of, @refers, @refers_by, @depends, @depends_by );
my $refers = $CloneTicketObj->RefersTo;
+ my $get_link_value = sub {
+ my ($link, $type) = @_;
+ my $uri_method = $type . 'URI';
+ my $local_method = 'Local' . $type;
+ my $uri = $link->$uri_method;
+ return if $uri->IsLocal and
+ $uri->Object and
+ $uri->Object->isa('RT::Ticket') and
+ $uri->Object->Type eq 'reminder';
+
+ return $link->$local_method || $uri->URI;
+ };
while ( my $refer = $refers->Next ) {
- push @refers, $refer->LocalTarget;
+ my $refer_value = $get_link_value->($refer, 'Target');
+ push @refers, $refer_value if defined $refer_value;
}
$clone->{'new-RefersTo'} = join ' ', @refers;
my $refers_by = $CloneTicketObj->ReferredToBy;
while ( my $refer_by = $refers_by->Next ) {
- push @refers_by, $refer_by->LocalBase;
+ my $refer_by_value = $get_link_value->($refer_by, 'Base');
+ push @refers_by, $refer_by_value if defined $refer_by_value;
}
$clone->{'RefersTo-new'} = join ' ', @refers_by;
if (0) { # Temporarily disabled
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list