[rt-devel] [PATCH] Show all available on main page 3.0.9

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


Attached is the patch applied to 3.0.9.

We want to be able to see all our tickets from the main page.

* Make main ticket page more flexible by allowing the user to toggle
   his/her ticket view and requested view between top 10 and all
tickets.


-------------- next part --------------
Index: misc/rt-enhancements/branches/3-0-9/html/index.html
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/index.html	(revision 14771)
+++ misc/rt-enhancements/branches/3-0-9/html/index.html	(revision 14772)
@@ -28,9 +28,9 @@
 <TABLE BORDER=0 WIDTH=100%>
 <TR VALIGN=TOP>
 <TD WIDTH=70%>
-<& /Elements/MyTickets &>
+<& /Elements/MyTickets, listAllRequest => $ARGS{'listAllRequest'}, listAllOwner => $ARGS{'listAllOwner'} &>
 <BR>
-<& /Elements/MyRequests &>
+<& /Elements/MyRequests, listAllRequest => $ARGS{'listAllRequest'}, listAllOwner => $ARGS{'listAllOwner'} &>
 </TD>
 <TD>
 <& /Elements/Quicksearch &>
@@ -42,6 +42,12 @@
 </TD>
 </TR>
 </TABLE>
+
+<%ARGS>
+$listAllRequest => undef
+$listAllOwner => undef
+</%ARGS>
+
 <%init>
 if ( $ARGS{'q'} ) {
     my $query = $ARGS{'q'};
Index: misc/rt-enhancements/branches/3-0-9/html/Elements/MyRequests
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Elements/MyRequests	(revision 14771)
+++ misc/rt-enhancements/branches/3-0-9/html/Elements/MyRequests	(revision 14772)
@@ -21,7 +21,13 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<& /Elements/TitleBoxStart, title => loc("[_1] highest priority tickets I requested...", $rows), bodyclass=> '' &>
+% if($ARGS{'listAllRequest'} eq 'true'){
+
+   <& /Elements/TitleBoxStart, title => '<a class="titleboxtitle" href="index.html?listAllOwner='.$ARGS{'listAllOwner'}.'&listAllRequest=">'.loc("All tickets I requested...").'</a>', bodyclass=> '' &>
+
+% }else{
+   <& /Elements/TitleBoxStart, title => '<a class="titleboxtitle" href="index.html?listAllOwner='.$ARGS{'listAllOwner'}.'&listAllRequest=true">'.loc("[_1] highest priority tickets I requested...", $rows).'</a>', bodyclass=> '' &>
+% }						
 <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
 <TR>
 <TH align=right><&|/l&>#</&></TH>
@@ -32,7 +38,8 @@
 </TR>
 % my $i;
 % while (my $Ticket = $MyTickets->Next) {
-% $i++;
+%    if($ARGS{'listAllRequest'} ne 'true') { last if $i++ >=$rows; }
+%    else {$i++; }
 <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >
 <TD ALIGN=RIGHT>
 <%$Ticket->Id%>
@@ -73,7 +80,11 @@
 $MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress);
 $MyTickets->LimitStatus(VALUE => "open");
 $MyTickets->LimitStatus(VALUE => "new");
-$MyTickets->RowsPerPage($rows);
+$MyTickets->LimitStatus(VALUE => "stalled");
 $MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
+</%INIT>
 
-</%INIT>
+<%ARGS>
+$listAllRequest => undef;
+$listAllOwner => undef;
+</%ARGS>
Index: misc/rt-enhancements/branches/3-0-9/html/Elements/MyTickets
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/Elements/MyTickets	(revision 14771)
+++ misc/rt-enhancements/branches/3-0-9/html/Elements/MyTickets	(revision 14772)
@@ -21,7 +21,14 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<& /Elements/TitleBoxStart, title => loc("[_1] highest priority tickets I own...", $rows), bodyclass=> '' &>
+
+% if($ARGS{'listAllOwner'} eq 'true'){
+
+    <& /Elements/TitleBoxStart, title => '<a class="titleboxtitle" href="index.html?listAllOwner=&listAllRequest='.$ARGS{'listAllRequest'}.'">'.loc("All tickets I own...").'</a>', bodyclass=> '' &>
+    
+% }else{
+   <& /Elements/TitleBoxStart, title => '<a class="titleboxtitle" href="index.html?listAllOwner=true&listAllRequest='.$ARGS{'listAllRequest'}.'">'.loc("[_1] highest priority tickets I own...", $rows).'</a>', bodyclass=> '' &>
+% }
 <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
 <TR>
 <TH ALIGN=RIGHT><&|/l&>#</&></TH>
@@ -34,7 +41,8 @@
 % my $i;
 % while (my $Ticket = $MyTickets->Next) {
 %     next if $Ticket->HasUnresolvedDependencies( Type => 'approval' );
-%     last if $i++ >= $rows;
+%     if($ARGS{'listAllOwner'} ne 'true') { last if $i++ >= $rows; }
+%     else{ $i++; }	
 <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >                                
 <TD ALIGN=RIGHT>
 <%$Ticket->Id%>
@@ -70,13 +78,20 @@
 
 
 <%INIT>
-my $rows = $RT::MyTicketsLength;
+
 my $MyTickets;
 $MyTickets = new RT::Tickets ($session{'CurrentUser'});
 $MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id);
 $MyTickets->LimitStatus(VALUE => "open");
 $MyTickets->LimitStatus(VALUE => "new");
-$MyTickets->RowsPerPage($rows);
+$MyTickets->LimitStatus(VALUE => "stalled");
 $MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
 
+my $rows = 10;
+
 </%INIT>
+
+<%ARGS>
+$listAllRequest => undef;
+$listAllOwner => undef;
+</%ARGS>
Index: misc/rt-enhancements/branches/3-0-9/html/NoAuth/webrt.css
===================================================================
--- misc/rt-enhancements/branches/3-0-9/html/NoAuth/webrt.css	(revision 14771)
+++ misc/rt-enhancements/branches/3-0-9/html/NoAuth/webrt.css	(revision 14772)
@@ -269,7 +269,7 @@
              color: #ffffff;}
 span.productname { font-size: 2em;
              color: #0066cc;}
-SPAN.titleboxtitle {
+SPAN.titleboxtitle, a.titleboxtitle {
         font-size: 1.1em;
         color: #ffffff;
 	 vertical-align: middle;


More information about the Rt-devel mailing list