[Rt-commit] rt branch, 4.0/expand-ticket-membmers-once, created. rt-4.0.4-221-g9919763
? sunnavy
sunnavy at bestpractical.com
Sat Jan 21 14:46:51 EST 2012
The branch, 4.0/expand-ticket-membmers-once has been created
at 9919763c33d24a415d4be465945db6c1616a8af9 (commit)
- Log -----------------------------------------------------------------
commit 9919763c33d24a415d4be465945db6c1616a8af9
Author: sunnavy <sunnavy at gmail.com>
Date: Sun Jan 22 02:30:00 2012 +0800
don't expand the ticket if it's expanded before.
this change reduces links and keeps ui clean when relationship is
complex or weirdly circular.
see also issue #19015
diff --git a/share/html/Ticket/Elements/ShowMembers b/share/html/Ticket/Elements/ShowMembers
index c17c6e7..db197c3 100755
--- a/share/html/Ticket/Elements/ShowMembers
+++ b/share/html/Ticket/Elements/ShowMembers
@@ -48,8 +48,9 @@
<ul>
% while (my $link = $members->Next) {
<li><& /Elements/ShowLink, URI => $link->BaseURI &><br />
+% next if $checked->{$link->BaseObj->id};
% if ($depth < 8) {
-<& /Ticket/Elements/ShowMembers, Ticket => $link->BaseObj, depth => ($depth+1) &>
+<& /Ticket/Elements/ShowMembers, Ticket => $link->BaseObj, depth => ($depth+1), checked => $checked &>
% }
</li>
% }
@@ -61,9 +62,13 @@ return unless $Ticket;
my $members = $Ticket->Members;
return unless $members->Count;
+return if $checked->{$Ticket->id};
+
+$checked->{$Ticket->id} = 1;
</%INIT>
<%ARGS>
$Ticket => undef
$depth => 1
+$checked => {}
</%ARGS>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list