[Rt-commit] r4082 - in rt/branches/3.5-TESTING: . html/SelfService/Elements

alexmv at bestpractical.com alexmv at bestpractical.com
Mon Nov 14 15:15:00 EST 2005


Author: alexmv
Date: Mon Nov 14 15:15:00 2005
New Revision: 4082

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/html/SelfService/Elements/Tabs
Log:
 r7157 at zoq-fot-pik:  chmrr | 2005-11-14 15:14:13 -0500
 RT-Ticket: 6762
 RT-Status: resolved
 RT-Update: correspond
  * "Create" in SelfService goes straight to the only queue if they
    only have one; thanks to Kenneth Marshall <ktm at it.is.rice.edu>


Modified: rt/branches/3.5-TESTING/html/SelfService/Elements/Tabs
==============================================================================
--- rt/branches/3.5-TESTING/html/SelfService/Elements/Tabs	(original)
+++ rt/branches/3.5-TESTING/html/SelfService/Elements/Tabs	Mon Nov 14 15:15:00 2005
@@ -52,6 +52,18 @@
 &>
 <a name="skipnav" id="skipnav" accesskey="8"></a>
 <%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'),


More information about the Rt-commit mailing list