[rt-devel] [PATCH] Show all available on main page
Darrin Thompson
darrint at progeny.com
Fri Feb 13 17:49:59 EST 2004
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
their ticket view and requested view between top 10 and all tickets.
See attached.
--
Darrin
-------------- next part --------------
Index: share/html/index.html
===================================================================
--- share/html/index.html (revision 14571)
+++ share/html/index.html (revision 14572)
@@ -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: share/html/Elements/MyRequests
===================================================================
--- share/html/Elements/MyRequests (revision 14571)
+++ share/html/Elements/MyRequests (revision 14572)
@@ -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: share/html/Elements/MyTickets
===================================================================
--- share/html/Elements/MyTickets (revision 14571)
+++ share/html/Elements/MyTickets (revision 14572)
@@ -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: share/html/NoAuth/webrt.css
===================================================================
--- share/html/NoAuth/webrt.css (revision 14571)
+++ share/html/NoAuth/webrt.css (revision 14572)
@@ -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