[rt-devel] [PATCH] Colors and Child Ticket Links 3.0.9

Tammy Dugan tdugan at progeny.com
Thu Feb 19 14:15:12 EST 2004


Attached is the patch applied to 3.0.9.

We use child tickets a lot. This patch helps make the child ticket tree 
more usable for us.

* Add color support to make it easier to distinguish ticket status
   (particularly useful for tickets with lots of children).
* Minor related fixes to bring child tickets in line with other
   related tickets:
   + Link the entire child ticket number/subject
   + Add owner name

-------------- next part --------------
Index: misc/rt-enhancements/branches/3-0-9/html/Ticket/Elements/ShowLinks
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Ticket/Elements/ShowLinks	(revision 14769)
+++ misc/rt-enhancements/branches/3-0-9/html/Ticket/Elements/ShowLinks	(revision 14770)
@@ -27,7 +27,8 @@
     <td class="value">
 <ul>
 % while (my $Link = $Ticket->DependsOn->Next) {
-<li><& ShowLink, URI => $Link->TargetURI &>
+% my $status = $Link->TargetURI->Object->Status;
+<li class="<% $status %>"><& ShowLink, URI => $Link->TargetURI &>
 % }
 </ul>
     </td>
@@ -37,7 +38,8 @@
     <td class="value">
 <ul>
 % while (my $Link = $Ticket->DependedOnBy->Next) {
-<li><& ShowLink, URI => $Link->BaseURI &>
+% my $status = $Link->BaseURI->Object->Status;
+<li class="do <% $status %>"><& ShowLink, URI => $Link->BaseURI &>
 % }
 </ul>
     </td>
@@ -47,7 +49,8 @@
     <td class="value">
 <ul>
 % while (my $Link = $Ticket->MemberOf->Next) {
-<li><& ShowLink, URI => $Link->TargetURI &>
+% my $status = $Link->TargetURI->Object->Status;
+<li class="<% $status %>"><& ShowLink, URI => $Link->TargetURI &>
 % }
 </ul>
     </td>
@@ -61,7 +64,8 @@
     <td class="value">
 <ul>
 % while (my $Link = $Ticket->RefersTo->Next) {
-<li><& ShowLink, URI => $Link->TargetURI &>
+% my $status = $Link->TargetURI->Object->Status;
+<li class="<% $status %>"><& ShowLink, URI => $Link->TargetURI &>
 % }
 </ul>
     </td>
@@ -71,7 +75,8 @@
     <td class="value">
     <ul>
 % while (my $Link = $Ticket->ReferredToBy->Next) {
-<li><& ShowLink, URI => $Link->BaseURI &>
+% my $status = $Link->BaseURI->Object->Status;
+<li class="<% $status %>"><& ShowLink, URI => $Link->BaseURI &>
 % }
 </ul>
     </td>
Index: misc/rt-enhancements/branches/3-0-9/html/Ticket/Elements/ShowMembers
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Ticket/Elements/ShowMembers	(revision 14769)
+++ misc/rt-enhancements/branches/3-0-9/html/Ticket/Elements/ShowMembers	(revision 14770)
@@ -25,7 +25,7 @@
 <UL>
 % while (my $link = $members->Next) {
 % my $member= $link->BaseObj;
-<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: <%$member->Subject%> [<%loc($member->Status)%>]<br>
+<LI class="<% $member->Status %>"><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%loc($member->Status)%>]</a><br>
 % if ($depth < 8) {
 <&/Ticket/Elements/ShowMembers, Ticket => $member, depth => ($depth+1) &> 
 % }
Index: misc/rt-enhancements/branches/3-0-9/html/Search/Elements/TicketRow
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Search/Elements/TicketRow	(revision 14769)
+++ misc/rt-enhancements/branches/3-0-9/html/Search/Elements/TicketRow	(revision 14770)
@@ -31,7 +31,10 @@
 >
 <TD ROWSPAN="2"><B><A HREF="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->id%></a></B></TD>
 <TD><B><A HREF="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Subject%></a></B></TD>
-<TD><%loc($Ticket->Status)%></TD>
+% my $status = $Ticket->Status;
+<TD class="<% $status %>">
+<%loc($Ticket->Status)%>
+</TD>
 <TD><%$Ticket->QueueObj->Name%></TD>
 <TD><%$Ticket->Owner == $RT::Nobody->Id ? loc('Nobody') : $Ticket->OwnerObj->Name%></TD>
 <TD><%$Ticket->Priority%></TD>
Index: misc/rt-enhancements/branches/3-0-9/html/Elements/MyRequests
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Elements/MyRequests	(revision 14769)
+++ misc/rt-enhancements/branches/3-0-9/html/Elements/MyRequests	(revision 14770)
@@ -45,7 +45,8 @@
 <TD>
 <%$Ticket->QueueObj->Name%>
 </TD>
-<TD>
+% my $status = $Ticket->Status;
+<TD class="<% $status %>">
 % if ($Ticket->HasUnresolvedDependencies ) {
 %     if ($Ticket->HasUnresolvedDependencies( Type => 'approval'  )) { 
 <em><&|/l&>(pending approval)</&></em>
Index: misc/rt-enhancements/branches/3-0-9/html/Elements/MyTickets
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Elements/MyTickets	(revision 14769)
+++ misc/rt-enhancements/branches/3-0-9/html/Elements/MyTickets	(revision 14770)
@@ -47,7 +47,8 @@
 <TD>
 <%$Ticket->QueueObj->Name%>
 </TD>
-<TD>
+%my $status = $Ticket->Status;
+<TD class="<% $status %>">
 % if ($Ticket->HasUnresolvedDependencies ) {
 %     if ($Ticket->HasUnresolvedDependencies( Type => 'approval' ) or
 %         $Ticket->HasUnresolvedDependencies( Type => 'code' )) {
Index: misc/rt-enhancements/branches/3-0-9/html/NoAuth/webrt.css
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/NoAuth/webrt.css	(revision 14769)
+++ misc/rt-enhancements/branches/3-0-9/html/NoAuth/webrt.css	(revision 14770)
@@ -331,6 +331,33 @@
 	margin-bottom:0;
 }
 
+/* highlights status text */
+td.open {
+        color: #0FBF0F; //green
+}
+td.new {
+        color: #C20E12; //red
+}
+td.stalled {
+        color: #0000FF; //blue
+}
+td.resolved, td.rejected {
+        color: #808080; //gray
+}
+  
+li.open {
+        background-color: #2FAD2F; //green
+}
+li.new {
+        background-color: #E94343; //red
+}
+li.stalled {
+        background-color: #5E90DC; //blue
+}
+li.resolved, li.rejected {
+        background-color: #808080; //gray
+}
+
 <%flags>
 inherit => undef
 </%flags>


More information about the Rt-devel mailing list