SelfService update for "New ticket"

This is a patch to RT-3.4.2 share/html/SelfService/Elements/Tabs
to drop directly to the Create screen if the user only has access
to a single queue. Otherwise the tree of queues will be displayed.

Ken Marshall

diff share/html/SelfService/Elements/Tabs local/html/SelfService/Elements/Tabs
54a55,66

my $queues = RT::Queues->new($session{‘CurrentUser’});
$queues->UnLimit;

my $queue_count = 0;
my $queue_id = 1;

while (my $queue = $queues->Next) {
next unless $queue->CurrentUserHasRight(‘CreateTicket’);
$queue_id = $queue->id;
$queue_count++;
last if ($queue_count > 1);
}
68,71c80
< },
< C => { title => loc(‘New ticket’),
< path => ‘SelfService/CreateTicketInQueue.html’
< }
}
72a82,92

Please send diff -u patch.

Kenneth Marshall wrote:

This is a patch to RT-3.4.2 share/html/SelfService/Elements/Tabs
to drop directly to the Create screen if the user only has access
to a single queue. Otherwise the tree of queues will be displayed.

Ken Marshall

[snip]

Ruslan U. Zakirov wrote:

Please send diff -u patch.

Since Ken is Real Busy getting our RT 3.4 installation up and running, I’ll
post his diff:

Kenneth Marshall wrote:

This is a patch to RT-3.4.2 share/html/SelfService/Elements/Tabs
to drop directly to the Create screen if the user only has access
to a single queue. Otherwise the tree of queues will be displayed.
Ken Marshall

diff -u share/html/SelfService/Elements/Tabs local/html/SelfService/Elements/Tabs

— share/html/SelfService/Elements/Tabs 2005-05-02 12:25:35.000000000 -0500
+++ local/html/SelfService/Elements/Tabs 2005-06-10 07:36:06.000000000 -0500
@@ -52,6 +52,18 @@
&>

<%INIT>
+my $queues = RT::Queues->new($session{‘CurrentUser’});
+$queues->UnLimit;
+my $queue_count = 0;
+my $queue_id = 1;
+while (my $queue = $queues->Next) {

  • next unless $queue->CurrentUserHasRight(‘CreateTicket’);
  • $queue_id = $queue->id;
  • $queue_count++;
  • last if ($queue_count > 1);
    +}

if ($Title) {
$Title = loc (“RT Self Service”) . " / " . $Title;
@@ -65,11 +77,19 @@
},
B => { title => loc(‘Closed tickets’),
path => ‘SelfService/Closed.html’,

  •                   },
    
  •         C => { title => loc('New ticket'),
    
  •                path => 'SelfService/CreateTicketInQueue.html'
    
  •                }
    
  •                   }
           };
    

+if ($queue_count > 1) {

  •    $tabs->{C} = { title => loc('New ticket'),
    
  •                   path => 'SelfService/CreateTicketInQueue.html'
    
  •                   };
    

+} else {

  •    $tabs->{C} = { title => loc('New ticket'),
    
  •                   path => 'SelfService/Create.html?Queue=' . $queue_id
    
  •                   };
    

+}
if ($session{‘CurrentUser’}->HasRight( Right => ‘ModifySelf’,
Object => $RT::System )) {
$tabs->{Z} = { title => loc(‘Preferences’),

For computer help, call xHELP (x4357 or 713-348-4357)
On the web: http://helpdesk.rice.edu/
Rick Russell
Helpdesk Supervisor, Client Services
IT/Academic & Research Computing
Rice University
Voice: 713.348.5267 Fax: 713.348.6099
OpenPGP/GnuPG Public Key at ldap://certificate.rice.edu
761D 1C20 6428 580F BD98 F5E5 5C8C 56CA C7CB B669

signature.asc (254 Bytes)