[Rt-commit] r6380 - in rt/branches/3.6-RELEASE: . html/SelfService/Elements

jesse at bestpractical.com jesse at bestpractical.com
Tue Nov 7 14:22:17 EST 2006


Author: jesse
Date: Tue Nov  7 14:22:15 2006
New Revision: 6380

Modified:
   rt/branches/3.6-RELEASE/   (props changed)
   rt/branches/3.6-RELEASE/html/SelfService/Closed.html
   rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests
   rt/branches/3.6-RELEASE/html/SelfService/index.html

Log:
 r40520 at pinglin:  jesse | 2006-11-07 14:15:50 -0500
 * SelfService cleanup and regularization patches from 
         David Chandek-Stark <david.chandek.stark at duke.edu>


Modified: rt/branches/3.6-RELEASE/html/SelfService/Closed.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/SelfService/Closed.html	(original)
+++ rt/branches/3.6-RELEASE/html/SelfService/Closed.html	Tue Nov  7 14:22:15 2006
@@ -45,5 +45,10 @@
 %# END BPS TAGGED BLOCK }}}
 <& /SelfService/Elements/Header, Title => loc('Closed tickets') &>
 
-<& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status =>
-loc('closed') &>
+<& /SelfService/Elements/MyRequests, status          => ['rejected', 'resolved'], 
+                                     friendly_status => loc('closed'), 
+				     BaseURL         => $RT::WebPath . "/SelfService/Closed.html?", 
+				     Page            => $Page &>
+<%ARGS>
+$Page => 1
+</%ARGS>

Modified: rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests
==============================================================================
--- rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests	(original)
+++ rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests	Tue Nov  7 14:22:15 2006
@@ -44,41 +44,44 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <&| /Widgets/TitleBox, title =>  $title &>
-<table border="0" cellspacing="1" cellpadding="1" bgcolor="#eeeeee" width="100%">
-<tr>
-<th><&|/l&>Subject</&></th>
-<th><&|/l&>Status</&></th>
-<th><&|/l&>Owner</&></th>
-</tr>
-<tr>
-% while (my $Ticket = $MyTickets->Next) {
-<tr>
-<td>
-<a href="<%$RT::WebPath%>/SelfService/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: <%$Ticket->Subject%></a>
-</td>
-<td>
-<%loc($Ticket->Status)%>
-</td><td>
-<%$Ticket->OwnerObj->Name%>
-</td></tr>
-% }
-</table>
+<& /Elements/TicketList, Title   => $title,
+			 Format  => @Format, 
+			 Query   => $Query, 
+			 Order   => $Order, 
+			 OrderBy => $OrderBy,
+			 BaseURL => $BaseURL,
+			 Page    => $Page &>
 </&>
 
 <%INIT>
 $title ||= loc("My [_1] tickets", $friendly_status);
-my $MyTickets;
-$MyTickets = new RT::Tickets ($session{'CurrentUser'});
-$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress);
-$MyTickets->OrderBy(FIELD => 'id', ORDER => 'ASC');
-
-foreach my $status (@status) {
-
-        $MyTickets->LimitStatus(VALUE => $status);
+my $EmailAddress = $session{'CurrentUser'}->EmailAddress;
+my $Role = shift @roles;
+my $Query = "( ";
+$Query .= $Role . " = '" . $EmailAddress . "'";
+foreach $Role (@roles) {
+   $Query .= " OR " . $Role . " = '" . $EmailAddress . "'";
+}
+$Query .= " )";
+if (@status) {
+   $Query .= " AND ( Status = '";
+   $Query .= join "' OR Status = '", @status; 
+   $Query .= "' )";
 }
+my $Order = "ASC";
+my $OrderBy = "Created";
+my @Format = qq{
+   '<B><A HREF="$RT::WebPath/SelfService/Display.html?id=__id__">__id__</a></B>/TITLE:#',
+   '<B><A HREF="$RT::WebPath/SelfService/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
+   Status,
+   '__Requestors__',
+   OwnerName};
 </%INIT>
 <%ARGS>
 $title => undef
 $friendly_status => loc('open')
+ at roles => ('Requestor', 'Cc', 'AdminCc')
 @status => ('open', 'new', 'stalled')
+$BaseURL => undef
+$Page => 1
 </%ARGS>

Modified: rt/branches/3.6-RELEASE/html/SelfService/index.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/SelfService/index.html	(original)
+++ rt/branches/3.6-RELEASE/html/SelfService/index.html	Tue Nov  7 14:22:15 2006
@@ -43,6 +43,10 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /SelfService/Elements/Header, Title => undef &>
+<& /SelfService/Elements/Header, Title => loc('Open Tickets') &>
 
-<& /SelfService/Elements/MyRequests &>
+<& /SelfService/Elements/MyRequests, BaseURL => $RT::WebPath . "/SelfService/?", 
+				     Page    => $Page &>
+<%ARGS>
+$Page => 1
+</%ARGS>


More information about the Rt-commit mailing list