ViewMyRequests

From Request Tracker Wiki
Jump to: navigation, search

This is a modification to the SelfService feature of RT3. Requestors can call up a list of all outstanding tickets in order to see how their requests fit into a global picture, and can also view details of outstanding tickets for which they are a requestor.

Step 1

Follow the instructions to setup AutogeneratedPassword for requestors. You can add an extra condition here to limit this option to localdomain email addresses if you like:

*RT::User::GenerateRandomNextChar = \&RT::User::_GenerateRandomNextChar; if ( ($Transaction->CreatorObj->id != $RT::Nobody->id) && + ($Transaction->CreatorObj->EmailAddress =~ /\@localdomain$/) && (!$Transaction->CreatorObj->Privileged) && ($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*') ) {

Step 2

Apply the following patches in the base of your rt3 installation:

--- share/html/SelfService/Display.html 2004-12-17 10:42:40.000000000 +0000

+++ share/html/SelfService/Display.html 2004-12-17 11:00:00.000000000 +0000
@@ -127,4 +127,10 @@
 }

+unless ( $Ticket->IsRequestor($session{'CurrentUser'}->Id) ) {

+    $m->comp( 'Error.html',
+              Why => loc("No permission to display that ticket") );
+    $m->abort();
+}
+
 my ( $code, $msg );

--- share/html/SelfService/Elements/MyRequests 2004-12-17 11:19:17.000000000 +0000

+++ share/html/SelfService/Elements/MyRequests  2004-12-17 11:19:36.000000000 +0000
@@ -34,5 +34,12 @@
 <TR>
 <TD>
+% if ( $Ticket->IsRequestor($session{'CurrentUser'}->Id) ) {
 <a href="<%$RT::WebPath%>/SelfService/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: <%$Ticket->Subject%></a>
+% } else {
+<%$Ticket->Id%>: <%$Ticket->Subject%>
+% }
+</TD>
+<TD>
+<%$Ticket->RequestorAddresses%>
 </TD>
 <TD>
@@ -50,5 +57,4 @@
 my $MyTickets;
 $MyTickets = new RT::Tickets ($session{'CurrentUser'});
-$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress);
 $MyTickets->OrderBy(FIELD => 'id', ORDER => 'ASC');

The first patch ensures that users can only view details for their own tickets through the SelfService interface, and the second causes the SelfService interface to list all tickets rather than just those requested by the current user.

Step 3

Now you just need to add (globally) the user right of 'ShowTicket' to the unprivileged users system group.